New to Kestra?
Use blueprints to kickstart your first workflows.
Gate on your SLO error budget with a scheduled Kestra flow. Query the error rate from Prometheus, alert Slack, and fail the execution on a breach.
An error budget only changes behavior if something enforces it. This blueprint turns the budget into a gate with a machine-readable verdict. Each day, io.kestra.plugin.prometheus.Query computes the ratio of 5xx requests to all requests over the last hour with fetchType: FETCH_ONE. An If task compares the scalar against a 0.1 percent threshold. Above it, the flow alerts Slack and fails through io.kestra.plugin.core.execution.Fail, so any pipeline gated on this flow's success, deploys included, stops. Below it, the flow logs the healthy reading and exits green.
check_error_rate (io.kestra.plugin.prometheus.Query, fetchType: FETCH_ONE) evaluates the PromQL ratio and exposes the single row as {{ outputs.check_error_rate.row }}.budget_gate (io.kestra.plugin.core.flow.If) compares the row value, cast with the number filter, against 0.001.alert_budget_burn posts the measured rate to Slack, then fail_gate fails the execution with an explicit errorMessage carrying the number.budget_ok logs the reading, turning the execution history into an SLO audit trail.errors block posts a Slack alert whenever the execution fails, covering both a genuine breach and a broken query.Schedule trigger runs the gate daily at 06:00, before the deploy window.If condition.A Prometheus alert can tell you the budget burned; it cannot stop a deploy. Because this gate is a flow with a real terminal state, other flows can require its success, CI systems can poll its outcome, and the whole policy lives in version-controlled YAML with a complete history of every decision it made.
http_requests_total with a status label, or adjust the PromQL to your metric names.username and password properties if Prometheus sits behind one.PROMETHEUS_URL: base URL of the Prometheus server, e.g. http://prometheus:9090.SLACK_WEBHOOK_URL: Slack incoming webhook URL.PROMETHEUS_URL and SLACK_WEBHOOK_URL secrets to your Kestra namespace.disabled: false on the daily trigger.io.kestra.plugin.core.flow.Subflow at the start of a deploy pipeline.io.kestra.plugin.core.flow.Loop over a list of label selectors.[6h] alongside [1h], to implement multi-window burn rate alerts.