mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-09-30 11:41:19 +02:00
Add Prometheus metrics endpoint
Add the Prometheus http.Handler to serve metrics at MetricsPath ("/metrics"
by default). This allows Prometheus to scrape metrics from OAuth2 Proxy.
Add a new middleware NewRequestMetrics and attach it to the preAuth
chain. This will collect metrics on all requests made to OAuth2 Proxy
Collapse some calls to Prinf() and os.Exit(1) to Fatalf as they are
equivalent. main() has a strict 50 lines limit so brevity in these
calls appreciated
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# HELP oauth2_proxy_requests_total Total number of requests by HTTP status code.
|
||||
# TYPE oauth2_proxy_requests_total counter
|
||||
oauth2_proxy_requests_total{code="404"} 1
|
||||
@@ -0,0 +1,3 @@
|
||||
# HELP oauth2_proxy_requests_total Total number of requests by HTTP status code.
|
||||
# TYPE oauth2_proxy_requests_total counter
|
||||
oauth2_proxy_requests_total{code="200"} 1
|
||||
Reference in New Issue
Block a user