Skip to content

Expose Apache Kafka consumer group metrics for Prometheus

License

Notifications You must be signed in to change notification settings

mbode/kafka_lag_exporter

Repository files navigation

This project is in a very early phase. For a more production-ready exporter refer to e.g. danielqsj/kafka_exporter.


kafka_lag_exporter

Build Status codecov Github release Docker Hub

Usage

kafka_lag_exporter [-hV] [-i=<intervalMs>] -k=<kafkaConnectString>
                          [-l=<logLevel>] [-p=<port>] [-r=<maxRetries>]
                          [-t=<timeoutMs>]
Report Kafka consumer group lags to Prometheus.
  -h, --help          Show this help message and exit.
  -i, --interval=<intervalMs>
                      Report interval (in milliseconds) used between querying Kafka
                        API for new data, defaults to 500. Note: it can take up to
                        this timespan plus the configured scrape interval for
                        information to be available in Prometheus.
  -k, --kafka=<kafkaConnectString>
                      Connection string that is used to connect to Kafka cluster, e.
                        g. localhost:9092.
  -l, --loglevel=<logLevel>
                      Log level, valid values: ERROR|WARN|INFO|DEBUG|TRACE. Defaults
                        to WARN.
  -p, --port=<port>   Port the Prometheus HTTP endpoint is exposed to, defaults to
                        9526.
  -r, --retries=<maxRetries>
                      Max retries when connection to Kafka cluster is lost
                        intermittently, defaults to 120.
  -t, --timeout=<timeoutMs>
                      Timeout (in milliseconds) used when connecting to Kafka
                        cluster, defaults to 5000.
  -V, --version       Print version information and exit.

Metrics

name labels
kafka_high_watermark partition , topic
kafka_offset consumer_group, partition , topic
kafka_lag consumer_group, partition , topic

Development

typical tasks:

  • verify: ./gradlew check
  • list outdated dependenices: ./gradlew dependencyUpdates
  • update gradle: ./gradlew wrapper --gradle-version=<x.y> (twice)

About

Expose Apache Kafka consumer group metrics for Prometheus

Resources

License

Stars

Watchers

Forks

Packages

No packages published