Closed mozai closed 5 years ago
An unsatisfactory workaround:
consul:
exec: { command: wget, args: [ "-q", "-O-", "http://localhost:8500/v1/agent/metrics?format=prometheus" ] }
method: exec
timeout: 1s
Using 'wget' instead of the customary 'curl' because wget seems more popular on the Debian boxes I'm looking after.
I came here looking for the same ability to expose consul prometheus metrics too. Disappointing this isn't possible.
Looks like https://github.com/rrreeeyyy/exporter_proxy might be better suited
Sorry I missed this, So we are escaping the path, this should be easy to fix. I'll take a look
FWIW, the query string passed in from the prom scrap are passed on to the backend, so you if you path to be /v1/agent/metrics, and then have prom add the format=prometheus as a param, that would work (obviously also not ideal)
Would this suffice? https://github.com/QubitProducts/exporter_exporter/pull/19
Goal: I wish to use exporter_exporter to safely export metrics about the local consul daemon. Consul already cooperates with prometheus by provding a prometheus-compatible metrics output if I ask properly.
What I did:
What I expected:
curl http://localhost:9999/proxy?module=consul would return the same data that I get from curl http://localhost:8500/v1/agent/metrics?format=prometheus
What I got:
An error has occurred during metrics gathering: text format parsing error in line 1: invalid metric name
Extra information:
running a strace on exporter_exporter (I don't have tcpdump on this machine) I can see that exporter_exporter is sending an http request "GET /v1/agent/metrics%3Fformat..."