From 050993637458cd848ce1802fc0fdde4313314dcc Mon Sep 17 00:00:00 2001 From: Mickael Maison Date: Thu, 29 Aug 2024 17:22:05 +0200 Subject: [PATCH 1/5] Add documentation to the readme Signed-off-by: Mickael Maison --- README.md | 49 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5c87c0b..38b046d 100644 --- a/README.md +++ b/README.md @@ -3,35 +3,66 @@ # Strimzi Prometheus Metrics Reporter -This repository contains the _Prometheus Metrics Reporter for Apache Kafka server and client components_ as proposed in [Strimzi Proposal #64](https://github.com/strimzi/proposals/blob/main/064-prometheus-metrics-reporter.md). -The implementation is currently still in progress. +Apache Kafka® brokers and clients expose metrics to monitor them. There is a pluggable reporter interface that allows exporting these metrics to monitoring systems. Apache Kafka has a built-in reporter for JMX. -## Build +This repository contains a reporter implementation for Prometheus as proposed in [Strimzi Proposal #64](https://github.com/strimzi/proposals/blob/main/064-prometheus-metrics-reporter.md). -```shell +> [!WARNING] +> The project is currently in early access. + +## Installing + +There is not a release yet, so you need to first build the reporter: +```sh mvn package ``` -## Run +Then ensure 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.enabled`: 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 -Add the following to your broker configuration: +To use the reporter with Kafka brokers, add the following to your broker configuration: ```properties metric.reporters=io.strimzi.kafka.metrics.KafkaPrometheusMetricsReporter kafka.metrics.reporters=io.strimzi.kafka.metrics.YammerPrometheusMetricsReporter +auto.include.jmx.reporter=false ``` ### Kafka Clients -Add the following to your client configuration: +To use the reporter with Kafka producers, consumers or admin clients, add the following to your client configuration: +```properties +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: ```properties 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 ``` -## Access Metrics +## Accessing Metrics -Metrics are exposed on `http://localhost:8080/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 From 37ef3207c2309fae775f9bbb2021deffe6f08b1e Mon Sep 17 00:00:00 2001 From: Mickael Maison Date: Fri, 30 Aug 2024 14:56:13 +0200 Subject: [PATCH 2/5] Update README.md Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Mickael Maison --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38b046d..675e56d 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # Strimzi Prometheus Metrics Reporter -Apache Kafka® brokers and clients expose metrics to monitor them. There is a pluggable reporter interface that allows exporting these metrics to monitoring systems. Apache Kafka has a built-in reporter for JMX. +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](https://github.com/strimzi/proposals/blob/main/064-prometheus-metrics-reporter.md). From 8e76122e3e731498ab8ec58773fe83e7d20dc125 Mon Sep 17 00:00:00 2001 From: Mickael Maison Date: Fri, 30 Aug 2024 14:56:39 +0200 Subject: [PATCH 3/5] Update README.md Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Mickael Maison --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 675e56d..418b46f 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This repository contains a reporter implementation for Prometheus as proposed in ## Installing -There is not a release yet, so you need to first build the reporter: +Since there isn't a release available yet, you'll need to build the reporter first: ```sh mvn package ``` From 47af22c7e7edb68579d4d8c6ad6de091ada90b14 Mon Sep 17 00:00:00 2001 From: Mickael Maison Date: Fri, 30 Aug 2024 14:57:03 +0200 Subject: [PATCH 4/5] Update README.md Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Mickael Maison --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 418b46f..cced6ce 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Since there isn't a release available yet, you'll need to build the reporter fir mvn package ``` -Then ensure the metrics reporter JARs located under `target/metrics-reporter-*/metrics-reporter-*/libs/` are in the classpath. +After building, make sure the metrics reporter JARs located under `target/metrics-reporter-*/metrics-reporter-*/libs/` are in the classpath. ## Configuring From bededa5dd6e72d6905f5a2503b195023fe0ed7d6 Mon Sep 17 00:00:00 2001 From: Mickael Maison Date: Fri, 30 Aug 2024 14:57:14 +0200 Subject: [PATCH 5/5] Update README.md Co-authored-by: PaulRMellor <47596553+PaulRMellor@users.noreply.github.com> Signed-off-by: Mickael Maison --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cced6ce..50e7e0b 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ 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`. +Metrics are exposed on the configured listener on the `GET /metrics` endpoint. For example, by default this is `http://localhost:8080/metrics`. ## Getting help