• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

OpenTelemetry Kafka metrics reference

This page documents the metrics collected when monitoring Apache Kafka with OpenTelemetry. Metrics are collected via the Kafka metrics receiver, JMX receiver, and OpenTelemetry Java agent for client-side metrics.

Metric collection methods

OpenTelemetry Kafka monitoring uses two complementary receivers:

  • Kafka metrics receiver: Connects to Kafka's bootstrap port to collect cluster, topic, partition, and consumer group metrics
  • JMX receiver: Connects to JMX port (typically 9999) to collect detailed broker metrics and JVM metrics

Kafka metrics receiver metrics

These metrics are collected from Kafka brokers using the Kafka protocol (bootstrap port). Based on the kafkametricsreceiver metadata, with some metrics disabled by default or in typical configurations.

JMX receiver metrics

The JMX receiver collects detailed metrics from Kafka broker MBeans via JMX (typically port 9999). Metrics are collected using two configurations:

  1. Default Kafka target system - Built-in Kafka-specific metrics from target_system: kafka (kafka.yaml)
  2. Custom JMX metrics - Additional Kafka metrics and JVM metrics defined in custom configuration

Default Kafka target system metrics

These metrics are automatically collected when using target_system: kafka:

Custom JMX metrics

These additional Kafka metrics and JVM metrics are collected when using a custom JMX configuration file (as shown in the self-hosted setup). The custom configuration allows you to collect additional Kafka-specific metrics beyond the default set, as well as JVM health metrics.

Kafka client metrics (OpenTelemetry Java agent)

These metrics are collected from Kafka producer and consumer applications instrumented with the OpenTelemetry Java agent with Kafka instrumentation enabled. These provide client-side visibility into application interactions with Kafka brokers and complement the broker-side metrics by providing the application perspective.

Metric attributes

Metrics can be filtered and grouped using the following attributes:

Common attributes:

  • kafka.cluster.name - Name of the Kafka cluster (all metrics)
  • instrumentation.provider - Always opentelemetry (all metrics)
  • topic - Kafka topic name
  • partition - Partition number
  • group - Consumer group name
  • broker.id - Broker identifier (JMX metrics)
  • client-id - Client identifier (client metrics)
  • node-id - Broker node identifier (client metrics)
  • type - Request type (e.g., fetch, produce)
  • direction - Data direction (in, out)
  • state - ISR operation state (shrink, expand)
  • name - GC collector or memory pool name (JVM metrics)

Next steps

Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.