-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Propagators Support #54465
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
Propagators Support #54465
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -253,7 +253,25 @@ public sealed class ActivityListener : IDisposable | |
| public System.Diagnostics.SampleActivity<string>? SampleUsingParentId { get { throw null; } set { throw null; } } | ||
| public System.Diagnostics.SampleActivity<ActivityContext>? Sample { get { throw null; } set { throw null; } } | ||
| public void Dispose() { throw null; } | ||
| } | ||
| } | ||
|
|
||
| public delegate bool PropagatorGetterCallback(object carrier, string fieldName, out string? value); | ||
|
|
||
| public abstract class TextMapPropagator | ||
| { | ||
| public abstract System.Collections.Generic.IEnumerable<string> Fields { get; } | ||
tarekgh marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public abstract bool Inject(System.Diagnostics.Activity activity, object carrier, Action<object, string, string> setter); | ||
| public abstract bool Inject(System.Diagnostics.ActivityContext context, object carrier, Action<object, string, string> setter); | ||
| public abstract bool Inject(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>> baggage, object carrier, Action<object, string, string> setter); | ||
| public abstract bool Extract(object carrier, string fieldName, PropagatorGetterCallback getter, out string? value); | ||
|
||
| public abstract bool Extract(object carrier, PropagatorGetterCallback getter, out System.Diagnostics.ActivityContext context); | ||
| public abstract bool Extract(object carrier, PropagatorGetterCallback getter, out System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>>? baggage); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overriding 6 methods seems like a lot if a simple use case might be public sealed class SkipOneActivityLayerPropagator : TextMapPropagator
{
public override bool Inject(Activity activity, object carrier, Action<object, string, string> setter) =>
TextMapPropagator.CreateW3CPropagator().Inject(activity.Parent, carrier, setter);
}Maybe this isn't a problem if it won't be common for users to implement these? As a side note, such a propagator is how one could solve #41072.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if we need to force the default implementation here as whoever subclass TextMapPropagator should be aware about this implementation to decide if need to override it or not. |
||
| public static TextMapPropagator DefaultPropagator { get; set; } | ||
| public static TextMapPropagator CreateLegacyPropagator() { throw null; } | ||
| public static TextMapPropagator CreatePassThroughPropagator() { throw null; } | ||
| public static TextMapPropagator CreateOutputSuppressionPropagator() { throw null; } | ||
| public static TextMapPropagator CreateW3CPropagator() { throw null; } | ||
|
||
| } | ||
| } | ||
|
|
||
| namespace System.Diagnostics.Metrics | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.