Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

Apache Spark Streaming Processing Delay and Scheduling Lag Sentinel

Monitors Apache Spark Streaming applications for batch processing delays exceeding micro-batch intervals.

Categories
DataInfrastructure

How it works

This workflow queries the Apache Spark Driver REST API (/api/v1/applications/{app_id}/streaming/batches) to monitor micro-batch processing times and scheduling delays. In Spark Structured Streaming and micro-batch architectures, if batch processing time exceeds the configured trigger interval (e.g. batch takes 15 seconds on a 5-second trigger), scheduling delays accumulate monotonically. Queued micro-batches flood driver memory, executor garbage collection escalates, and end-to-end data latency spikes. This workflow tracks processing delays and alerts data engineering teams before driver OOM crashes occur.

What you get

  • Real-time visibility into Spark Streaming micro-batch latency and scheduling delays.
  • Prevents runaway memory accumulation on Spark Driver nodes.
  • Actionable metrics on total processing delay across batch runs.

Who it's for

  • Big Data Engineers and Spark Platform Administrators.
  • SREs maintaining high-throughput Spark streaming pipelines.

Why orchestrate this with Kestra

  • Continuous Pipeline Assurance: Automatically evaluates streaming batch latency on an automated cadence.
  • Native API Interaction: Connects cleanly to Spark Driver REST endpoints.
  • Direct Team Alerts: Delivers diagnostic metrics directly to Slack channels.

Prerequisites

  • Spark Driver running with Web UI / REST API accessible (port 4040).
  • Secret SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import the blueprint.
  2. Input Spark Driver URL and Application ID.
  3. Run the workflow to inspect batch processing metrics.

How to extend

  • Monitor executor memory spilling via /api/v1/applications/{app_id}/executors.
  • Automatically adjust dynamic allocation executor limits when batch delays persist.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.