Docs Home
Viewing docs for
BYOCSelf-Managed

Monitoring and Metrics

On this page

Out of the box, Flink jobs that run in a Bring-Your-Own-Cloud (BYOC) workspace expose metrics by using:

  • JMX (Java Management Extensions)
  • Prometheus (HTTP endpoint scraping)

This page describes what is already configured in your BYOC deployment so you can plug the data into your own monitoring stack (for example, Prometheus + Grafana).
Setting up or operating Prometheus / Grafana itself is outside the scope of this documentation and remains entirely under your control.

What’s Pre-configured?

1. Pod-level Prometheus Annotations

Every Flink pod (JobManager and TaskManager) includes annotations that instruct a Prometheus scraper to collect metrics automatically:

YAML
1annotations:
2  prometheus.io/path: /metrics
3  prometheus.io/port: "9999"
4  prometheus.io/scrape: "true"
  • prometheus.io/path: The HTTP path where metrics are exposed (/metrics).
  • prometheus.io/port: The container port (9999) where the metrics endpoint listens.
  • prometheus.io/scrape: Indicates that the pod should be scraped (true).

The following metric reporters are enabled by default in the Flink cluster configuration shipped with BYOC:

YAML
1metrics.reporters: jmx,promappmgr
2
3# JMX Reporter
4metrics.reporter.jmx.factory.class: org.apache.flink.metrics.jmx.JMXReporterFactory
5metrics.reporter.jmx.port: 10000-10240  # Port range for JMX
6
7# Prometheus Reporter
8metrics.reporter.promappmgr.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
ReporterPurposeWhere It Listens
JMXFor JVM-based monitoring tools or exporters.Ports 10000–10240 on each pod.
PrometheusExposes human-readable metrics on the HTTP endpoint defined by the pod annotations.Port 9999 (/metrics).

Next Steps

  1. Scrape the Metrics
    • Point your in-cluster Prometheus deployment at the Kubernetes namespace (or use ServiceMonitor objects) so it detects pods with the prometheus.io/scrape: "true"annotation. For more details, visit the official Prometheus documentation website.
  2. Visualize in Grafana
    • Build your own using the Prometheus data source.
  3. Define Alerts
    • Define alert rules in Prometheus or Grafana Alerting to monitor job health (e.g., restart count, checkpoint failures, backpressure).
  4. Export to Other Observability Tools
    • This same endpoint can be scraped directly by hosted observability platforms. See the Datadog, New Relic, and Dynatrace documentation for their own Prometheus scraping setup.

Exporting to Dynatrace

Dynatrace can discover this endpoint automatically in Kubernetes, without installing OneAgent on the Flink pods, through annotation-based Prometheus scraping. Metrics reach Dynatrace through an in-cluster ActiveGate, directly from the pod annotations.

ComponentConfigurationBenefit
Dynatrace ActiveGateKubernetes Platform Monitoring onlyEliminates heavy VM/host-level processing
Log MonitoringLightweight DaemonSetReads stdout/stderr directly from the Flink pods
OneAgentOmitted completelySaves infrastructure overhead and licensing budget
  1. Enable Flink's built-in Prometheus reporter for both the JobManager and TaskManager, under flinkConfiguration in the Deployment spec, or in Deployment Defaults to apply it to every Deployment. Set metrics.reporter.prom.factory.class to org.apache.flink.metrics.prometheus.PrometheusReporterFactory and metrics.reporter.prom.port to 9249, Flink's default Prometheus exporter port. Standardize on this port (or another of your choosing) on both pod types, and make sure it matches the pod annotation in step 3.
YAML
1flinkConfiguration:
2  metrics.reporter.prom.factory.class: org.apache.flink.metrics.prometheus.PrometheusReporterFactory
3  metrics.reporter.prom.port: 9249
  1. Flink exposes roughly four to five times as many metrics by default as a typical microservice. Filter them at the source with metrics.reporter.prom.filter.includes or metrics.reporter.prom.filter.excludes, not metrics.reporter.prom.scope.variables (which controls tag and label variables, not metric selection), so Dynatrace ingests only high-value data points such as checkpoints, memory, and backpressure. For example:
YAML
1flinkConfiguration:
2  metrics.reporter.prom.filter.includes: "*:*checkpoint*,*numRecords*,*backPressure*:counter,gauge"
  1. Add the following annotations to the pod template for both the JobManager and TaskManager, using the port from step 1:
YAML
1metadata:
2  annotations:
3    metrics.dynatrace.com/scrape: "true"
4    metrics.dynatrace.com/port: "9249"
  1. Make sure an in-cluster ActiveGate is deployed, and that Kubernetes Platform Monitoring (annotated Prometheus scraping) is enabled in Dynatrace's Kubernetes settings.

Once metrics start flowing, query them in Dynatrace's Data Explorer or chart them on a dashboard, for example checkpoint success and failure ratios, backpressure across pipeline tasks, and JVM memory and CPU usage. For anything beyond this setup, see Dynatrace's Prometheus metrics monitoring documentation.

No additional configuration inside Ververica Cloud: Bring-Your-Own-Cloud is required. All metrics are emitted automatically once the Flink cluster starts.

Was this helpful?