prometheus / consul_exporter

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

[question] Why use this along with telemetry? #136

Open nicholasamorim opened 5 years ago

nicholasamorim commented 5 years ago

What's the difference between using Consul's own Telemetry to export prometheus metrics and using this exporter?

I can seemingly see at least one (number of peers.. as Consul only exposes that on /status/peers) - but what's the difference? To export things that the telemetry doesn't?

It's just not clear from the documentation why one should pick this (or even if they should work side-by-side). At first I thought maybe this was an old project before Consul had prometheus support, but that's not the case.

simonpasquier commented 5 years ago

That's a good question and worth documenting indeed!

Historically consul_exporter predates the native Prometheus support of Consul but it isn't really the reason why this exporter exists. From what I can tell, the Consul agent's metrics endpoint exposes the internal state of the agent like HTTP reponse times, Serf, memberlist and process metrics. On the other end, consul_exporter gathers metrics from what is stored in Consul: services, checks and so on.

Another important difference is that consul_exporter strives to comply with the Prometheus instrumentation & naming practices while Consul uses a generic instrumentation library which may not be always aligned with the Prometheus way.

nicholasamorim commented 5 years ago

That makes sense and I have found this exporter to export fairly useful and very simple to understand metrics.

I do think it's worth documenting it.

Now here's another one: Do you bother using both?

The official telemetry seems useful to monitor how network is impacting Consul (how many leader elections have happened, etc) but other than that, the metrics seems mostly very very advanced while this exporter seems more grounded on the real-word interests one would have when monitoring Consul.