-
-
Save MihaZupan/c01a2689f5ec85e95682830fb0df8e17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DistributedContextPropagator.Current = new SkipHttpClientActivityPropagator(); | |
public sealed class SkipHttpClientActivityPropagator : DistributedContextPropagator | |
{ | |
private readonly DistributedContextPropagator _originalPropagator = Current; | |
public override IReadOnlyCollection<string> Fields => _originalPropagator.Fields; | |
public override void Inject(Activity? activity, object? carrier, PropagatorSetterCallback? setter) | |
{ | |
if (activity?.OperationName == "System.Net.Http.HttpRequestOut") | |
{ | |
activity = activity.Parent; | |
} | |
_originalPropagator.Inject(activity, carrier, setter); | |
} | |
public override void ExtractTraceIdAndState(object? carrier, PropagatorGetterCallback? getter, out string? traceId, out string? traceState) => | |
_originalPropagator.ExtractTraceIdAndState(carrier, getter, out traceId, out traceState); | |
public override IEnumerable<KeyValuePair<string, string?>>? ExtractBaggage(object? carrier, PropagatorGetterCallback? getter) => | |
_originalPropagator.ExtractBaggage(carrier, getter); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@wkoeter would you be able to provide more details ?
What do you mean that this workaround caused application map incomplete ?
I would appreciate your expertise.