Vinteros Labs
Apache Flink monitoring

Apache Flink monitoring, done right

The Flink metrics that actually predict incidents, the tools to collect them, and how to turn them into alerts your team trusts.

How to monitor Apache Flink — the short answer

Apache Flink exposes hundreds of metrics through its metric system. You can read them live in the built-in Flink Web UI (port 8081), query them through the REST API, or export them with a metric reporter such as Prometheus. Production monitoring means keeping their history and alerting on a small set of signals: job restarts, checkpoint failures, backpressure, consumer lag, and TaskManager / JVM health. Teams either build this themselves with Prometheus and Grafana, or use a Flink monitoring console such as Flink Manager by Vinteros Labs, which ships metric history, thresholds, and notifications out of the box.

The Flink metrics that matter

Key Apache Flink metrics to monitor, why they matter, and when to alert
AreaFlink metricsWhy it mattersAlert when
Job availability
  • numRestarts
  • uptime
  • downtime
A job that keeps restarting is failing silently — the Web UI only shows it as RUNNING again.numRestarts increases, or downtime > 0 for more than a few minutes.
Checkpointing
  • lastCheckpointDuration
  • numberOfFailedCheckpoints
  • lastCheckpointSize
Checkpoints are your recovery point. Slow or failing checkpoints mean long recovery and growing state.Any failed checkpoint, or duration approaching the checkpoint timeout.
Backpressure
  • backPressuredTimeMsPerSecond
  • busyTimeMsPerSecond
  • idleTimeMsPerSecond
Shows which operator is the bottleneck. A busy operator downstream of back-pressured ones is the culprit.Sustained high backPressuredTimeMsPerSecond on a source or operator.
Throughput
  • numRecordsInPerSecond
  • numRecordsOutPerSecond
  • numBytesInPerSecond
Drops to zero reveal stalled sources; spikes reveal replays after recovery.Throughput at zero while the source still has data.
Lag & freshness
  • pendingRecords
  • currentEmitEventTimeLag
  • currentInputWatermark
Consumer lag and watermark lag tell you how far behind real time your results are.pendingRecords keeps growing, or watermark stops advancing.
Cluster & JVM
  • numRegisteredTaskManagers
  • taskSlotsAvailable
  • Status.JVM.Memory.Heap.Used
  • Status.JVM.GarbageCollector.<GC>.Time
Lost TaskManagers, exhausted slots, and GC pressure precede most job failures.TaskManager count drops, no free slots, or GC time climbs steadily.

Apache Flink monitoring tools

  1. 1. Built-in Flink Web UI

    Live per-job view on port 8081: checkpoints, backpressure, subtask metrics, and exceptions. No history beyond a short window and no alerting, for one cluster.

  2. 2. Flink REST API

    The same data as JSON — e.g. GET /jobs/overview, GET /jobs/<jobid>/checkpoints, GET /taskmanagers — for scripts and custom health checks.

  3. 3. Metric reporters (Prometheus, JMX, …)

    Flink's metric system exports every metric to an external backend. The Prometheus reporter exposes an endpoint (port 9249 by default) for scraping.

  4. 4. Grafana + Alertmanager

    Dashboards and alert rules on top of Prometheus. Powerful, but every panel, threshold, and alert is yours to build and maintain.

  5. 5. Flink Manager

    A Flink UI with monitoring built in: metric history collected from JMX/Prometheus reporters, a metric dictionary with warning/critical thresholds, cluster health widgets, and persistent notifications — next to SQL, jobs, and RBAC.

Enable the Prometheus reporter

Add these lines to your Flink configuration and restart the JobManager and TaskManagers. Prometheus can then scrape each process on port 9249:

metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
metrics.reporter.prom.port: 9249

Flink Manager reads the same reporters, so enabling Prometheus or JMX once gives you both: Grafana for infrastructure teams and a Flink-aware console for the people who operate the jobs.

Flink monitoring best practices

  • Alert on symptoms users feel — lag, restarts, failed checkpoints — before resource metrics.
  • Keep metric history: most Flink incidents are trends (growing state, slowing checkpoints) that a live dashboard cannot show.
  • Use per-metric warning and critical thresholds instead of a single alert level, to avoid alert fatigue.
  • Find bottlenecks with backpressure and busy time together, not CPU alone.
  • Correlate metrics with change events — deployments, savepoints, and configuration changes — using an audit trail.
  • Monitor every cluster from one place: per-cluster dashboards hide cross-cluster capacity problems.

Comparing consoles? See Flink UI alternatives compared or read what a Flink UI is.

Apache Flink monitoring — FAQ

Monitor Apache Flink without building dashboards

Flink Manager gives you metric history, thresholds, and notifications next to SQL, jobs, and RBAC. Free trial license — no credit card required.