Grafana Alerts
The built-in Grafana Alerts trigger initiates a flow when it receives a signal from a Grafana Contact Point webhook.
Add the Grafana Alerts trigger to the canvas
- Go to the Triggers panel in the palette, expand the App Triggers section and drag the trigger onto the canvas.
- Double-click the trigger (or click the pencil icon).
- Set the authenticating user, and then copy the URL — you'll use this to set up the webhook in Grafana. Alternatively, you can create an integration user to use as the authenticating user.
- Click the Flood Control tab to edit the trigger's default flood control settings. For more information about these settings, see Trigger Flood Control.
- Click Done.
- On the flow canvas, connect the steps you want to run when xMatters receives a request to that URL.
You're now ready to configure Grafana to target the trigger.
Configure Grafana to send requests to the trigger URL
To have Grafana send alerts to the flow trigger, you need to configure a Contact Point webhook and set it to use the trigger URL.
- In Grafana, go to Alerting and select the Contact Point tab.
- In the Contact points section of the page, click New contact point.
- On the Create contact point screen, fill in the following fields:
- Name: xMatters
- Contact point type: Select Webhook from the drop-down menu of options.
- URL: Paste the trigger URL you copied from Flow Designer.
- Add the target names of any recipients you want to notify when the alert fires.
- For URL authentication, use an ampersand to attach recipients. For example, if you want to notify Emma Pearson and the on-call members in the group responsible for the Antares service, you'd add &recipients=epearson,antares to the end of the URL.
- For other authentication types, use a question mark to attach recipients. For example, if you want to notify Barry Gull and the on-call members in the group responsible for the Cassiopeia service, you'd add ?recipients=bgull,cassiopeia to the end of the URL.
- You must URL-encode any special characters or spaces in the target names.
- Optional: If you choose to use Basic Authentication, expand the Optional Webhook settings menu to enter your Username and Password.
- Click Save contact point.
- Add this notification channel to any alert rules you'd like to connect with xMatters.
You're ready to use the webhook to trigger automated flows, including steps such as sending alerts and initiating incidents, though we always recommend testing before putting things into use.
Outputs
The trigger has the following outputs you can use as inputs to steps further along the flow.
Label |
Description |
---|---|
Recipients |
List of targeted recipients. Recipients are set by adding a recipients query parameter to the trigger URL. |
Signal Mode | Determines the path the flow will take, based on the value of the Status parameter. |
Signal ID | Key or identifier used to terminate or correlate signals. |
Account | URL of the Grafana instance that sent the webhook. |
Alert ID | Unique ID of the alert. |
Alert Name | Name of the alert as provided by Grafana. |
Alert URL | Direct link to the to the Grafana alert. |
Description | Description of the alert. |
Summary | Summary of the alert. |
Raw Request | JSON representation of the request. You can parse the raw request if you need additional details beyond the standard outputs. |
Previous version
The previous version of Grafana Alerts are now known as Grafana Legacy Alerts.
The Grafana Legacy Alerts trigger initiates a flow when it receives a signal from a Grafana Legacy webhook.
Add the Grafana Legacy Alerts trigger to the canvas
- Go to the Triggers panel in the palette, expand the App Triggers section and drag the trigger onto the canvas.
- Double-click the trigger (or click the pencil icon).
- Set the authenticating user, and then copy the URL — you'll use this to set up the webhook in Grafana. Alternatively, you can create an integration user to use as the authenticating user.
- Click the Flood Control tab to edit the trigger's default flood control settings. For more information about these settings, see Trigger Flood Control.
- Click Done.
- On the flow canvas, connect the steps you want to run when xMatters receives a request to that URL.
You're now ready to configure Grafana to target the trigger.
Configure Grafana to send requests to the trigger URL
To have Grafana send alerts to the flow trigger, you need to configure a webhook and set it to use the trigger URL.
- In Grafana, go to Alerting > Notification channels.
- Create a new Notification channel and fill in the following fields:
- Name: xMatters
- Type: Webhook
- Url: Paste the trigger URL you copied previously.
- Add the target names of any recipients you want to notify when the alert fires.
- For URL authentication, use an ampersand to attach recipients. For example, if you want to notify Emma Pearson and the on-call members in the group responsible for the Antares service, you'd add &recipients=epearson,antares to the end of the URL.
- For other authentication types, use a question mark to attach recipients. For example, if you want to notify Barry Gull and the on-call members in the group responsible for the Cassiopeia service, you'd add ?recipients=bgull,cassiopeia to the end of the URL.
- You must URL-encode any special characters or spaces in the target names.
- Optional: If you choose to use Basic Authentication, expand the Optional Webhook settings menu to enter your Username and Password.
- Click Save.
- Add this notification channel to any alert rules you'd like to connect with xMatters.
You're ready to use the webhook to trigger automated flows, including steps such as sending alerts and initiating incidents, though we always recommend testing before putting things into use.
Outputs
The trigger has the following outputs you can use as inputs to steps further along the flow.
Label |
Description |
---|---|
Recipients |
List of targeted recipients. Recipients are set by adding a recipients query parameter to the trigger URL. |
Signal Mode | Determines the path the flow will take, based on the value of the State parameter. |
Signal ID | Key or identifier used to terminate or correlate signals. |
Image URL | Direct link to a graph of recent metrics. |
Message | Message associated with the Grafana rule. |
Rule ID | ID associated with the Grafana rule. |
Rule Name | Name of the rule that triggered the notification. |
Rule URL | Direct link to the rule in Grafana. |
State | State of the rule in Grafana. |
Title | Title of the notification as provided by Grafana. |
Raw Request | JSON representation of the request. You can parse the raw request if you need additional details beyond the standard outputs. |