New to Kestra?
Use blueprints to kickstart your first workflows.
Query Prometheus weekly for average CPU usage with PromQL and post the number to Slack. A scheduled Kestra flow turns metrics into a capacity digest.
Capacity planning fails when the data lives only in dashboards nobody opens. This blueprint pushes one number into the channel where decisions happen. Every Monday, io.kestra.plugin.prometheus.Query evaluates avg(rate(process_cpu_seconds_total[7d])) with fetchType: FETCH_ONE, returning a single row whose scalar value flows straight into a Slack message. The team sees the seven-day CPU average without opening Grafana, and the execution history becomes a weekly log of the trend.
weekly_cpu (io.kestra.plugin.prometheus.Query, fetchType: FETCH_ONE) runs the PromQL aggregation against Prometheus and exposes the single result row as {{ outputs.weekly_cpu.row }}.notify interpolates the scalar value from the row into a Slack message, keeping the JSON payload free of complex objects.errors block posts a distinct Slack alert when the query or the notification fails, naming the flow and execution.Schedule trigger sends the digest every Monday at 08:00.Prometheus answers the question; Kestra makes the answer show up on time. The schedule, the query, the message, and the failure alert live in one version-controlled YAML file, and every digest that ever went out is auditable in the execution history. Adding a second metric or a second channel is a task, not a new cron job.
process_cpu_seconds_total.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 weekly trigger.avg(node_memory_MemAvailable_bytes), and interpolate each scalar into one digest message.avg(rate(process_cpu_seconds_total{job="api"}[7d])), for a per-service digest.time property to evaluate the query at a fixed point, for example the end of the previous week, for consistent reporting windows.