chore: Add http_route label to HTTP server metrics#2330
Merged
jnschaeffer merged 5 commits intomasterfrom Jan 28, 2026
Merged
Conversation
Pull Request Test Coverage Report for Build 21439568499Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
26c6751 to
b810990
Compare
This commit adds the http_route label to HTTP server metrics, such as `http_server_request_duration_seconds_bucket`. This enables users to collect standard HTTP metrics per route rather than across all of Auth. Because `WithMetricAttributesFn` is only available in newer versions of otelhttp, this commit also upgrades the otelhttp package to v0.64.0. As a result, HTTP request metrics now use the newer `http_server_request_` naming convention rather than just `http_server_`.
This commit updates the semconv package to v1.38.0.
As described.
b810990 to
2aea070
Compare
cstockton
approved these changes
Jan 27, 2026
As described.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
This PR adds the
http_routelabel to standard HTTP server metrics collected by the otelhttp package. This enables users to collect HTTP metrics per route.Because
WithMetricAttributesFnis 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 newerhttp_server_request_naming convention rather than justhttp_server_.What is the current behavior?
Currently, the
http_server_duration_milliseconds_bucketmetric 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:
http_server_duration_milliseconds_bucketmetric is renamed tohttp_server_request_duration_seconds_buckethttp_server_request_duration_seconds_bucketmetric has an additional label,http_route, that matches thehttp_routelabel in thehttp_status_codes_totalmetric