strimzi / strimzi-kafka-bridge

An HTTP bridge for Apache Kafka®
Apache License 2.0
286 stars 119 forks source link

Documenting the usage of the metrics-reporter for exporting Kafka clients related metrics #932

Open ppatierno opened 1 month ago

ppatierno commented 1 month ago

The metrics-reporter is going to have its first release and, despite there are some information about how to configure it on Kafka and related clients on its README, we should document properly how to do that on the bridge by adding some content in the "Configuring metrics" section. In particular, within the application.properties file of the bridge, it's possible to configure the metrics exporter selectively on each Kafka client (admin, producer, consumer) or on all of them. In the first case, the metrics reporter configuration needs to be "duplicated" for each client in the following way:

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

The above configuration uses the clients prefixes kafka.admin, kafka.producer and kafka.consumer to do so. In the second case, it's really easy to set the metrics reporter configuration in the common kafka. section of the bridge properties:

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

The above will be applied on all the Kafka clients used within the bridge.