statsd_exporter icon indicating copy to clipboard operation
statsd_exporter copied to clipboard

Version information printed to stderr

Open don-philipe opened this issue 1 year ago • 2 comments

Hello,

when calling statsd_exporter --version the output is printed to stderr instead of stdout. This can be verified by:

statsd_exporter --version 2> /dev/null

which prints nothing on console.

I guess that's not intended? It's kinda annoying when using that command with ansible. Other exporters like node_exporter print version information to stdout. I would love to see this behaviour for statsd_exporter as well :pray:

statsd_exporter version: 0.22.8

don-philipe avatar Sep 18 '22 19:09 don-philipe

Indeed, if the user explicitly asks for information it should go to stdout, and we should be in line with the other official exporters. PRs welcome!

matthiasr avatar Sep 21 '22 09:09 matthiasr

Help text is printed to stderr as well.

I opened #469 that will change the default behavior of the kingpin lib. That lib will print to stderr by default. To output text to stderr another writer needs to be explicitly set (like it is done at node_exporter here).

don-philipe avatar Sep 21 '22 21:09 don-philipe