prometheus/web
Mark Adams 77c816b309 Fix pprof endpoints when -web.route-prefix or -web.external-url is used (#3054)
Whenever a route prefix is applied, the router prepends the prefix to
the URL path on the request. For most handlers, this is not an issue
because the request's path is only used for routing and is not actually
needed by the handler itself. However, Prometheus delegates the handling
of the /debug/* endpoints to the http.DefaultServeMux which has it's own
routing logic that depends on the url.Path. As a result, whenever a
prefix is applied, the prefixed URL is passed to the DefaultServeMux
which has no awareness of the prefix and returns a 404.

This change fixes the issue by creating a new serveDebug handler which
routes requests /debug/* requests to appropriate net/http/pprof handler
and removing the net/http/pprof import in cmd/prometheus since it is no
longer necessary.

Fixes #2183.
2017-08-23 00:00:56 +01:00
..
api/v1 Expose current Prometheus config via /status/config 2017-08-13 22:21:18 +02:00
ui Fix 'predefined escaper "html" disallowed in template' in /targets (#3046) (#3050) 2017-08-11 18:31:46 +01:00
federate.go Expose current Prometheus config via /status/config 2017-08-13 22:21:18 +02:00
federate_test.go Expose current Prometheus config via /status/config 2017-08-13 22:21:18 +02:00
web.go Fix pprof endpoints when -web.route-prefix or -web.external-url is used (#3054) 2017-08-23 00:00:56 +01:00
web_test.go 2831 Add Healthy and Ready endpoints 2017-08-07 17:34:04 -03:00