New to Kestra?
Use blueprints to kickstart your first workflows.
Get a weekly Trino health digest with Kestra. Query system.runtime.queries for completed, failed, and slowest queries, delivered to Discord on Mondays.
Trino tells you everything about its own workload through the system.runtime.queries catalog, but only if someone looks. This blueprint looks every Monday: one io.kestra.plugin.jdbc.trino.Query with fetchType: FETCH_ONE aggregates the last seven days of query history into completed and failed counts plus the longest wall time, and posts the digest to Discord before the ops review.
cluster_stats (io.kestra.plugin.jdbc.trino.Query, fetchType: FETCH_ONE) queries system.runtime.queries, counting queries by state with count_if and computing the maximum wall time as date_diff('second', created, "end"). The quoted "end" column is a reserved word in SQL, and coalesce keeps the metric at 0 on quiet clusters. The single result row is addressable as {{ outputs.cluster_stats.row.* }}.notify interpolates the four scalars into a Discord message: total, completed, failed, and longest wall time in seconds.errors block posts a distinct Discord alert when the digest itself fails, which usually means the coordinator is unreachable, a health signal in its own right.Schedule trigger runs the digest every Monday at 07:00.The runtime catalog only holds what the coordinator currently remembers, so the value comes from sampling it on a reliable schedule and keeping the results somewhere durable. Kestra provides the schedule, retries against a briefly busy coordinator, an execution history that preserves each week's numbers, and delivery to Discord, all as a few lines of reviewable YAML.
system.runtime.queries; visibility of other users' queries depends on your access control rules.system.runtime.queries reflects the coordinator's in-memory history, so a coordinator restart shortens the window; back the digest with an event listener or query log for strict completeness.TRINO_URL: JDBC URL, e.g. jdbc:trino://host:443/system/runtime (use https on 443 in production; password authentication requires TLS).TRINO_USERNAME: Trino username.TRINO_PASSWORD: Trino password.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.disabled: false on the weekly trigger.count_if(state = 'RUNNING') and queue metrics like queued_time_ms percentiles to spot saturation.user or source with a second query to find noisy tenants.