Alarms

Create an alarm

Creates a new alarm for the project.

post/projects/{project_id}/alarms

Request

Path parameters

project_idstring required
Example:Xk9mZp

Project ID

Request body

namestring required

Alarm name

descriptionstring nullable

What the alarm watches for, shown with it in Honeybadger. Null clears it.

querystring required

BadgerQL evaluated on each check

stream_idsstring[] nullable

Streams the query runs against. A set: order is ignored, duplicates are dropped, and it can't be empty. Left out or null, set to the project's current streams.

evaluation_periodstring required

Window each evaluation covers. At least 1m and less than a week (w units are refused).

lookback_lagstring required

How far behind now the window ends, allowing for ingestion delay

Example request

{
  "name": "Error spike",
  "query": "filter event_type::str == \"notice\" | stats count() as count",
  "evaluation_period": "10m",
  "lookback_lag": "1m",
  "trigger_config": {
    "type": "alert_result_count",
    "config": {
      "operator": "gt",
      "value": 10
    }
  }
}

Response

Alarm created

Example response

{
  "data": {
    "id": "Qx7LmP2vRt9K",
    "project_id": "Xk9mZp",
    "name": "High Error Rate",
    "description": "Fires when checkout errors spike",
    "query": "filter event_type::str == \"notice\" | stats count() as count",
    "evaluation_period": "10m",
    "lookback_lag": "1m",
    "trigger_config": {
      "type": "alert_result_count",
      "config": {
        "operator": "gt",
        "value": 10
      }
    },
    "links": {
      "web": "https://app.honeybadger.io/projects/Xk9mZp"
    }
  },
  "meta": {
    "request_id": "6f1c2b0e-8d4a-4f6e-9b2a-3c5d7e9f1a2b"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.