You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
normalize: true # to normalize http status code (2xx, 3xx, ...)
497
+
normalize:
498
+
request_path: true # to normalize http request path, disabled by default
499
+
response_status: true # to normalize http response status code (2xx, 3xx, ...), disabled by default
496
500
```
497
501
498
502
For example, after calling `[GET] /example`, the [fxcore](https://github.com/ankorstore/yokai/tree/main/fxcore) HTTP server will expose in the configured metrics endpoint:
@@ -501,24 +505,34 @@ For example, after calling `[GET] /example`, the [fxcore](https://github.com/ank
501
505
# ...
502
506
# HELP app_httpserver_request_duration_seconds Time spent processing HTTP requests
503
507
# TYPE app_httpserver_request_duration_seconds histogram
Regarding metrics normalization, if you register for example a handler:
527
+
528
+
- with `fxhttpserver.AsHandler("GET", "/foo/bar/:id", handler.NewExampleHandler)`
529
+
- that returns `200` as response code
530
+
531
+
And receive requests on `/foo/bar/baz?page=1`:
532
+
533
+
- if `modules.http.server.metrics.normalize.request_path=true`, the metrics `path` label will be `/foo/bar/:id`, otherwise it'll be `/foo/bar/baz?page=1`
534
+
- if `modules.http.server.metrics.normalize.response_status=true`, the metrics `status` label will be `2xx`, otherwise it'll be `200`
535
+
522
536
## Testing
523
537
524
538
This module provides the possibility to perform functional testing, by calling your application endpoints from your tests.
0 commit comments