Schedule icon
Webhook icon
Loop icon
Request icon
Script icon
If icon
SlackIncomingWebhook icon
OutputValues icon

Monitor API Latency SLOs with Synthetic Probes and Slack Alerts

Synthetic API latency monitoring with Kestra. Probe endpoints, evaluate SLO budgets, and alert Slack before SLAs breach.

Categories
Infrastructure

Catch slow APIs before customers do. This blueprint runs synthetic latency probes against a configurable list of endpoints every 10 minutes, takes multiple samples per endpoint to smooth single-request noise, evaluates the results against a latency SLO budget in Python, and posts a Slack alert only when an endpoint breaches. A webhook trigger enables on-demand probes from deploy pipelines or ChatOps.

How it works

  1. every_10_minutes (io.kestra.plugin.core.trigger.Schedule, cron */10 * * * *) launches the run; on_demand_webhook allows ad-hoc probes.
  2. probe_endpoints (io.kestra.plugin.core.flow.Loop, concurrency 4) fans out across inputs.endpoints.
  3. collect_samples (nested Loop) issues inputs.samples_per_endpoint sequential http_probe (io.kestra.plugin.core.http.Request) GETs with 10s connect / 15s read timeouts and allowFailed: true.
  4. evaluate_slo (io.kestra.plugin.scripts.python.Script) compares observed latency against inputs.latency_slo_ms and sets breached.
  5. alert_on_breach (io.kestra.plugin.core.flow.If) posts to Slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) only on breach.
  6. emit_slo_metrics (io.kestra.plugin.core.output.OutputValues) exports probe coverage for audit history.

What you get

  • Parallel synthetic probes across any number of endpoints.
  • Multi-sample smoothing so one slow request does not page on-call.
  • Configurable latency SLO budget (default 800ms) and sample count.
  • Slack alerts with endpoint, budget, and execution link.
  • Failure alert if the monitor itself errors.

Who it's for

  • SRE and platform teams owning API SLOs and error budgets.
  • Backend teams validating latency after each deploy.
  • Teams replacing Pingdom / UptimeRobot latency checks with code.

Prerequisites

  • Outbound network access to target endpoints.
  • Slack Incoming Webhook URL.

Secrets

  • SLACK_WEBHOOK_URL: Slack Incoming Webhook for breach and failure alerts.
  • WEBHOOK_KEY: auth key for the on-demand webhook trigger.

Quick start

  1. Set SLACK_WEBHOOK_URL and WEBHOOK_KEY secrets.
  2. Edit endpoints, latency_slo_ms, and samples_per_endpoint inputs.
  3. Run once manually to verify probes reach your APIs.
  4. Enable the every_10_minutes schedule.

How to extend

  • Persist p50/p95 per run to Postgres or BigQuery for burn-rate charts.
  • Assert on response body (e.g. {"status":"ok"}) in addition to latency.
  • Escalate repeated breaches to PagerDuty after N consecutive failures via KV counters.

Links

Inputs

  • endpoints (ARRAY of STRING): URLs to probe.
  • latency_slo_ms (INT, default 800): breach threshold in milliseconds.
  • samples_per_endpoint (INT, default 5): probes per endpoint per run.

Outputs

  • emit_slo_metrics.values.endpoints_probed: number of endpoints probed.
  • emit_slo_metrics.values.probed_at: run timestamp for SLA reports.
See How

New to Kestra?

Use blueprints to kickstart your first workflows.