-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow specifying a context propagator on SocketsHttpHandler #55556
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsBackground and MotivationWe approved the Propagator APIs in #50658, which we are consuming in the The approved API includes a Some advanced cases require more granular control over which propagator is used - for example only enabling propagation for a given handler/destination/library. Proposed APInamespace System.Net.Http
{
public sealed class SocketsHttpHandler
{
public DistributedContextPropagator? ActivityHeaderPropagator { get; set; }
}
}
Usage Examplesusing var handler = new SocketsHttpHandler
{
ActivityHeaderPropagator = DistributedContextPropagator.CreatePassThroughPropagator()
}; Alternative DesignsDifferent names for the property, e.g.
|
Update: We changed it to plural -- |
namespace System.Net.Http
{
public sealed class SocketsHttpHandler
{
public DistributedContextPropagator? ActivityHeadersPropagator { get; set; }
}
} |
Background and Motivation
We approved the Propagator APIs in #50658, which we are consuming in the
HttpClient
stack.The approved API includes a
global static
propertyCurrent
.Some advanced cases require more granular control over which propagator is used - for example only enabling propagation for a given handler/destination/library.
Unit testing of applications/libraries is also difficult without resorting to hacks like RemoteExecutor / writing a custom composite propagator / disabling test parallelization.
To address these scenarios, we propose exposing a property on
SocketsHttpHandler
to control which propagator is used.Proposed API
null
means no propagation.Usage Examples
Alternative Designs
Different names for the property, e.g.
DistributedContextPropagator? DistributedContextPropagator { get; set; }
SocketsHttpHandler
to hopefully make it easier for users to understandThe text was updated successfully, but these errors were encountered: