New to Kestra?
Use blueprints to kickstart your first workflows.
Alert on Fastly edge error spikes with Kestra. The stats trigger fires when errors cross a threshold in a 5 minute window and pages Discord.
When the edge starts serving errors, users see it before your origin dashboards do, because the CDN sits in front of everything the origin monitoring watches. This blueprint puts the pager at the edge itself: io.kestra.plugin.fastly.stats.StatsTrigger polls the service's stats and fires an execution the moment the errors field crosses a threshold over a rolling five minute window. The flow logs the measured value and pages Discord with the number, the field, and the threshold, edge-side error detection without deploying a monitoring stack next to the CDN.
on_error_spike (io.kestra.plugin.fastly.stats.StatsTrigger) polls every minute (interval: PT1M) and evaluates the errors field over a PT5M window against a threshold of 100. It ships disabled: true; set your service ID and enable it to arm the pager.value, the field it watched, and the threshold it compared against.log_breach (io.kestra.plugin.core.log.Log) writes those three values into the execution history, making spikes queryable after the fact.page_team (io.kestra.plugin.discord.DiscordIncomingWebhook) posts the same numbers to the on-call channel, so the responder starts from the measurement.errors block raises a distinct Discord alert if the flow itself fails, because a silent pager is the worst failure mode an alert can have.Detection is only useful when it is wired to a response. The stats trigger gives Kestra the detection, and everything after the threshold crossing is ordinary flow machinery: notifications with the trigger's outputs, retries on the webhook call, an execution per incident, and room to grow the response, fetch context stats, open a ticket, or start a mitigation flow, without touching the detection rule.
FASTLY_API_TOKEN: Fastly API token with stats read access.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.serviceId on the trigger with your Fastly service ID and tune threshold to your traffic.disabled: false on the trigger to arm it.field, or clone the trigger in a second flow for bandwidth or request anomalies.io.kestra.plugin.fastly.stats.Stats as a first task to attach a fuller picture of the window to the execution.