Description
Current State
Currently, users depend on the instrumentation library provided by the OpenTelemetry .NET repository to enable the enrichment of activities created during HttpClient requests, following the OpenTelemetry specification. This instrumentation library enriches activities by subscribing to DiagnosticSource events generated by HttpClient. However, this approach has certain limitation and performance overhead of Diagnostic Source listeners and reflection.
Feature Request
We are requesting the addition of native instrumentation support for HttpClient in .NET 9.0
. This enhancement will complement the out-of-the-box OTel metrics instrumentation introduced in .NET 8.0
.
Design Considerations
When designing this feature, we need to consider the following aspects:
-
Support for Enrichment and Filtering of Spans: Ensure that the native instrumentation supports the enrichment and filtering of HttpClient spans.
-
Custom Propagators: Address the differences in API between propagators in OpenTelemetry and the
DistributedContextPropagator
. Determine how custom propagators should be handled in this context.