Sentry Metric Alerts
The built-in Sentry trigger initiates flows when it receives a request from a webhook in Sentry.
- Go to the Triggers tab 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 Sentry. 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 Sentry to target the trigger.
Configure Sentry to send requests to the trigger URL
To have Sentry send alerts to the flow trigger, you need to add a Metric Alert Rule to Sentry that targets the trigger URL.
A paid Sentry account is required to complete these steps.
- In Sentry, go to Settings > Developer Settings.
- Click New Internal Integration.
- Complete the following fields:
- Name: Webhook
- Webhook URL: Paste the xMatters trigger URL you copied previously. Add the target names of any recipients you want xMatters to notify when the alert fires.
- For example, if you want to notify Emma Pearson, Mary McBride, and the on-call members in the Monitor Team responsible for the service, you'd add ?recipients=epearson,mmcbride,monitor%20team to the URL.
- You must URL-encode any special characters or spaces in the target names.
- Alert Rule Action: On
- Click Save.
Next, you'll need to create an alert on an existing project.
- Select the project you want to create an alert on.
- Click Create Alert.
- Select Metric Alert.
- If required, adjust the query.
- Click Add Action and select the following from the drop-down menus:
- Critical Status: xMatters (Internal)
- Warning Status:xMatters (Internal)
- Click Save.
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.
The trigger has the following outputs you can use as inputs to steps further along the flow.
|Recipients||List of targeted recipients. Recipients are set by adding a recipients query parameter to the trigger URL.|
|Signal Mode||Determines the flow path to follow, based on the value of the Action parameter.|
|Signal ID||Key or identifier used to terminate or correlate events/signals.|
The threshold of the metric alert. Available values are:
|Alert ID||Unique ID of the Sentry metric alert.|
|Date Created||Date and time the Sentry metric alert rule was triggered.|
|Description Text||Description of the metric alert as provided by Sentry.|
|Description Title||Title of the metric alert as provided by Sentry.|
|Web URL||Direct link to the Sentry metric alert.|
|Raw Request||JSON representation of the request that can be parsed separately to get additional context on outputs.|