mirror of
https://github.com/umputun/reproxy.git
synced 2025-02-16 18:34:30 +02:00
rename endpoint to /metrics
This commit is contained in:
parent
f16d92b774
commit
4c79c3b239
@ -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)_
|
||||
|
||||
|
@ -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),
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user