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:
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?