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.
Since there isn't a release available yet, you'll need to build the reporter first:
mvn package
After building, make sure the metrics reporter JARs located under target/metrics-reporter-*/metrics-reporter-*/libs/
are in the classpath.
The metrics reporter has the following configurations:
prometheus.metrics.reporter.listener
: The HTTP listener to expose the metrics. It must be in thehttp://[host]:[port]
format. This defaults tohttp://:8080
.prometheus.metrics.reporter.listener.enable
: Enable the listener to expose the metrics. This defaults totrue
.prometheus.metrics.reporter.allowlist
: A comma separated list of regex patterns to specify the metrics to collect. This defaults to.*
.
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
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
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
Metrics are exposed on the configured listener on the GET /metrics
endpoint. For example, by default this is http://localhost:8080/metrics
.
If you encounter any issues while using Strimzi, you can get help using:
You can join our regular community meetings:
- Thursday 8:00 AM UTC (every 4 weeks starting from 4th June 2020) - convert to your timezone
- Thursday 4:00 PM UTC (every 4 weeks starting from 18th June 2020) - convert to your timezone
Resources:
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:
Strimzi is licensed under the Apache License, Version 2.0