Skip to content
Chapter 05Prometheus integration

Turn Prometheus alerts into an on-call response

Connect Alertmanager to your workspace, choose which alerts reach people, and verify firing, acknowledgement and resolution before enabling production traffic.

18 min read

This integration creates Comtinel incidents directly from monitoring alerts. You do not need to create a Jira issue first. Keep your existing Jira connection if your team also receives support tickets: both sources can share one workspace and use different response teams.

For rules evaluated by Grafana and sent through its contact points, follow Grafana integration, including when the rule queries a Prometheus datasource.

Which system does what?

Prometheus detects the condition
It collects metrics and evaluates alert rules. Open its Alerts page to inspect pending and firing alerts.
Alertmanager delivers the alert
It groups notifications, applies silences and inhibition rules, and sends the selected alert group to Comtinel. Check its alert view and delivery logs when tracing a notification.
Comtinel finds the owner
It creates one incident per accepted alert, selects a source-specific routing rule, and follows the team's escalation policy until someone accepts, the alert resolves, or the policy has no remaining steps.

If you know Jira Automation, the equivalent of its trigger and condition is a Prometheus alert rule. Its “Send web request” action is the Alertmanager receiver; its closed-status update is Alertmanager's resolved notification. Grafana can display these metrics, but a dashboard is not the sender. This chapter uses Prometheus rules and Alertmanager, not Grafana-managed contact points. See the Alertmanager overview.

Before you begin

  • A Comtinel workspace admin can configure integrations, teams and routing. Ask your monitoring owner to handle Prometheus and Alertmanager changes.
  • For a new workspace, ask Comtinel support to confirm Prometheus webhook activation and the required network permissions before testing.
  • Alertmanager must reach the HTTPS webhook URL. Prometheus must reach Alertmanager. Metric targets stay in your own environment.
  • Choose a test window and willing responders with verified contact methods. These tests can send real emails, SMS messages and calls.

For a VM or container deployment, edit the configuration files mounted into the running services. File paths below are examples, not installation instructions. For Kubernetes, identify the owning Operator or Helm release first; its resources, selectors and mounted secrets control which configuration actually reaches the pods.

Prepare the response path in Comtinel

  1. 1

    Choose the people who will receive the test

    Create or select a test team, include the responders, and create an on-call schedule covering the test time. Attach an escalation policy with the intended targets and channels.

  2. 2

    Create a Prometheus routing rule

    In Routing rules, choose source Prometheus, alert name ComtinelTestAlert and severity critical. Add the exact label matcher instance=comtinel-test and select the test team and policy. This matches both the panel test and the temporary rule below. A workspace containing only Jira rules will leave Prometheus incidents unrouted, without escalation.

  3. 3

    Copy the integration URL and generate its secret

    Open Prometheus integration in your workspace navigation. Copy the displayed URL and click Generate secret. Save the secret securely when shown; it cannot be retrieved later.

    Example endpoint — use the URL shown in your workspacehttps://comtinel.com/webhooks/prometheus/YOUR_WORKSPACE_ID
  4. 4

    Save enabled status and the severity allowlist

    Enable the integration and keep critical selected for the test. The default allowlist is critical and warning. Save your settings before sending anything. These values match the alert's severity label; they are separate from routing filters.

An empty allowlist accepts every firing alert
Unchecking every severity does not disable paging. It accepts all severities, including alerts without a severity label. Use the enabled setting to disable the integration. Resolution messages can still close existing incidents after an allowlist change.

The Prometheus secret is different from the Jira secret. A Jira token will not authenticate this endpoint. For FYI recipients, add a separate Prometheus severity watcher rule on the team; existing Jira watcher rules remain Jira-only.

Connect your Prometheus instance to Alertmanager

The following is a complete minimal Prometheus configuration for a new instance. Replace the host placeholders with addresses reachable from Prometheus. On an existing instance, merge the rule file, Alertmanager target and any missing scrape job into its existing lists; keep your current jobs and settings. Use your deployment's TLS and authentication settings for protected monitoring endpoints.

prometheus.yml
# /etc/prometheus/prometheus.yml — minimal example for a new instance
global:
  scrape_interval: 30s
  evaluation_interval: 30s

rule_files:
  - /etc/prometheus/rules/comtinel*.yml

alerting:
  alertmanagers:
    - static_configs:
        - targets: ['YOUR_ALERTMANAGER_HOST:9093']

scrape_configs:
  - job_name: node-exporter
    static_configs:
      - targets: ['YOUR_NODE_EXPORTER_HOST:9100']

The production example below reads CPU counters exposed by node_exporter. First confirm its target is healthy and node_cpu_seconds_total returns data in Prometheus. The expression measures average non-idle CPU per instance over five minutes; it does not require a pre-existing recording rule. Adapt its threshold and duration to your service. Node Exporter setup and Prometheus configuration describe the underlying setup.

Production example — comtinel.yml
# /etc/prometheus/rules/comtinel.yml
groups:
  - name: comtinel-hosts
    rules:
      - alert: HighCPUUsage
        expr: 100 * (1 - avg by (instance) (rate(node_cpu_seconds_total{job="node-exporter",mode="idle"}[5m]))) > 90
        for: 5m
        labels:
          severity: critical
          service: linux-hosts
          env: production
          comtinel: "false" # Change to "true" after the controlled test passes.
        annotations:
          summary: "CPU above 90% on {{ $labels.instance }}"
          description: "Average CPU utilisation has remained above 90% for 5 minutes."
          runbook_url: "https://YOUR_RUNBOOK_HOST/high-cpu"

In Comtinel, add a production rule with source Prometheus, alert name HighCPUUsage, and label matchers service = linux-hosts and env = production. Send it to your production team and policy. annotations.summary supplies the incident title; the runbook link should point to your own instructions. Keep changing measurements in annotations rather than identity labels. Leave comtinel: "false" until the controlled test below passes; then change it to "true" to enroll this production alert.

Send only selected alerts to Comtinel

Store only the secret value in /etc/alertmanager/secrets/comtinel-token, readable by the Alertmanager process. In a container, mount that file into the container; a host-only path is not enough. Do not prefix the file's contents with Bearer.

New dedicated Alertmanager — alertmanager.yml
# New, dedicated Alertmanager only; do not replace an existing config.
route:
  receiver: unselected-alerts
  group_by: ['alertname', 'instance']
  group_wait: 0s # a longer wait delays the first page by exactly that long
  group_interval: 1m
  repeat_interval: 4h
  routes:
    - receiver: comtinel
      matchers:
        - 'comtinel="true"'

receivers:
  # This dedicated example sends no notifications for unselected alerts.
  - name: unselected-alerts
  - name: comtinel
    webhook_configs:
      - url: https://comtinel.com/webhooks/prometheus/YOUR_WORKSPACE_ID
        send_resolved: true
        max_alerts: 200
        timeout: 25s
        http_config:
          authorization:
            type: Bearer
            credentials_file: /etc/alertmanager/secrets/comtinel-token
Preserve your existing notification routes
The example's empty default receiver is only for a new, dedicated setup: unselected alerts are not delivered anywhere. For an existing installation, add the comtinelreceiver and a narrow child route to its current tree. Keep all existing receivers and routes. Review rule order and verify that established destinations still receive their alerts.

The comtinel="true" matcher makes enrollment explicit. Use continue: true only when later sibling routes should also receive a matching alert; it does not automatically send it to the parent's default receiver. Keep send_resolved: true. The 200-alert cap truncates larger groups rather than splitting them: use more specific grouping and investigate truncation before production. Check the official Alertmanager configuration reference for your installed version.

Validate, then reload your monitoring configuration

Run with your installed monitoring tools and actual file paths
promtool check rules /etc/prometheus/rules/comtinel*.yml
promtool check config /etc/prometheus/prometheus.yml
amtool check-config /etc/alertmanager/alertmanager.yml

Correct validation errors before reloading. Use your deployment's normal reload mechanism, or the management endpoints below. Prometheus requires --web.enable-lifecyclefor HTTP reload; both services also support SIGHUP. Keep management access on your trusted network. Inspect reload logs and the loaded configuration afterwards. Prometheus reload and Alertmanager reload are documented separately.

Optional HTTP reload, if enabled in your environment
# Use your authenticated management URLs on your trusted network.
# Prometheus requires --web.enable-lifecycle for this endpoint.
curl --fail --request POST 'http://YOUR_PROMETHEUS_HOST:9090/-/reload'
curl --fail --request POST 'http://YOUR_ALERTMANAGER_HOST:9093/-/reload'

With Prometheus Operator, use PrometheusRule for the alert groups and the selected AlertmanagerConfig or configuration Secret for delivery. Confirm namespace/label selectors include your resources, and the receiver can read its Secret. Helm values and CRD fields depend on your chart and Operator version; do not paste native alertmanager.yml under an assumed Helm key. Follow the Operator alerting guideand your chart's configuration reference.

Prove the complete lifecycle with a controlled alert

A temporary rule avoids creating a real CPU problem. Save the group below in its own comtinel-test.yml file, covered by the comtinel*.yml rule-file pattern above. Validate and reload. Keep the label set unchanged throughout this test.

To observe a repeat without waiting four hours, temporarily use repeat_interval: 2m and group_interval: 1m on a dedicated test Alertmanager or a test-only child route matching all three labels: alertname="ComtinelTestAlert", instance="comtinel-test" and comtinel="true". Place the test route before broader matching sibling routes and send it to the Comtinel receiver. Keep production intervals unchanged, validate the configuration and reload before firing the test.

Temporary rule — deliberately fires without metric dependencies
# /etc/prometheus/rules/comtinel-test.yml — separate temporary file
groups:
  - name: comtinel-connectivity-test
    rules:
      - alert: ComtinelTestAlert
        expr: vector(1)
        for: 1m
        labels:
          severity: critical
          instance: comtinel-test
          job: comtinel-test
          service: comtinel-test
          env: test
          comtinel: "true"
        annotations:
          summary: "Planned Comtinel end-to-end test"
          description: "Temporary alert owned by the integration test team."
  1. 1

    Watch pending become firing in Prometheus

    Find ComtinelTestAlert on the Alerts page. The example waits one minute before firing. Allow for the evaluation interval and Alertmanager's grouping delay; this is not an immediate button response.

  2. 2

    Check Alertmanager and the Comtinel incident

    Confirm Alertmanager has the alert with comtinel="true". In Comtinel Incidents, inspect the source, alert name, labels, selected team and policy. Confirm the expected responder actually receives the notification.

  3. 3

    Accept the incident

    Have the responder accept it and verify the status becomes accepted. Further escalation stops; the alert in Prometheus should still be firing because its condition has not changed.

  4. 4

    Observe one Alertmanager repeat

    Keep the condition firing until Alertmanager sends another notification after the temporary repeat interval. Verify the repeat in its delivery logs, then check Comtinel still shows the same accepted incident with no additional escalation cycle. Do not count an unchanged browser view alone as proof that another webhook arrived.

  5. 5

    Clear the condition without changing its identity

    Change only the test expression to vector(0) == 1, validate and reload. Do not use vector(0) alone: it still produces a vector element and would keep the alert active. Wait for evaluation and the next Alertmanager notification, then confirm the same Comtinel incident is resolved.

  6. 6

    Check a new firing, then clean up

    If you need to verify recurrence, restore vector(1) after resolution. Confirm a new incident appears for the new firing episode. Clear it again, confirm resolution, then remove the temporary rule and the test-only Comtinel routing rule. Remove the temporary Alertmanager route or restore its production repeat interval, then validate and reload.

With these intervals, expect minutes for the round trip rather than a fixed few-second deadline. Silence, inhibition and pending time can delay or suppress delivery. The alerting-rule referenceexplains expression results and pending/firing behavior.

Understand what each test proves

Panel: Send test alert → Resolve test
Exercises Comtinel's alert processing and your configured response path. The panel retains the synthetic episode for Resolve test. It does not contact your Prometheus or Alertmanager, or prove the public webhook secret and network path.
curl: public webhook delivery
Checks the public URL, workspace secret and request format from the machine running curl. Use the example payload on your integration page, a unique fingerprint, and a current RFC3339 startsAt such as the format YYYY-MM-DDTHH:mm:ssZ. A successful queue response is still not proof of responder delivery.
Temporary Prometheus rule: the full path
Checks rule loading, evaluation, Alertmanager routing, public delivery, Comtinel routing and notification. This is the test to complete before enrolling production alerts.
Optional curl diagnostic — protect the real secret and shell history
# Save the example Alertmanager JSON from your integration page
# as alertmanager-test.json, with a fresh startsAt and fingerprint.
curl --include --request POST \
  'https://comtinel.com/webhooks/prometheus/YOUR_WORKSPACE_ID' \
  --header 'Authorization: Bearer YOUR_SECRET' \
  --header 'Content-Type: application/json' \
  --data-binary @alertmanager-test.json

To resolve a curl-created incident, send the same alert with status: "resolved"while preserving its fingerprint and startsAt. The panel's Resolve testbutton only addresses its own synthetic test. Remove the diagnostic payload after use.

Repeats, resolution and secret rotation

An Alertmanager group can contain multiple independent problems; each accepted alert can create its own incident. Repeated notifications with the same fingerprint and startsAt do not create another incident. A resolved alert that fires again has a new start time and can page again. Acknowledgement does not change the metric or silence Alertmanager. Use upstream silences for planned maintenance, and clear the underlying condition to complete the source lifecycle.

Coordinate secret rotation with your monitoring owner: rotate in Comtinel, update the mounted secret file and reload Alertmanager, then check delivery. Configuration is cached briefly, so old and new credentials may behave differently across requests for up to about 60 seconds. Do not assume the old token stops everywhere at the exact click time. Keep secrets out of repositories, screenshots and support attachments.

If the alert does not arrive or resolve

401 — unauthorized
Check the exact workspace URL and that the token is its Prometheus secret. Confirm the mounted file contains only the token. Unknown workspaces, missing secrets and incorrect tokens all produce 401. Allow about 60 seconds after changes.
403 — forbidden or integration disabled
Enable and save the integration. Use the public URL copied from Comtinel. If it remains forbidden, ask Comtinel support to check workspace activation/network permissions; provide time, workspace ID and a redacted error.
400 or 413 — rejected payload
Use the standard Alertmanager webhook format and valid startsAt values. Check the returned schema issues. Reduce oversized label/annotation content and groups; the endpoint limits requests to 200 alerts and a 1 MiB body.
202 with ignored or duplicates
Read the response body. severity_not_allowed means the firing severity was filtered. Duplicates refer to an already delivered episode. Neither response means a new incident or notification was created. The panel helper reports a filtered test as 422 no_events.
Incident exists but is unrouted
Check active source-Prometheus rules, exact severity, alert name and every label matcher. Use the routing simulator with the incident's actual labels. Correcting a rule affects subsequent alerts; verify with a fresh controlled test.
Incident is routed but no responder was notified
Inspect the incident timeline, policy targets, schedule coverage and responder contact methods. Check delivery results rather than treating a queued test as success. FYI watchers need their own Prometheus rule.
The source clears but Comtinel stays open
Confirm send_resolved: true, the receiver's delivery logs, and that the resolved payload retains the original identity. Check silences, inhibition and any keep-firing setting upstream. Wait for the group interval.
Missing alerts in a large group
Investigate truncatedAlerts. The 200-alert cap omits excess alerts; it does not queue a second batch. Narrow grouping. Grouping by all labels using group_by: ['...'] sends distinct alerts separately but increases request volume.
429 — request rate exceeded
Reduce bursts and inspect Alertmanager's delivery errors. Do not assume an automatic retry: the Alertmanager 0.34 generic webhook uses the default retry policy, which retries 5xx responses but not 429. Confirm your version's behavior and retest delivery after the rate limit clears; involve Comtinel support if throttling persists.
503 — delivery temporarily unavailable
Let Alertmanager retry and inspect its delivery logs. A 503 may follow partial delivery; retry the same payload and identity rather than inventing new fingerprints. Escalate persistent failures to Comtinel support.

Prometheus integration FAQ

Do I need Jira or Grafana for this integration?

No. Prometheus evaluates your alert rules, Alertmanager forwards selected alerts, and Comtinel handles ownership and paging. Jira can remain connected independently. Grafana dashboards are optional; Grafana-managed alert rules and contact points are a separate integration path.

Can Jira and Prometheus notify different teams in one workspace?

Yes. Create separate routing rules with the correct source, team and escalation policy. For example, Jira support issues can reach Support while Prometheus infrastructure alerts reach Platform. A Jira rule never matches a Prometheus alert.

Does acknowledgement make the Prometheus alert healthy?

No. Accepting the Comtinel incident records ownership and stops further escalation. The underlying alert remains firing until its Prometheus expression clears. Alertmanager then sends the resolved notification that closes the incident.

Why did a repeat notification not create another incident?

The same fingerprint and firing start time identify one alert episode. Repeats are deduplicated. A later firing after resolution has a new start time and can create a new incident. Changing labels can change the alert identity, so keep them stable during a lifecycle test.

Enroll production alerts gradually
Keep Jira operating, retain your existing monitoring destinations, and add the opt-in label only to reviewed alert rules. Finish the going-live checklistafter verifying both the intended notification and automatic resolution.