prometheus / consul_exporter

Exporter for Consul metrics
Apache License 2.0
440 stars 167 forks source link

Export service_tags metric for untagged services, too? #90

Closed jeinwag closed 5 years ago

jeinwag commented 5 years ago

Currently, consul_exporter doesn't provide a service_tags metric for untagged services.

Maybe it would be better to export a metric with an empty label in such cases, e.g:

consul_service_tags{service_id="myservice",service_tags=""}

This would make joining and querying easier.

I can implement this but would first like to hear your opinions.

brian-brazil commented 5 years ago

That'd imply that there's a tag with an empty value. You probably want to use some other metric that has a service_id label for this purpose.

jeinwag commented 5 years ago

@brian-brazil Consul tags are just tags, not labels, so they don't have any values. The service_tags label includes all tags of a service joined together, separated by comma, so I believe an empty label would correctly indicate that there are no tags.

brian-brazil commented 5 years ago

It looks like a series per tag to me: https://github.com/prometheus/consul_exporter/blob/master/consul_exporter.go#L312

jeinwag commented 5 years ago

You are corrent, so my original suggestion won't work.