Skip to content
Chapter 06Grafana integration

Your first Grafana alert, from setup to recovery

Prepare your on-call team, connect Grafana, and create a practice alert that fires and recovers on its own. No existing monitoring data is needed.

18 min read

Follow these steps in order for your first connection. Already have the response team, Grafana routing rule, enabled integration, endpoint and secret ready? Start at the contact point. Already have a working connection? Jump to your real service alerts.

Before you start

  • A Comtinel workspace and an admin account. New here? Complete Getting started first.
  • A running Grafana environment with permission to manage data sources, alert rules and contact points. Use self-hosted Grafana or Grafana Cloud. If you have neither, Grafana's starting guide explains the options, including a free Cloud account.
  • One available test responder who can receive the selected phone, SMS or email notifications. Tell them this is a practice alert.
  • Confirm external webhook activation for your workspace with Comtinel support. Grafana must be able to reach the HTTPS endpoint shown in Comtinel.

The practice configuration was exercised with Grafana OSS 13.2.2. Menu names vary: Alerting may be under Alerts & IRM. Cloud uses the same standard webhook format; test your own environment before relying on it.

Data source
Where Grafana gets the numbers to check. TestData generates artificial numbers without changing a real service.
Alert rule
The condition Grafana evaluates. Firing means the condition is true; Normal means it has recovered.
Contact point
Where Grafana sends the notification. Here, a Webhook contact point sends it to Comtinel.
Incident and ACK
Comtinel routes the alert to responders. Accept incident acknowledges ownership (ACK) and stops escalation. Recovery is a separate step.

Understand the notification path

Grafana rule → Webhook contact point → Comtinel routing rule → on-call responder. Grafana decides when the condition is firing or normal. Comtinel decides who responds and how to notify them.

Use Grafana integration when a Grafana-managed rule sends the notification, even if it queries Prometheus. When Prometheus Alertmanager sends it, use Prometheus integration. Viewing a Prometheus rule in Grafana does not change its delivery path.

One delivery path per alert
Sending the same alert through both integrations can create two incidents. Different alert sets can use the two sources independently in one workspace.

1. Prepare Comtinel

Use a small test team first. You can enter the example names below as written.

  1. 1

    Prepare the responder's contact methods

    Check Plan → Users: the responder must be active and approved. Have them open the user menu → My profile → Notification channels, add their phone number if needed, enable SMS enabled, Voice call enabled and/or Email notifications enabled, then Save changes. See Notifications & responding.

  2. 2

    Create the team and add members

    Open Plan → Teams. Under Create team, enter Team name grafana-test-team and click Create. Open the team, select the responder under Members, and Save changes. New teams start without members. See Teams.

  3. 3

    Create a schedule covering the test time

    Open Plan → Schedules → Create schedule. Enter Schedule name grafana-test-schedule, choose the test team, rotation, timezone, handoff time and a start date that includes the test time. Select the responder under Participants, review the preview and click Create schedule. Confirm someone is on call now. See On-call schedules for each field.

  4. 4

    Create and configure the escalation policy

    Open Route → Escalation policies. Enter Policy name grafana-test-policy, select the test team as Initial owning team and click Create. Open the new policy to configure its first step.

    Under Targets, change the existing target type from Team to Schedule and choose grafana-test-schedule. Under Notify channels, select the SMS, Voice call and/or Email channels to test. Click Save changes.

New policies start with Panel only
Choose actual delivery channels in the policy and enable those channels in the responder's profile before expecting a call, SMS or email. A Schedule target selects its primary on-call responder; a Team target selects eligible team members. Creating a schedule alone does not connect it to a policy.

Create the routing rule

Open Route → Routing rules. In the Create rule section, fill these fields, then click Create rule:

Rule namegrafana-test-routing
Intake sourceGrafana
Alert nameComtinelGrafanaTestAlert
Severity labelLeave blank
Add label matcherLabel name: instance | Operator: = | Value: comtinel-test
Teamgrafana-test-team
Escalation policygrafana-test-policy

Names and labels must match exactly, including capitalization. Check the routing simulator with source Grafana and these values. Review existing rules, workflows and watchers so the test reaches only the intended responders. See Routing & escalation.

Enable the integration and copy its credential

  1. 1

    Save the connection settings

    Open System → Grafana integration. Check Integration enabled. For a new workspace, leave all optional Severity filter values unchecked, then Save settings. This accepts our example without a severity label.

  2. 2

    Copy the endpoint and secret

    Copy Webhook endpoint URL. For a new connection, click Generate secret and copy the value while it is shown. Keep it securely available for the next step; it is shown once. Use this Grafana secret, not a Jira/Prometheus secret or Grafana API token.

Already have filters or a secret?
Keep an existing severity filter: add an allowed severity value to the rule and custom test below, and use that value for any panel test. If a secret is already configured, use your securely stored value. If lost, rotate it and update the connected Grafana contact point; allow up to 60 seconds for the change, then retest.

2. Create the Grafana contact point

In Grafana, open Alerting → Contact points (possibly under Alerts & IRM). If prompted, select the Grafana Alertmanager. Click Add contact point or New contact point.

Namecomtinel-test
IntegrationWebhook
URLPaste the complete Webhook endpoint URL from Comtinel
HTTP MethodPOST
Authentication Header SchemeBearer
Authentication Header CredentialsOnly your Comtinel Grafana secret, without a Bearer prefix
Max Alerts0
Disable resolved messageOff / unchecked

Expand Optional Webhook settings to find additional fields if needed. Leave Basic Authentication empty. Keep the default JSON payload and Custom Payload unset. The standard webhook uses application/json; no extra content-type header is needed.

The URL resembles https://comtinel.com/webhooks/grafana/YOUR_WORKSPACE_ID. Use the exact workspace URL, including https://. Keep the secret in the credentials field, not in the URL. Click Save contact point.

Keep recovery messages enabled
With Disable resolved message off, Grafana can close the corresponding Comtinel incident when the rule recovers. Saving a contact point does not yet connect it to any rule.

Reference: Grafana webhook settings.

3. Send one connection test

  1. 1

    Open a custom test

    Open comtinel-test for editing and click Test. Choose Custom. The predefined test may use TestAlert, which does not match our routing rule.

  2. 2

    Set labels and summary

    In Labels, replace any existing alertname value with ComtinelGrafanaTestAlert. Add label name instance with value comtinel-test. Do not create a second alertname entry. Omit severity for the default example, or add an allowed severity value if your workspace filters it.

    In Annotations, set summary to Grafana connection test. Click Send test notification once.

  3. 3

    Verify delivery and close this test

    Grafana should report success. In Comtinel Incidents, open Grafana connection test. Check source Grafana, team and policy, and confirm the selected notifications arrived on the responder's device. Click Accept incident, then Mark resolved to close this synthetic test.

The Test button does not send a later recovery
Each click can create a new synthetic incident. Close this one manually. Use the real rule below to test automatic closure; a successful Grafana test alone does not prove the full lifecycle.

Choose which rules notify Comtinel

For practice, select comtinel-test directly in the rule's notification settings. Grafana also supports notification policies that match labels and select contact points for several rules. The production section explains that option. You do not need to change the default notification policy for this walkthrough.

4. Create a real practice alert

This signal is 1 for four minutes, then 0 for two minutes, repeating. We alert when its latest value exceeds 0.5, so you can test recovery without editing a rule or affecting a service.

  1. 1

    Add TestData

    In Grafana open Connections → Add new connection, search for TestData, then Add new data source. Some versions start at Connections → Data sources → Add new data source. Name it comtinel-testdata, leave it separate from your default data source, and click Save & test. Confirm it is working. No external URL or credentials are needed.

  2. 2

    Create the rule

    Open Alerting → Alert rules → New alert rule. Choose Grafana-managed if asked. Name it exactly ComtinelGrafanaTestAlert. Under Define query and alert condition, select comtinel-testdata for query A. Switch to advanced query/expression mode if the editor initially shows a simplified condition.

Query A: Predictable Pulse

Choose Predictable Pulse in the Scenario selector. Set these values and leave other TestData settings at their defaults:

Query time rangeFrom: now-10m | To: now (10 minutes to now)
Step10 seconds
On Count / Off Count24 / 12
On Value / Off Value1 / 0
Series count1

Expressions B and C: latest value and threshold

  1. 1

    B: Reduce

    Add an expression of type Reduce, or edit the existing one. Set Input A, Function Last, Mode Strict. Keep its reference as B. This reads the latest sample instead of averaging the previous ten minutes.

  2. 2

    C: Threshold

    Add or edit a Threshold expression with Input B, condition Is above, value 0.5. Choose Set as alert condition on C if needed. Preview: B and C can be 1 or 0 depending on the pulse phase. Reuse default B/C expressions where present and remove unused extras.

Folder, labels and evaluation

Create or select folder Comtinel practice. In Labels, enter each name and value separately and confirm the custom value in the editor:

Label name: instancecomtinel-test
Label name: test_kindmanaged-rule

Grafana supplies alertname from the rule name. Do not add it again. Omit severity for the default example, or add an allowed value if your saved Comtinel filter requires it.

Evaluation groupCreate new: comtinel-practice
Evaluation interval10s
Pending period0s / None
Keep firing for0s / None

If 10 seconds is not allowed, use your environment's permitted interval, ideally one minute or less for this practice signal, and allow for that delay. Keep No data and Error handling at their defaults for this example.

Contact point and delivery timings

Under Configure notifications, select direct contact-point delivery and choose comtinel-test. Enable Override general timings if shown and enter:

Group wait10s
Group interval30s
Repeat interval1m

Keep the default grouping for this single-instance test. These short timings are for practice only. A long group interval can skip over this signal's two-minute Normal phase, so set the test timings before saving the rule.

If direct-rule timing overrides are unavailable, create a dedicated child notification policy matching test_kind=managed-rule and instance=comtinel-test. Select comtinel-test, override its timings with the three values above, and configure this rule to use notification policies. Keep the global default policy unchanged.

SummaryGrafana practice alert
DescriptionPractice firing, ACK and automatic recovery. Pause this rule after the test.

Review the name, labels and contact point, then click Save rule and exit. Open Instances or History on the saved rule to watch its state.

The practice rule repeats until you pause it
The pulse follows the clock, not the time you saved the rule. You may start halfway through Firing or Normal; a complete signal cycle lasts six minutes. Evaluation and delivery add some delay. After the second recovery reaches Comtinel, choose More → Pause evaluation and confirm Paused.

References: TestData alert testing and Grafana-managed rules.

5. Check two cycles and clean up

Optional Comtinel panel test
On Grafana integration → Test routing and recovery, Send test alert checks Comtinel routing and notifications. Use Resolve test there for that same test. Choose an allowed Test severity if filtered. This bypasses Grafana connectivity and webhook authentication.
Grafana contact point Test
The connection test checks the sender, URL and credential. Close its synthetic incident manually with Mark resolved.
Real Grafana practice rule
The Predictable Pulse rule checks evaluation, repeats and automatic recovery. Do not manually resolve its incidents during the recovery test.
  1. 1

    Firing: confirm the incident and notification

    Wait for Grafana to show Firing (or Alerting for an instance). After the delivery delay, open Grafana practice alert in Comtinel. Check source Grafana, test team, policy, labels and rule link. Confirm the selected notifications arrived on the responder's device.

  2. 2

    Accept and observe repeats

    Click Accept incident, or acknowledge through the phone prompt. During this firing period, repeated Grafana notifications should retain one incident without restarting calls after ACK. If the first period was almost over when you started, observe repeats in the next full period.

  3. 3

    Normal: verify automatic closure

    When the signal drops to 0, Grafana should show Normal. Wait for its resolved notification and confirm the same Comtinel incident becomes Resolved without Mark resolved. The signal stays normal for two minutes before the next firing period.

  4. 4

    Refire: verify a new incident

    Keep the rule name and labels unchanged. The next firing period should create a new incident and notifications. Accept this one too, then wait for its automatic recovery.

  5. 5

    Pause after the second recovery

    After the second Comtinel incident automatically resolves, open the Grafana rule → More → Pause evaluation. Confirm Paused. Keep the paused rule for reference or remove it later. Close remaining synthetic tests and remove any test-only policies you added. Do not disable ingestion while waiting for recovery.

The test passes when both cycles reach the intended responder, ACK stops escalation, repeats stay in the same incident and recovery closes it. Record the Grafana version or Cloud stack, date and incident references. Verify each independent environment separately.

6. Connect your real service alerts

  1. 1

    Choose a service rule

    In Grafana Alert rules, open a Grafana-managed service rule and click Edit, or create one. Use the service's real data source and agreed threshold instead of TestData. Choose suitable evaluation, pending and recovery settings, a clear summary and description, and optionally a runbook_url annotation.

  2. 2

    Create the matching Comtinel route

    In Routing rules, use source Grafana and the actual alert name and labels, such as service=checkout and env=production. Select the owning team and policy and check the simulator. Our example route only matches ComtinelGrafanaTestAlert; it does not automatically catch other service alerts.

  3. 3

    Attach the contact point

    Select the Comtinel contact point in the service rule's notification settings and save. Rename comtinel-test to an ongoing name or create a dedicated service contact point with the same workspace connection settings. Replace the short practice timing overrides with your team's intended timings.

  4. 4

    Verify a controlled service alert

    Use a safe test condition agreed with the service owner. Confirm routing and delivery, acknowledge, restore the condition and check automatic recovery. Keep the TestData practice rule paused.

Alternative: a narrow Grafana notification policy

For centrally managed delivery, open Alerting → Notification policies. Add a child policy under the intended parent, match labels such as comtinel = true and env = production, select the Comtinel contact point and save. Add those labels to the intended rules and select notification-policy delivery instead of direct contact-point selection. Verify the matching route and review sibling/continuation settings to avoid duplicate deliveries.

The Grafana policy selects the destination; Comtinel routing selects the responders. Keep the default Grafana destination and unrelated routes intact.

Review severity, missing data and grouping
Agree severity labels before restricting them. DatasourceNoData and DatasourceError can be independent alerts; decide explicitly who receives them. The narrow practice alert-name route does not match their different names; an unrestricted catch-all may page them. Grafana watchers require a matching source and severity. Keep notification groups below 200 alerts and 1 MiB using narrower grouping. Max Alerts truncates excess alerts instead of splitting them into later deliveries.

Troubleshooting

401 or 403
Check the complete workspace URL, Bearer scheme, Grafana secret and saved Integration enabled setting. After rotation, update Grafana and allow up to 60 seconds. For activation/access rejection, contact Comtinel support with the error and time, not the secret.
Test succeeded, but no incident
Check whether TestAlert was sent instead of the custom name, and compare the saved severity filter with the labels. Look for an unrouted incident and check the Grafana routing rule. HTTP acceptance alone does not prove delivery to a responder.
Incident exists, but the phone does not ring
Check the policy is not Panel only, its target is the intended Schedule, and someone is on call now. Check the responder is active and approved, with a phone number and channel opt-ins saved in My profile. Review notification results on the incident.
Practice rule starts Normal
The clock-aligned pulse may start in its normal phase. Check Predictable Pulse values, Step=10 seconds, Reduce=Last and Threshold > 0.5. Confirm evaluation is not paused and account for evaluation, pending and delivery delays.
Incident does not close
The contact point Test requires manual closure. For the real rule, check Grafana is Normal and Disable resolved message is off. Allow for grouping delays, keep ingestion enabled, and do not change the rule name or identity labels during the test.
More incidents or calls than expected
Each new practice cycle intentionally creates a new incident. Check for repeated Test clicks, duplicate Grafana/Prometheus paths, or other matching notification policies, workflows or watchers. Pause the practice rule after recovery.
Do I need Prometheus for this walkthrough?

No. Grafana's built-in TestData source generates the practice signal. You need a working Grafana environment and a Comtinel workspace. Use your own monitoring data source for real service alerts.

My Grafana rule queries Prometheus. Which integration should I use?

Use Grafana integration when a Grafana-managed rule sends through a Grafana contact point. Use Prometheus integration when Prometheus Alertmanager sends the webhook. Choose one delivery path per alert to avoid separate incidents.

Do I need a Grafana API token in Comtinel?

No. Grafana sends notifications using the Grafana webhook secret from your Comtinel workspace. Comtinel does not log into Grafana or create its rules.

Does Accept stop the Grafana rule?

No. Accept acknowledges ownership and stops Comtinel escalation. Grafana keeps evaluating. Its resolved notification closes the incident. Pause the practice rule after recovery to stop future test cycles.

Why is the contact point Test incident still open?

The Test button sends a synthetic notification without a later recovery. Accept it, then use Mark resolved in Comtinel. Check automatic recovery separately with the real practice rule.

Can several Grafana instances share one workspace?

Connect one logical Grafana instance and organization per workspace. Use separate workspaces for independent Grafana senders. Jira and Prometheus can coexist with Grafana using their own secrets and routing rules.