prometheus/consul_exporter

Handle Consul errors in a consistent fashion

simonpasquier opened this issue · 3 comments

consul_exporter performs several requests to the Consul API to gather all the metrics
and the error handling isn't quite consistent. We either "swallow" the error, stop the metric collection or fail it (eg "consul_up 0"). The recommended approach is to return a 500 status code.

Full details: https://groups.google.com/d/msg/prometheus-developers/kPuKFo4eiLY/xKADbWwcCAAJ

Hi @simonpasquier, Can I work on this?

@simonpasquier Reading through consul_exporter.go and the docs for failed scrapes it seems like the ${service}_up=0 strategy would be a good fit here.

The latter is better where there’s still some useful metrics you can get even with a failed scrape, such as the HAProxy exporter providing process stats

In either case, there's some work to do here. What do you think?

Right since we already have the consul_up metric, lets use it. Feel free to open a PR.