New to Kestra?
Use blueprints to kickstart your first workflows.
Detect silent services with Kestra and Grafana Loki. An hourly heartbeat query alerts Slack and fails loudly when a service stops logging entirely.
Error alerting has a blind spot: a service that crashes hard, loses its log shipper, or hangs entirely produces no errors at all. The absence of logs is the signal. This blueprint inverts the usual pattern with io.kestra.plugin.grafana.loki.QueryRange: every hour it fetches the payments service heartbeat lines from the last hour, and if the query returns zero lines the flow alerts Slack and deliberately fails, turning silence into a red execution nobody can miss.
check_heartbeat (io.kestra.plugin.grafana.loki.QueryRange) runs {app="payments"} |= "heartbeat" with since: 1h, so the window always covers the hour before the check.evaluate_silence (io.kestra.plugin.core.flow.If) branches on the scalar count {{ (outputs.check_heartbeat.logs | length) == 0 }}.alert_silence posts a Slack alert and fail_execution (io.kestra.plugin.core.execution.Fail) marks the run failed, so the outage is visible in the execution history and to anything monitoring flow states.log_healthy records the heartbeat count and the run ends green.errors block sends a distinct alert when the check itself breaks; note that the deliberate Fail also routes through it, which is intentional, silence should page twice rather than zero times.Schedule trigger runs the check hourly.Loki can tell you a query returned nothing, but acting on absence needs a scheduler that runs reliably, branching logic, an alert channel, and a way to make the silent hour permanently visible. Kestra provides the schedule, the If branch, the deliberate Fail, and the execution history in one declarative flow, and the check itself failing raises its own alarm.
authToken and tenantId (X-Scope-OrgID).LOKI_URL: Loki base URL, e.g. http://loki.monitoring:3100.SLACK_WEBHOOK_URL: Slack incoming webhook URL.LOKI_URL and SLACK_WEBHOOK_URL secrets to your Kestra namespace.disabled: false on the hourly trigger.since: 15m and a more frequent cron for services with strict availability targets.