Verify Kafka metrics collection

After configuring Grafana Alloy to collect Kafka metrics, you should confirm that the metrics are successfully being sent to Grafana Cloud. Using the Explore view, you can query for Kafka-specific metric names to verify the integration is working correctly.

Common Kafka metrics to check include message rates, byte rates, and request metrics. These metrics provide immediate confirmation that Alloy is successfully connecting to your Kafka brokers via JMX and forwarding the data to your Grafana Cloud stack.

To verify Kafka metrics collection, complete the following steps:

  1. In Grafana Cloud, click the menu icon and select Explore.
  2. In the data source dropdown, select your Prometheus data source (typically named “grafanacloud-[your-stack]-prom”).
  3. In the metrics browser or query field, search for Kafka metrics by typing kafka_.
  4. Select a metric to verify, such as kafka_server_brokertopicmetrics_messagesin_total or kafka_server_brokertopicmetrics_bytesin_total.
  5. Click Run query to execute the query.
  6. Verify that data points appear in the graph and table views.
  7. Check the labels to confirm they include your broker information (instance, job, topic).
  8. Try querying additional Kafka metrics to ensure comprehensive data collection.

Kafka metrics appear in Explore with recent timestamps and correct label values. The metrics update as new data arrives from your Kafka brokers, typically within 1-2 minutes of the first scrape.

In the next milestone, you install pre-built Kafka dashboards to visualize your metrics.

Were you successful?

More to explore (optional)

At this point in your journey, you can explore the following paths:

Query and visualize data in Explore

Prometheus query basics


page 7 of 12