Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation to the readme #42

Merged
merged 5 commits into from
Aug 30, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 40 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
mimaison marked this conversation as resolved.
Show resolved Hide resolved

## 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:
mimaison marked this conversation as resolved.
Show resolved Hide resolved
```sh
mvn package
```

## Run
Then ensure the metrics reporter JARs located under `target/metrics-reporter-*/metrics-reporter-*/libs/` are in the classpath.
mimaison marked this conversation as resolved.
Show resolved Hide resolved

## 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`.
mimaison marked this conversation as resolved.
Show resolved Hide resolved

## Getting help

Expand Down