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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
High-Level Summary:
This pull request refactors the OpenTelemetry instrumentation for HTTP handlers, centralizing span name formatting and route tagging within the
otelhttp.NewHandlerconfiguration. 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:
otelhttp.NewHandlerconfiguration to include aWithSpanNameFormatterfor more descriptive span naming and ensuresotelhttp.WithRouteTagis applied for prefixed handlers.