New to Kestra?
Use blueprints to kickstart your first workflows.
Fire a Kestra flow when Prometheus reports up == 0 and page Discord with the number of targets down. The polling trigger checks every minute.
The up metric is the heartbeat of every Prometheus deployment, one series per scrape target, 0 when the scrape fails. This blueprint turns that heartbeat into an event. The io.kestra.plugin.prometheus.Trigger evaluates up == 0 every minute and starts an execution only when the query returns at least one result, so nothing runs while the fleet is healthy. When targets drop, the flow pages Discord with {{ trigger.size }}, the number of down targets, giving on-call the blast radius in the first line of the message.
watch_targets (io.kestra.plugin.prometheus.Trigger) polls Prometheus on a PT1M interval with the PromQL query up == 0 and fetchType: FETCH. The trigger fires only when the result set is non-empty, and its outputs mirror the Query task, so the matched series are available as {{ trigger.rows }} and the count as {{ trigger.size }}.page_discord posts the count and the execution id to a Discord channel through an incoming webhook.errors block posts a distinct Discord message if the alert flow itself fails, so a broken webhook never silently swallows an outage.disabled: true; flip it once your secrets are in place.up.Alertmanager sends notifications; Kestra starts workflows. Because the trigger produces a real execution with the query results attached, the response can grow from a Discord message into a remediation pipeline, restart a service, open a ticket, capture diagnostics, all in the same flow, with every firing recorded in the execution history for postmortems.
username and password properties if Prometheus sits behind one.PROMETHEUS_URL: base URL of the Prometheus server, e.g. http://prometheus:9090.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.PROMETHEUS_URL and DISCORD_WEBHOOK_URL secrets to your Kestra namespace.disabled: false on the watch_targets trigger.up{job="api"} == 0, to avoid paging on lab instances.PT5M for less urgent environments.page_discord, such as restarting the target through an SSH or Kubernetes task.