mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
e8e1d6e9f0
## About the changes Some of our metrics are not labeled correctly, one example is `<base-path>/api/frontend/client/metrics` is labeled as `/client/metrics`. We can see that in internal-backstage/prometheus: ![image](https://github.com/Unleash/unleash/assets/455064/0d8f1f40-8b5b-49d4-8a88-70b523e9be09) This issue affects all endpoints that fail to validate the request body. Also, endpoints that are rejected by the authorization-middleware or the api-token-middleware are reported as `(hidden)`. To gain more insights on our api usage but being protective of metrics cardinality we're prefixing `(hidden)` with some well known base urls: https://github.com/Unleash/unleash/pull/6400/files#diff-1ed998ca46ffc97c9c0d5d400bfd982dbffdb3004b78a230a8a38e7644eee9b6R17-R33 ## How to reproduce: Make an invalid call to metrics (e.g. stop set to null), then check /internal-backstage/prometheus and find the 400 error. Expected to be at `path="/api/client/metrics"` but will have `path=""`: ```shell curl -H"Authorization: *:development.unleash-insecure-client-api-token" -H'Content-type: application/json' localhost:4242/api/client/metrics -d '{ "appName": "bash-test", "instanceId": "application-name-dacb1234", "environment": "development", "bucket": { "start": "2023-07-27T11:23:44Z", "stop": null, "toggles": { "myCoolToggle": { "yes": 25, "no": 42, "variants": { "blue": 6, "green": 15, "red": 46 } }, "myOtherToggle": { "yes": 0, "no": 100 } } } }' ``` |
||
---|---|---|
.. | ||
api-token-middleware.test.ts | ||
api-token-middleware.ts | ||
authorization-middleware.ts | ||
catch-all-error-handler.ts | ||
conditional-middleware.ts | ||
content_type_checker.test.ts | ||
content_type_checker.ts | ||
cors-origin-middleware.test.ts | ||
cors-origin-middleware.ts | ||
demo-authentication.ts | ||
index.ts | ||
no-authentication.test.ts | ||
no-authentication.ts | ||
oss-authentication.test.ts | ||
oss-authentication.ts | ||
pat-middleware.test.ts | ||
pat-middleware.ts | ||
rbac-middleware.test.ts | ||
rbac-middleware.ts | ||
request-logger.ts | ||
response-time-metrics.test.ts | ||
response-time-metrics.ts | ||
secure-headers.ts | ||
session-db.ts | ||
unless-middleware.ts |