prometheus-nats-exporter icon indicating copy to clipboard operation
prometheus-nats-exporter copied to clipboard

support custom labels to be set through command line flag

Open shohi opened this issue 5 years ago • 4 comments

It's really convenient for devops to monitor and manage different nats clusters on the cloud if custom labels are supported.

There is a related issue (https://github.com/nats-io/prometheus-nats-exporter/issues/86) about this concern, but only prefix is supported.

My suggestion is using another flag to make users set what labels to be added for all metrics, where these labels are all constant labels.

shohi avatar Sep 02 '19 02:09 shohi

Thanks @shohi could you share an example of a custom label to be added to validate? We'd gladly update to make it more convenient :)

wallyqs avatar Sep 02 '19 02:09 wallyqs

Sure. To be simple, label pairs should be provided, e.g.

--custom_labels="site=test,profile=dev"

then the output metrics should contain all these label pairs, like the followings

nats_varz_connections{app="nats-cluster",instance="10.184.140.1:8080",job="kubernetes-pods",site="test", profile="dev", ...}

shohi avatar Sep 02 '19 07:09 shohi

Thanks that is helpful :)

wallyqs avatar Sep 02 '19 15:09 wallyqs

Sounds good to me too.

variadico avatar Sep 13 '19 18:09 variadico