New to Kestra?
Use blueprints to kickstart your first workflows.
Compare ERROR log counts between two release versions in Grafana Loki with Kestra. Get a Discord rollback suggestion when the new version errors more.
Every deploy answers one question badly: is the new version actually worse. Dashboards show the total, not the split. This blueprint answers it directly with two io.kestra.plugin.grafana.loki.QueryRange tasks that count ERROR lines per version label over the same one hour window, one for the trusted baseline and one for the fresh release. If the new version out-errors the old one, Discord gets both counts and a rollback suggestion; otherwise the flow records a pass.
old_version_errors and new_version_errors (io.kestra.plugin.grafana.loki.QueryRange) each run {app="checkout", version="..."} |= "ERROR" with since: 1h, so both releases are measured over the identical window.old_version and new_version inputs, defaulting to v1.4.2 and v1.5.0, so the flow runs manually or from a deploy pipeline passing real values.compare_versions (io.kestra.plugin.core.flow.If) compares the two scalar counts with {{ (outputs.new_version_errors.logs | length) > (outputs.old_version_errors.logs | length) }}.suggest_rollback posts both counts and the version names to Discord; on a pass, log_release_healthy records the same numbers in the execution log.errors block alerts when the comparison itself fails, because a missing verdict is easy to misread as a green one.The comparison is two queries and an if statement, but a release gate needs to run at the right moment, with the right version values, produce a verdict somewhere visible, and never fail silently. Kestra provides the input contract for the pipeline, the branching, the notification, and a per-deploy execution history that shows every verdict this gate has ever produced.
app and version in Loki, so releases are distinguishable by selector.authToken and tenantId (X-Scope-OrgID).LOKI_URL: Loki base URL, e.g. http://loki.monitoring:3100.DISCORD_WEBHOOK_URL: Discord incoming webhook URL.LOKI_URL and DISCORD_WEBHOOK_URL secrets to your Kestra namespace.io.kestra.plugin.core.trigger.Webhook and mapping the body to the inputs.