Webhooks

Enable webhooks to get notified about certain events when using the Lighthouse Metrics API.

Events

Each event will be sent as a POST request that has a x-lighthouse-metrics-event header property which contains the event name and a x-lighthouse-metrics-event-id property that contains a unique identifier for the event.

Both properties can be also found on each event that is listed under Webhook Delieveries on the dashboard.

lighthouse.check.completed

This event occurs after a check is done, with the state being either succeeded or failed.
Payload
{
  "check": {
    "id": "0be76dba-2bbe-4a8b-9134-7451a265adee"
  },
  "runs": [
    {
      "id": "41f1089d-454a-4a84-890d-db5986d7e911",
      "state": "succeeded",
      "region": "us-east4"
    }
  ]
}

lighthouse.monitor.run.completed

This event occurs after a monitor run is completed, with the state being either succeeded or failed.
Payload
{
  "monitor": {
    "id": "2834eaf0-8a8e-4212-9837-240af24d1d97"
  },
  "run": {
    "id": "41f1089d-454a-4a84-890d-db5986d7e911",
    "state": "succeeded",
    "region": "us-east4"
  }
}

HTTP Response

Each HTTP request can be treated as a single event that ideally triggers some action at your end.

Make sure to use some type of job queue to process the events. Each attempt has a timout of 30 seconds. If your configured webhook endpoint is not responding within 30 seconds with a HTTP status code of 2XX, the request will be aborted.

Delivery Attempts and Retries

If your webhook endpoint is not responding within 30 seconds, the request will be retried up to 3 times with an exponential backoff.