diff --git a/README.md b/README.md index 8d2bc64..40e7c91 100644 --- a/README.md +++ b/README.md @@ -147,7 +147,7 @@ reproxy provides 2 endpoints for this purpose: Optional, can be turned on with `--mgmt.enabled`. Exposes 2 endpoints on `mgmt.listen` address:port: - `GET /routes` - list of all discovered routes -- `GET /prometheus` - returns prometheus metrics (`http_requests_total`, `response_status` and `http_response_time_seconds`) +- `GET /metrics` - returns prometheus metrics (`http_requests_total`, `response_status` and `http_response_time_seconds`) _see also [examples/metrics](https://github.com/umputun/reproxy/examples/metrics)_ diff --git a/app/mgmt/server.go b/app/mgmt/server.go index e259580..5d3d9f9 100644 --- a/app/mgmt/server.go +++ b/app/mgmt/server.go @@ -37,7 +37,7 @@ func (s *Server) Run(ctx context.Context) error { handler := http.NewServeMux() handler.HandleFunc("/routes", s.routesCtrl()) - handler.Handle("/prometheus", promhttp.Handler()) + handler.Handle("/metrics", promhttp.Handler()) h := rest.Wrap(handler, rest.Recoverer(log.Default()), rest.AppInfo("reproxy-mgmt", "umputun", s.Version), diff --git a/app/mgmt/server_test.go b/app/mgmt/server_test.go index 38f9bc5..0bf9256 100644 --- a/app/mgmt/server_test.go +++ b/app/mgmt/server_test.go @@ -94,7 +94,7 @@ func TestServer_controllers(t *testing.T) { assert.Contains(t, fmt.Sprintf("%v", data["srv1"][0]), `ping:http://example.com/ping`, data["srv1"][0]) } { - req, err := http.NewRequest("GET", "http://127.0.0.1:"+strconv.Itoa(port)+"/prometheus", nil) + req, err := http.NewRequest("GET", "http://127.0.0.1:"+strconv.Itoa(port)+"/metrics", nil) require.NoError(t, err) resp, err := client.Do(req) require.NoError(t, err) diff --git a/examples/metrics/prometheus/prometheus.yml b/examples/metrics/prometheus/prometheus.yml index 0d7000e..7db9c2b 100644 --- a/examples/metrics/prometheus/prometheus.yml +++ b/examples/metrics/prometheus/prometheus.yml @@ -7,7 +7,7 @@ scrape_configs: static_configs: - targets: ['localhost:9090'] - job_name: reproxy - metrics_path: /prometheus + metrics_path: /metrics static_configs: - targets: - reproxy:8081