New to Kestra?
Use blueprints to kickstart your first workflows.
Count ERROR log lines in Grafana Loki with a scheduled Kestra range query and post a daily Slack digest. Keep error volume visible without dashboards.
Error volume is one of the cheapest health signals a service has, and most teams only look at it after something breaks. This blueprint turns it into a daily habit: io.kestra.plugin.grafana.loki.QueryRange fetches every line matching {app="checkout"} |= "ERROR" from the last 24 hours, and a Slack message reports the total each morning. A rising number across a week is often the earliest warning a team gets.
fetch_errors (io.kestra.plugin.grafana.loki.QueryRange) runs the LogQL query with since: 24h, a relative window that always covers the last day regardless of when the flow executes.limit: 5000 matching lines and exposes them as {{ outputs.fetch_errors.logs }}.post_digest interpolates the scalar count ({{ outputs.fetch_errors.logs | length }}) into the Slack payload; the individual lines stay on the execution, never in the message.errors block posts a distinct Slack alert when the query or the notification fails.Schedule trigger runs the digest daily at 07:00.since window, so backfills and late executions still report the correct day.Loki can answer the count on demand, but a digest needs a schedule, a delivery channel, retries when Loki is briefly unreachable, and a failure alert when the report cannot run. Kestra provides all of that around one declarative task, and every day's digest is auditable in the execution history, including the exact lines behind each count.
app label (adjust the selector to your labels).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 daily trigger.limit for noisy services; the digest counts what the query returns, so the limit caps the reported number.sum(count_over_time(...)) when you need exact totals beyond the fetch limit.