Sign inSign up

callstats/prometheus_kafka_probe_py

By callstats

•Updated over 4 years ago

A kafka producer offset probe which can be scraped by prometheus.

Image
0

10K+

callstats/prometheus_kafka_probe_py repository overview

⁠Kafka offset probe with Prometheus scraper

This application exposes the (topic, partition, offset) triple via HTTP endpoint /internal/metrics.

⁠Exposed metrics

MetricTypeDescription
kafka_offsetGaugelatest available Offset
cg_kafka_offsetGaugeconsumer group offsets

Following labels are added

⁠Labels
LabelDescription
service Always broker
topicName of the topic
partition  Partition number
consumergroupname of the consumer group

Other labels (e.g. environment, cluster_name, etc) should be added at higher level

⁠Configuration

Application reads configuration from following environment variables

NameDescription
PORTHTTP port to listen to
KAFKAHOSTSComma separated list of kafka broker hosts
TOPICSComma separated list of topics to scrape
CONSUMERGROUPSa json representation the topic and consumer group names. e.g. '{"topic_1": ["cg1"], "topic_2", ["cg1", "cg2"]}'

Tag summary

Content type

Image

Digest

Size

336.8 MB

Last updated

over 4 years ago

docker pull callstats/prometheus_kafka_probe_py