New to Kestra?
Use blueprints to kickstart your first workflows.
Snapshot a PromQL result set from Prometheus into Kestra internal storage for audits and offline analysis, with a Discord note on the series count.
Prometheus data expires; audit questions do not. This blueprint captures a PromQL result set as a durable file before retention erases it. Each night, io.kestra.plugin.prometheus.Query evaluates avg_over_time(up[24h]), the daily availability of every scrape target, with fetchType: STORE. Instead of flowing through task outputs, the full result set lands as a file in Kestra's internal storage, attached to the execution and addressable by URI for downstream processing. A Discord note confirms the capture and reports the series count.
snapshot_availability (io.kestra.plugin.prometheus.Query, fetchType: STORE) runs the PromQL expression and writes the complete result set to internal storage. The file is exposed as {{ outputs.snapshot_availability.uri }} and the series count as {{ outputs.snapshot_availability.size }}.notify posts the series count to Discord, keeping only scalars in the JSON payload.errors block posts a distinct Discord alert on failure, because a silent gap defeats the point of an audit record.Schedule trigger captures the snapshot nightly at 01:00.STORE semantics that handle large result sets without bloating execution context, unlike FETCH.Scripting this means a cron job, an HTTP call, a file naming convention, somewhere durable to put the file, and a notification when it breaks. Kestra collapses all of it, the query task streams the result to managed internal storage, the URI flows to any downstream task, the schedule and the failure alert live in the same YAML, and every capture is traceable to an execution.
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 daily trigger.{{ outputs.snapshot_availability.uri }}.time property to snapshot the metric state at a fixed timestamp, for example midnight, for consistent daily records.