fix otel http instrumentation span naming #2

Merged
rmcguire merged 2 commits from development into main 2025-08-27 14:32:17 +00:00
Owner
No description provided.
rmcguire added 2 commits 2025-08-27 14:31:42 +00:00
Author
Owner

High-Level Summary:
This pull request refactors the OpenTelemetry instrumentation for HTTP handlers, centralizing span name formatting and route tagging within the otelhttp.NewHandler configuration. It introduces a new regular expression to create more descriptive span names by attempting to include the HTTP method and the matched route pattern. The change simplifies individual handler registrations while enhancing the detail and clarity of generated traces. This improves observability by providing more meaningful span names for various request types.

Detailed Description:

  • pkg/srv/http/http.go: This file introduces a regular expression for parsing HTTP method from patterns, removes a custom OpenTelemetry handler wrapper, and modifies the otelhttp.NewHandler configuration to include a WithSpanNameFormatter for more descriptive span naming and ensures otelhttp.WithRouteTag is applied for prefixed handlers.
**High-Level Summary:** This pull request refactors the OpenTelemetry instrumentation for HTTP handlers, centralizing span name formatting and route tagging within the `otelhttp.NewHandler` configuration. It introduces a new regular expression to create more descriptive span names by attempting to include the HTTP method and the matched route pattern. The change simplifies individual handler registrations while enhancing the detail and clarity of generated traces. This improves observability by providing more meaningful span names for various request types. **Detailed Description:** * **pkg/srv/http/http.go:** This file introduces a regular expression for parsing HTTP method from patterns, removes a custom OpenTelemetry handler wrapper, and modifies the `otelhttp.NewHandler` configuration to include a `WithSpanNameFormatter` for more descriptive span naming and ensures `otelhttp.WithRouteTag` is applied for prefixed handlers.
rmcguire merged commit f5cb3456b1 into main 2025-08-27 14:32:17 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rmcguire/go-app#2
No description provided.