Crates.io | kommitted |
lib.rs | kommitted |
version | 0.3.1 |
source | src |
created_at | 2023-08-22 08:33:50.120433 |
updated_at | 2024-05-20 08:36:21.489098 |
description | Measure Kafka Consumer Offset Lag and Time Lag |
homepage | https://github.com/kafkesc/kommitted |
repository | https://github.com/kafkesc/kommitted |
max_upload_size | |
id | 950806 |
size | 219,364 |
Kommitted is a service to measure the Lag (i.e. Latency) of Kafka consumers.
It works with all consumers that commit their offsets into Kafka
(i.e. the standard way),
as it consumes the internal __consumer_offsets
topic.
Metrics are exported following the Prometheus Exposition formats.
Please see DESIGN.md for details about the overall architecture, dependencies and other details.
/metrics
endpointAll of this comes based on:
Please see the complete list of exposed Metrics, for further details.
To install kommitted
, you need to compile it yourself, or use the Docker image.
If you have the Rust Toolchain already setup, then just run:
$ cargo install kommitted
Kommitted is now available as a Docker Image: kafkesc/kommitted
on the Docker Hub registry. Both linux/amd64
and linux/arm64
images are available, based on Debian slim images.
The ENTRYPOINT
is the kommitted
binary itself, so you can just pass arguments to the container execution.
Kommitted supports compact (-h
) and extended (--help
) usage instructions.
Use the former for a quick look up; use the latter to better understand what
each argument can do.
Usage: kommitted [OPTIONS] --brokers <BOOTSTRAP_BROKERS>
Options:
-b, --brokers <BOOTSTRAP_BROKERS>
Initial Kafka Brokers to connect to (format: 'HOST:PORT,...')
--client-id <CLIENT_ID>
Client identifier used by the internal Kafka (Admin) Client [default: kommitted]
--kafka-conf <CONF_KEY:CONF_VAL>
Additional configuration used by the internal Kafka (Admin) Client (format: 'CONF_KEY:CONF_VAL').
--cluster-id <CLUSTER_ID>
Override identifier of the monitored Kafka Cluster
--history <SIZE_PER_PARTITION>
For each Topic Partition, how much history of offsets to track in memory. [default: 3600]
--history-ready-at <FULLNESS_PERCENT_PER_PARTITION>
How full `--history` of Topic Partition offsets has to be (on average) for service to be ready. [default: 0.3]
--host <HOST>
Host address to listen on for HTTP requests. [default: 127.0.0.1]
--port <PORT>
Port to listen on for HTTP requests. [default: 6564]
-v, --verbose...
Verbose logging.
-q, --quiet...
Quiet logging.
-h, --help
Print help (see more with '--help')
-V, --version
Print version
Usage: kommitted [OPTIONS] --brokers <BOOTSTRAP_BROKERS>
Options:
-b, --brokers <BOOTSTRAP_BROKERS>
Initial Kafka Brokers to connect to (format: 'HOST:PORT,...').
Equivalent to '--config=bootstrap.servers:host:port,...'.
--client-id <CLIENT_ID>
Client identifier used by the internal Kafka (Admin) Client.
Equivalent to '--config=client.id:my-client-id'.
[default: kommitted]
--kafka-conf <CONF_KEY:CONF_VAL>
Additional configuration used by the internal Kafka (Admin) Client (format: 'CONF_KEY:CONF_VAL').
To set multiple configurations keys, use this argument multiple times.
See: https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md.
--cluster-id <CLUSTER_ID>
Override identifier of the monitored Kafka Cluster.
If set, it replaces the value `cluster.id` from the Brokers' configuration. This can be useful when `cluster.id` is not actually
set.
--history <SIZE_PER_PARTITION>
For each Topic Partition, how much history of offsets to track in memory.
Offsets data points are collected every 500ms, on average: so, on average,
30 minutes of data points is 3600 offsets, assuming partition offsets are
regularly produced to.
Once this limit is reached, the oldest data points are discarded, realising
a "moving window" of offsets history.
[default: 3600]
--history-ready-at <FULLNESS_PERCENT_PER_PARTITION>
How full `--history` of Topic Partition offsets has to be (on average) for service to be ready.
This value will be compared with the average "fullness" of each data structure containing
the offsets of Topic Partitions. Once passed, the service can start serving metrics.
The value must be a percentage in the range `[0.0%, 100.0%]`.
[default: 0.3]
--host <HOST>
Host address to listen on for HTTP requests.
Supports both IPv4 and IPv6 addresses.
[default: 127.0.0.1]
--port <PORT>
Port to listen on for HTTP requests.
[default: 6564]
-v, --verbose...
Verbose logging.
* none = 'WARN'
* '-v' = 'INFO'
* '-vv' = 'DEBUG'
* '-vvv' = 'TRACE'
Alternatively, set environment variable 'KOMMITTED_LOG=(ERROR|WARN|INFO|DEBUG|TRACE|OFF)'.
-q, --quiet...
Quiet logging.
* none = 'WARN'
* '-q' = 'ERROR'
* '-qq' = 'OFF'
Alternatively, set environment variable 'KOMMITTED_LOG=(ERROR|WARN|INFO|DEBUG|TRACE|OFF)'.
-h, --help
Print help (see a summary with '-h')
-V, --version
Print version
SASL_SSL
$ kommitted \
--brokers {{ BOOTSTRAP_BROKERS or BROKER_ENDPOINT }} \
--config security.protocol:SASL_SSL \
--config sasl.mechanisms=PLAIN \
--config sasl.username:{{ USERNAME or API_KEY }} \
--config sasl.password:{{ PASSWORD or API_SECRET }} \
...
Kommitted follows the long tradition of -v/-q
to control the verbosity of it's logging:
Arguments | Log verbosity level | Default |
---|---|---|
-qq... |
OFF |
|
-q |
ERROR |
|
none | WARN |
x |
-v |
INFO |
|
-vv |
DEBUG |
|
-vvv... |
TRACE |
It uses log and env_logger,
and so logging can be configured and fine-tuned using the Environment Variable KOMMITTED_LOG
.
Please take a look at env_logger doc
for more details.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.