Webhook icon
Schedule icon
Log icon
Commands icon
Docker icon
If icon
SlackIncomingWebhook icon

API Health and Contract Monitor

Operational API health and contract monitor validating HTTP status, response latency, and JSON schema integrity in Kestra.

Categories
Core

Orchestrate an operational API health and schema contract monitoring pipeline that dispatches scheduled HTTP probes, validates status codes and latency boundaries, enforces JSON response contract integrity, and alerts on degradation.

Microservice architectures frequently experience partial or silent degradations, such as returning an HTTP 200 OK with mutated payload schemas or experiencing slow response times that cause upstream timeouts. This blueprint provides a dependable, automated probe:

  1. Scheduled Multi-Tier Probing: Runs on a configurable cron schedule (*/5 * * * *) or via CI/CD test webhooks.
  2. Latency & Contract Assertion (execute_api_health_probe): Measures exact millisecond roundtrip latency and asserts that all mandatory payload keys exist.
  3. Automated Alerting (evaluate_health_and_contract): Sends an immediate alert to Slack when status, latency, or schema contract boundaries fail.

How it works

  1. Triggering:
    • The scheduled_five_minute_probe trigger (io.kestra.plugin.core.trigger.Schedule) executes automated health checks every 5 minutes.
    • The inbound_probe_webhook trigger allows external synthetic test runners to initiate manual verification.
  2. Containerized Execution (execute_api_health_probe):
    • Dispatches an isolated Python container (python:3.11-slim) to probe the target endpoint and measure metrics.
  3. Conditional Alerting (evaluate_health_and_contract):
    • Quietly logs successful runs, and alerts Slack only on degraded health or violated contracts.

What you get

  • Automated status code and latency monitoring across microservices.
  • JSON schema contract assertions catching silent structural payload mutations.
  • Zero false alarms with structured threshold evaluations.
  • Real-time Slack notifications on service degradation.

Who it's for

  • DevOps, SRE, and Platform Engineers monitoring internal and external REST APIs.
  • Backend Developers validating contract compatibility across releases.
  • QA Engineers running automated continuous synthetic health checks.

Prerequisites

  • Docker daemon accessible to Kestra for containerized execution.
  • Slack Incoming Webhook URL configured in Kestra secrets (if Slack alerts are enabled).

Secrets

  • API_PROBE_WEBHOOK_KEY: Secret key for inbound probe webhooks.
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint for team alerts.

Inputs

Name Type Default Description
endpoint_url STRING https://api.internal.acme/v1/health Target REST API endpoint to probe.
expected_status_code INT 200 Expected HTTP response status code.
max_acceptable_latency_ms INT 800 Maximum acceptable latency in milliseconds.
retry_attempts INT 3 Number of retry attempts on transient network timeouts.
environment_tier SELECT Production Deployment tier under observation (Production, Staging).

Quick start runbook

  1. Configure secret SLACK_WEBHOOK_URL in your Kestra namespace.
  2. Trigger the flow manually with your target API URL to observe response latency and contract validation.
  3. Enable the Schedule trigger to automate 5-minute continuous monitoring.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.