Metric Alerts

Sentry integrations which have been made available as alert rule actions can receive metric alert webhooks.

The gif below shows how to set up an internal integration that can receive Sentry alerts.

'Sentry-Hook-Resource': 'metric_alert'

  • type: string
  • description: will be one of (critical, warning, resolved)

  • type: object
  • description: the incident that triggered the alert rule

  • type: object
  • description: the alert rule

  • type: array of objects
  • description: the thresholds to trigger the alert

  • type: array of objects
  • description: the actions that will be performed when a trigger's threshold has been met

  • type: string
  • description: a human-readable description of the alert

  • type: string
  • description: a human-readable title for the alert

  • type: string
  • description: the api url for the incident

  • type: object
  • description: the saved configuration for routing the alert within the external service

Copied
{
  "action": "resolved",
  "actor": {
    "id": "sentry",
    "name": "Sentry",
    "type": "application"
  },
  "data": {
    "description_text": "1000 events in the last 10 minutes\\nFilter: level:error",
    "description_title": "Resolved: Too many errors",
    "metric_alert": {
      "alert_rule": {
        "aggregate": "count()",
        "created_by": null,
        "dataset": "events",
        "date_created": "2020-09-13T12:26:40.000000Z",
        "date_modified": "2020-09-13T12:26:40.000000Z",
        "environment": null,
        "id": "7",
        "include_all_projects": false,
        "name": "Too many errors",
        "organization_id": "5",
        "projects": ["bar"],
        "query": "level:error",
        "resolution": 1,
        "resolve_threshold": null,
        "status": 0,
        "threshold_period": 1,
        "threshold_type": 0,
        "time_window": 10,
        "triggers": []
      },
      "date_closed": null,
      "date_created": "2020-09-13T12:26:40.000000Z",
      "date_detected": "2020-09-13T12:26:40.000000Z",
      "date_started": "2020-09-13T12:26:40.000000Z",
      "id": "4",
      "identifier": "1",
      "organization_id": "5",
      "projects": ["bar"],
      "status": 2,
      "status_method": 3,
      "title": "Sacred Marmot",
      "type": 2
    },
    "web_url": "https://sentry.io/organizations/baz/alerts/1/"
  },
  "installation": {
    "uuid": "a8e5d37a-696c-4c54-adb5-b3f28d64c7de"
  }
}
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").