auth
auth copied to clipboard
chore: Add http_route label to HTTP server metrics
What kind of change does this PR introduce?
This PR adds the http_route label to standard HTTP server metrics collected by the otelhttp package. This enables users to collect HTTP metrics per route.
Because WithMetricAttributesFn is only available in newer versions of otelhttp, this commit also upgrades the otelhttp package to v0.63.0. As a result, HTTP request metrics now use the newer http_server_request_ naming convention rather than just http_server_.
What is the current behavior?
Currently, the http_server_duration_milliseconds_bucket metric does not include HTTP route labels. This means HTTP duration metrics are heavily skewed towards fast, frequently accessed API routes such as /user.
What is the new behavior?
There are two changes introduced in this PR:
- The
http_server_duration_milliseconds_bucketmetric is renamed tohttp_server_request_duration_seconds_bucket - The
http_server_request_duration_seconds_bucketmetric has an additional label,http_route, that matches thehttp_routelabel in thehttp_status_codes_totalmetric