hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.37k stars 4.42k forks source link

Consul emits extra dummy metrics to Prometheus which always have zero values #13495

Open maxb opened 2 years ago

maxb commented 2 years ago

Example

# HELP consul_consul_state_services Measures the current number of unique services registered with Consul, based on service name. It is only emitted by Consul servers. Added in v1.9.0.
# TYPE consul_consul_state_services gauge
consul_consul_state_services 0
consul_consul_state_services{datacenter="dc1"} 1

Explanation

The real values for consul_consul_state_services are emitted with a datacenter label.

However there is an extra metric with an empty label set, which always has value zero, and is never updated.

It would be nice to remove this metric, however the underlying go-metrics library in use, does not allow this, without also sacrificing the help message. I have opened https://github.com/armon/go-metrics/issues/136 about this.

The primary purpose of opening this Consul issue in the short term, is to:

Amier3 commented 2 years ago

Thanks for making this issue as well, this is definitely worth documenting. This'll require some discussion along with #13494, but I wanted comment on each individual issue to acknowledge that we do see these and will talk about a way to address them ( possibly together ).

jakubgs commented 2 years ago

Just noticed this issue when I tried to enable metrics for my cluster. The result is that I see zeroes in the queries:

image