Monedula

monedula-metrics-reporter v0.10.0, AGPL-3.0

Kafka metrics, straight to OpenTelemetry

monedula-metrics-reporter runs inside the broker and pushes metrics over OTLP to your collector: both Kafka metric registries, JVM metrics and KIP-714 client telemetry, with broker identity as labels. If the collector goes away, Kafka does not notice.

Maven Central
VERSION=0.10.0
curl -L -o monedula-metrics-reporter-${VERSION}.jar \
  https://repo1.maven.org/maven2/dev/monedula/monedula-metrics-reporter/${VERSION}/monedula-metrics-reporter-${VERSION}.jar
GitHub Release
VERSION=0.10.0
curl -L -o monedula-metrics-reporter-${VERSION}.jar \
  https://github.com/monedula-dev/monedula-metrics-reporter/releases/download/v${VERSION}/monedula-metrics-reporter-${VERSION}.jar
server.properties
metric.reporters=dev.monedula.metricsreporter.OtlpMetricReporter

otlp.metric.reporter.endpoint=http://otel-collector:4317
otlp.metric.reporter.transport=grpc
terminal
cp monedula-metrics-reporter-0.10.0.jar $KAFKA_HOME/libs/# then add the lines above to server.properties# every series carries the broker's cluster and node IDs as resource attributes

The problem

Most Kafka metrics take the long way round.

The usual stack attaches a JMX exporter to every broker: it reads Kafka's metrics back out of JMX MBeans, maps them to metric names with rule files, and serves them for a scrape or pushes them on to a collector.

monedula-metrics-reporter plugs into Kafka's own MetricsReporter interface and speaks OTLP to the collector directly.

3
export pipelines: Kafka SPI and Yammer, JVM runtime, and KIP-714 client telemetry
3.7 to 4.3
Apache Kafka versions tested for 0.10.0, on JDK 17 and 21

How it works

  1. Kafka broker Kafka SPI and Yammer registries
    KIP-714 clients producers and consumers push via the broker
  2. monedula-metrics-reporter in-process, asynchronous
  3. OpenTelemetry Collector OTLP over gRPC or HTTP
  4. Prometheus, Grafana, any OTLP backend routing and fan-out live in the collector
Metrics flow from Kafka through the in-process reporter to an OpenTelemetry Collector, which routes them to any backend.

Kafka keeps running when the collector is down

Metric callbacks only update an in-memory map; all network I/O happens on a daemon thread. There is no retry queue and no unbounded memory, so a slow or missing collector never holds up produce or fetch requests.

How the fail-safe design works

  1. Collector unreachable
  2. Export call times out
  3. Batch dropped, counted in self-monitoring metrics
  4. Next tick starts fresh; Kafka never waits

SPI and Yammer metrics from one plugin

Kafka brokers expose metrics through two parallel systems. Several broker signals only register with the legacy Yammer registry, so an SPI-only reporter misses them. This plugin attaches to both with one configuration, and the same JAR runs unchanged on clients.

  • UnderReplicatedPartitions
  • OfflinePartitionsCount
  • ActiveControllerCount
  • per-topic BrokerTopicMetrics

KIP-714

Client metrics without touching clients

On brokers, the plugin also receives the telemetry that KIP-714 clients push, such as client-side request latency and rebalance timings, and forwards it to the same collector. Client series carry the broker's identity and the client id, so they join broker series in PromQL.

Collect client metrics

Labels on forwarded client metrics
kafka_cluster_id, kafka_node_idon by default
client_idon by default
client_instance_idopt-in, high cardinality
principal and client addressopt-in, personal data

Dashboards included

The quickstart starts Kafka, the reporter, an OpenTelemetry Collector, Prometheus and Grafana with Docker Compose, with Grafana dashboards and Prometheus alert rules ready to use.

The Grafana quickstart

Grafana overview dashboard of Kafka metrics exported by monedula-metrics-reporter

Install

Maven Central
VERSION=0.10.0
curl -L -o monedula-metrics-reporter-${VERSION}.jar \
  https://repo1.maven.org/maven2/dev/monedula/monedula-metrics-reporter/${VERSION}/monedula-metrics-reporter-${VERSION}.jar
GitHub Release
VERSION=0.10.0
curl -L -o monedula-metrics-reporter-${VERSION}.jar \
  https://github.com/monedula-dev/monedula-metrics-reporter/releases/download/v${VERSION}/monedula-metrics-reporter-${VERSION}.jar

Coordinates dev.monedula:monedula-metrics-reporter. Each GitHub release also carries the JAR with a CycloneDX SBOM and Sigstore signatures.

Questions

Is monedula-metrics-reporter free, and can I use it at work?
Yes. It is AGPL-3.0 with no paid edition, and running it in your own brokers and clients does not oblige you to share your code or configuration: AGPL obligations apply when you distribute it, modified or not, or let others use a modified version over a network.
Do my client applications need changes for client metrics?
No. KIP-714 push is on by default in the Java client and in librdkafka 2.5 and later. You activate it centrally with a broker-side client-metrics subscription, and the reporter forwards what clients push. See collect client metrics.
Do I need Prometheus?
No. The reporter speaks OTLP to an OpenTelemetry Collector, and the collector can export to any backend it supports. Routing, fan-out and vendor exporters are configured in the collector.
Which Java and Kafka versions does it support?
Java 17 or later and Apache Kafka 3.7.0 to 4.3.0, on brokers and clients: for 0.10.0, CI tested JDK 17 and 21 against Kafka 3.7.0, 3.9.0, 4.2.0 and 4.3.0. Kafka versions before 3.7 lack the ClientTelemetry interface the plugin implements and are not tested. See compatibility.
How is it different from jmx_exporter?
Both can run inside the Kafka JVM. monedula-metrics-reporter needs no rule file: it derives names from Kafka's own, labels broker series with the cluster and node IDs, and forwards KIP-714 client metrics. The comparison page covers the other options.

Support

Help from the people who build it

We can help you run monedula-metrics-reporter across a large estate, from design to day-to-day operations.

Part of
Monedula Flock

More free tools for Apache Kafka from the same team. About Flock

Go, AGPL-3.0, v1.0.0

monedula-gitops

GitOps for Apache Kafka: topics, access, quotas, schemas, SCRAM users and Confluent RBAC, from a CLI or a Kubernetes operator.

Go, AGPL-3.0, v0.10.0

monedula-acl-rbac-converter

A CLI that converts Apache Kafka ACLs into Confluent RBAC role bindings through a checksummed plan and verifies effective access before any ACL is deleted.

Go, Apache-2.0, v0.11.0

monedula-sim-link

A read-only Go CLI that turns a real Kafka cluster into a shareable Kafka Simulator link, with an MCP server for AI agents.

Free, runs in your browser

Kafka Simulator

An interactive, deterministic Apache Kafka simulator in the browser: break a cluster, scrub the timeline and read why it reacted.