Skip to content

Conversation

@jnschaeffer
Copy link
Contributor

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_bucket metric is renamed to http_server_request_duration_seconds_bucket
  • The http_server_request_duration_seconds_bucket metric has an additional label, http_route, that matches the http_route label in the http_status_codes_total metric

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.63.0. As a result, HTTP request metrics now use the newer
`http_server_request_` naming convention rather than just
`http_server_`.
@jnschaeffer jnschaeffer requested a review from a team as a code owner January 15, 2026 03:14
This commit updates the semconv package to v1.37.0.
@coveralls
Copy link

coveralls commented Jan 15, 2026

Pull Request Test Coverage Report for Build 21020736698

Details

  • 28 of 30 (93.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 68.613%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/observability/request-tracing.go 28 30 93.33%
Totals Coverage Status
Change from base Build 20948007489: 0.05%
Covered Lines: 14701
Relevant Lines: 21426

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants