Adding webhooks (with examples)

Adding webhooks to your webrender configuration is really easy. We have a preset webhook request that we will send as a POST request.

Here is what an example configuration for honeycomb looks like using their events API (https://docs.honeycomb.io/api/events/#url)

  "origin": "https://example.com",
  "cacheTtl": "auto",
  "webhookSettings": [
    {
      "headers": [
        "X-Honeycomb-Team:YOUR_KEY"
      ],
      "url": "https://api.honeycomb.io/1/events/YOUR_DATASET"
    }
  ],
  "renderSettings": [
    {
      "path": "/*",
      "unfurlDelay": 1500,
      "preRenderDelay": 4000
    }
  ]
}

You can add as many array items as you wish, and the webrender request will execute all of them in order.

The following fields are added by default:

isMiss : whether this request was cached or not
isStaticRequest : whether this was a request for a static resource or a dynamic resource (eg react page vs .jpg file)
processMs : how long the respond took to process
requestCountry : the origin country of the request, as reported by Cloudflare
requestHostname : the hostname the request came in at
requestPlatform : the platform we identified the request as
requestUrl : the URL the request was served at
requestUserAgent : the user agent of the request (for example, in case you see a lot of misses, this will help identify who you are not serving with your cache)

This will allow you to export data into your own systems very easily.