Query icon
If icon
Log icon
Fail icon
Schedule icon

JSON Access Log Intelligence and Error Rate SLA Gate with DuckDB

Automate JSON access log analytics and SLA error rate monitoring using DuckDB in Kestra, featuring input file ingestion and execution-terminating SLA breach gates.

Categories
Data

Automated log monitoring workflow that queries semi-structured JSON access logs using embedded DuckDB SQL functions to calculate server error rates and enforce service-level reliability gates.

How it works

  1. The flow accepts a JSON access log file as an execution input.
  2. The Query task utilizes DuckDB's native read_json_auto() function to inspect the uploaded log payload, compute total request volume, calculate 5xx error counts, and determine average response latency without external ingest engines.
  3. An If conditional evaluation task tests whether the computed error rate remains within SLA tolerances (<= 5%).
  4. If the error rate exceeds 5%, the flow logs a breach alert and triggers a Fail task, terminating the execution to block downstream steps and alert on-call teams.

What you get

  • Zero-infrastructure JSON log analytics using embedded DuckDB.
  • Automated percentage calculation for HTTP 5xx server failure rates.
  • Real-time SLA threshold evaluation with execution-failing breach enforcement.
  • Pluggable input file support for production access logs from object storage or files.

Who it's for

  • DevOps and Site Reliability Engineers tracking service error budgets.
  • Data Engineers aggregating semi-structured log streams without heavy OLAP clusters.
  • Platform teams establishing automated SLA breach alerting pipelines.

Why orchestrate this with Kestra

  • Unified orchestration of log ingestion, analytical aggregation, and alerting.
  • Serverless in-process DuckDB execution avoids running dedicated monitoring databases.
  • Clear state tracking, full audit logs, and automatic failure propagation upon SLA breach.

Prerequisites

  • Basic understanding of SQL syntax and HTTP status codes.
  • JSON log file with service, status_code, and response_time_ms fields.

Secrets

  • None required for local in-process execution.

Quick start

  1. Import this blueprint into your Kestra instance.
  2. Click Execute and upload a JSON access log file.
  3. Inspect the Outputs tab to review calculated error percentages.
  4. If error rate exceeds 5%, the execution automatically fails.

How to extend

  • Modify read_json_auto() to stream directly from Amazon S3, Google Cloud Storage, or MinIO buckets.
  • Insert a PagerDuty, Slack, or OpsGenie notification task before the Fail task to dispatch immediate on-call pages during outages.
  • Write aggregated hourly SLA metrics into ClickHouse or PostgreSQL for historical uptime reporting.

Links

Orchestrate with Kestra
Orchestrate DuckDB with Kestra
Share this Blueprint
See How

New to Kestra?

Use blueprints to kickstart your first workflows.