miekg / caddy-prometheus

Prometheus metrics middleware for caddy
Apache License 2.0
65 stars 26 forks source link

Prometheus version too old for current Grafana? #15

Closed ghost closed 8 years ago

ghost commented 8 years ago

A freshly downloaded Prometheus adds without problem to a freshly downloaded Grafana. However, Prometheus exported by the Caddy plugin does not, with a 404 error that appears to be related to a URL reference in the Prometheus metric that doesn't exist in the version of the plugin.

To replicate, build a Caddy with Prometheus, configure, and run it. Download Grafana and run it; then try to add the Caddy Prometheus as a data source (either proxy or direct results in the same; direct needs more complex configuration because of CORS). "Save and test" will result in an "Unknown error" message; viewing the console shows that Grafana is attempting to access the following URL (proxied through to Prometheus), which is resulting in a 404:

https://HOSTNAME/grafana/api/datasources/proxy/1/api/v1/label/__name__/values

with the result

{data: "404 page not found↵", status: 404, config: Object, statusText: ""}

which appears to be https://github.com/prometheus/prometheus/issues/925.

Is the API interface enabled in caddy-prometheus? Should this work, or is it PEBKAC?

ghost commented 8 years ago

Duh. caddy-prometheus exports metrics; Prometheus must still be run and pull metrics from caddy, and Grafana connects to that.

Sorry for the line noise.