danielqsj / kafka_exporter

Kafka exporter for Prometheus
Apache License 2.0
2.18k stars 610 forks source link

Error using boolean flags #366

Closed orlandoburli closed 1 year ago

orlandoburli commented 1 year ago

Scenario

All scenario I try to pass a boolean argument, like use.consumelag.zookeeper, returns this error:

2023-02-02 13:48:54 kafka_exporter: error: unexpected true, try --help

I've tried to run with those parameters:

--kafka.server=localhost:9092 --verbosity=5 --zookeeper.server=localhost:2128 --use.consumelag.zookeeper=true

This error happens when you try to run as a docker image or a binary.

Also I tried to run the source code, and it looks like it's an error with the kingpin library. The error happens on this code line.

Another important information: I'm running on a MacOS with M1 processor, not sure if it's related.

orlandoburli commented 1 year ago

Update: it was not a bug, it's just not that clear in the documentation. Maybe I can update the README to make it more clear.

The proper way to use this variable is just:

--kafka.server=localhost:9092 --verbosity=5 --zookeeper.server=localhost:2128 --use.consumelag.zookeeper