Skip to content

Commit 8d792ec

Browse files
committed
Update README.md
1 parent a4d2ab1 commit 8d792ec

File tree

1 file changed

+30
-8
lines changed

1 file changed

+30
-8
lines changed

README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,42 @@ This client is available as well in [docker hub](https://hub.docker.com/r/omarsm
4141

4242
## Usage
4343
java -jar kafka-consumer-lag-monitoring.jar -h
44-
Usage: <main class> [-hV] -b=<kafkaBootstrapServers> -c=<kafkaConsumerClients>
44+
Usage: <main class> [-hV] [-b=<kafkaBootstrapServers>]
45+
-c=<kafkaConsumerClients> [-f=<kafkaPropertiesFile>]
4546
[-i=<pollInterval>] [-m=<clientMode>] [-p=<httpPort>]
4647
-b, --bootstrap.servers=<kafkaBootstrapServers>
47-
A list of host/port pairs to use for establishing the
48-
initial connection to the Kafka cluster
48+
A list of host/port pairs to use for establishing
49+
the initial connection to the Kafka cluster
4950
-c, --consumer.groups=<kafkaConsumerClients>
5051
A list of Kafka consumer groups or list ending with
51-
(*) to fetch all consumers with matching pattern, e.g: 'test_v*'
52+
star (*) to fetch all consumers with matching
53+
pattern, e.g: 'test_v*'
54+
-f, --kafka.properties.file=<kafkaPropertiesFile>
55+
Optional. Properties file for Kafka AdminClient
56+
configurations, this is the typical Kafka
57+
properties file that can be used in the
58+
AdminClient. For more info, please take a look at
59+
Kafka AdminClient configurations documentation.
5260
-h, --help Show this help message and exit.
5361
-i, --poll.interval=<pollInterval>
54-
Interval delay in ms to that refreshes the client lag
55-
metrics, default to 2000ms
62+
Interval delay in ms to that refreshes the client
63+
lag metrics, default to 2000ms
5664
-m, --mode=<clientMode> Mode to run client, possible values 'console' or
5765
'prometheus', default to 'console'
58-
-p, --http.port=<httpPort> Http port that is used to expose metrics in case
66+
-p, -http.port=<httpPort> Http port that is used to expose metrics in case
5967
prometheus mode is selected, default to 9000
6068
-V, --version Print version information and exit.
69+
70+
#### New in version 0.0.6:
71+
Now the client has the ability to accept a properties file with the admin client/consumer configuration that you typically use with Kafka Clients. This option can be accessible through the flag `-f`. example:
6172

73+
java -jar kafka-consumer-lag-monitoring.jar -f my/path/file.properties -c "my_awesome_consumer_group_01" -m "prometheus" -i 5000
74+
75+
To learn more about the configuration that you can use here, please refer the following documentations:
76+
77+
Kafka AdminClient configs: https://kafka.apache.org/documentation/#adminclientconfigs
78+
79+
Kafka Consumer configs: https://kafka.apache.org/documentation/#consumerconfigs
6280
### Console Mode
6381
This mode will print the consumer lag per partition and the total lag among all partitions and continuously refreshing the metrics per the value of `--poll.interval` startup parameter. Example output:
6482

@@ -99,7 +117,11 @@ This mode will print the consumer lag per partition and the total lag among all
99117
100118
### Prometheus Mode
101119
In this mode, the tool will start an http server on a port that being set in `--http.port` startup parameter and it will expose an endpoint that is reachable via `localhost:<http.port>/metrics` or `localhost:<http.port>/prometheus`
102-
so prometheus server can scrap these metrics and expose them for example to grafana. It will expose the following metrics:
120+
so prometheus server can scrap these metrics and expose them for example to grafana.
121+
122+
java -jar kafka-consumer-lag-monitoring.jar -b kafka1:9092,kafka2:9092,kafka3:9092 -c "my_awesome_consumer_group_01" -m "prometheus" -i 5000
123+
124+
It will expose the following metrics:
103125
##### `kafka_consumer_group_offset{group, topic, partition}`
104126
The latest committed offset of a consumer group in a given partition of a topic.
105127

0 commit comments

Comments
 (0)