Skip to content

Prometheus Metrics Reporter for Apache Kafka server and client components

License

Notifications You must be signed in to change notification settings

strimzi/metrics-reporter

License Twitter Follow

Strimzi Prometheus Metrics Reporter

Apache Kafka® brokers and clients expose metrics to monitor them. A pluggable reporter interface allows exporting these metrics to monitoring systems. Apache Kafka has a built-in reporter for JMX.

This repository contains a reporter implementation for Prometheus as proposed in Strimzi Proposal #64.

Warning

The project is currently in early access.

Installing

Download and extract the .tar.gz or .zip archive from the latest release and add all the JARs to the classpath.

Building from source

Alternatively you can build the metrics reporter:

mvn package

After building, make sure the metrics reporter JARs located under target/metrics-reporter-*/metrics-reporter-*/libs/ are in the classpath.

Configuring

The metrics reporter has the following configurations:

  • prometheus.metrics.reporter.listener: The HTTP listener to expose the metrics. It must be in the http://[host]:[port] format. This defaults to http://:8080.
  • prometheus.metrics.reporter.listener.enable: Enable the listener to expose the metrics. This defaults to true.
  • prometheus.metrics.reporter.allowlist: A comma separated list of regex patterns to specify the metrics to collect. This defaults to .*.

Running

Kafka Brokers

To use the reporter with Kafka brokers, add the following to your broker configuration:

metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
kafka.metrics.reporters=io.strimzi.kafka.metrics.YammerPrometheusMetricsReporter
auto.include.jmx.reporter=false

Kafka Clients

To use the reporter with Kafka producers, consumers or admin clients, add the following to your client configuration:

metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
auto.include.jmx.reporter=false

Kafka Connect and Kafka Streams

To use the reporter with Kafka Connect and Kafka Streams, add the following to your Connect runtime or Streams application configuration:

metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
auto.include.jmx.reporter=false
admin.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
admin.auto.include.jmx.reporter=false
producer.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
producer.auto.include.jmx.reporter=false
consumer.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
consumer.auto.include.jmx.reporter=false

When setting configurations for the Prometheus metrics reporter, they also need to be set with the admin., producer. and consumer.. For example, to set the listener to http://:8081:

metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
prometheus.metrics.reporter.listener=http://:8081
auto.include.jmx.reporter=false
admin.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
admin.prometheus.metrics.reporter.listener=http://:8081
admin.auto.include.jmx.reporter=false
producer.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
producer.prometheus.metrics.reporter.listener=http://:8081
producer.auto.include.jmx.reporter=false
consumer.metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter
consumer.prometheus.metrics.reporter.listener=http://:8081
consumer.auto.include.jmx.reporter=false

Accessing Metrics

Metrics are exposed on the configured listener on the GET /metrics endpoint. For example, by default this is http://localhost:8080/metrics.

Getting help

If you encounter any issues while using Strimzi, you can get help using:

Strimzi Community Meetings

You can join our regular community meetings:

Resources:

Contributing

You can contribute by:

  • Raising any issues you find using Strimzi
  • Fixing issues by opening Pull Requests
  • Improving documentation
  • Talking about Strimzi

All bugs, tasks or enhancements are tracked as GitHub issues.

If you want to get in touch with us first before contributing, you can use:

License

Strimzi is licensed under the Apache License, Version 2.0

About

Prometheus Metrics Reporter for Apache Kafka server and client components

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published