Enable webhooks to get notified about certain events when using the Lighthouse Metrics API.
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.
{ "check": { "id": "0be76dba-2bbe-4a8b-9134-7451a265adee" }, "runs": [ { "id": "41f1089d-454a-4a84-890d-db5986d7e911", "state": "succeeded", "region": "us-east4" } ] }
{ "monitor": { "id": "2834eaf0-8a8e-4212-9837-240af24d1d97" }, "run": { "id": "41f1089d-454a-4a84-890d-db5986d7e911", "state": "succeeded", "region": "us-east4" } }
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.
If your webhook endpoint is not responding within 30 seconds, the request will be retried up to 3 times with an exponential backoff.