Skip to content

Commit

Permalink
Rename TextMapPropagator to DistributedContextPropagator (#55539)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarekgh authored Jul 13, 2021
1 parent 4ff3762 commit 1904cfc
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,18 +254,18 @@ public sealed class ActivityListener : IDisposable
public System.Diagnostics.SampleActivity<ActivityContext>? Sample { get { throw null; } set { throw null; } }
public void Dispose() { throw null; }
}
public abstract class TextMapPropagator
public abstract class DistributedContextPropagator
{
public delegate void PropagatorGetterCallback(object? carrier, string fieldName, out string? fieldValue, out System.Collections.Generic.IEnumerable<string>? fieldValues);
public delegate void PropagatorSetterCallback(object? carrier, string fieldName, string fieldValue);
public abstract System.Collections.Generic.IReadOnlyCollection<string> Fields { get; }
public abstract void Inject(Activity? activity, object? carrier, PropagatorSetterCallback? setter);
public abstract void ExtractTraceIdAndState(object? carrier, PropagatorGetterCallback? getter, out string? traceId, out string? traceState);
public abstract System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string?>>? ExtractBaggage(object? carrier, PropagatorGetterCallback? getter);
public static TextMapPropagator Current { get; set; }
public static TextMapPropagator CreateDefaultPropagator() { throw null; }
public static TextMapPropagator CreatePassThroughPropagator() { throw null; }
public static TextMapPropagator CreateNoOutputPropagator() { throw null; }
public static DistributedContextPropagator Current { get; set; }
public static DistributedContextPropagator CreateDefaultPropagator() { throw null; }
public static DistributedContextPropagator CreatePassThroughPropagator() { throw null; }
public static DistributedContextPropagator CreateNoOutputPropagator() { throw null; }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<Compile Include="System\Diagnostics\ActivitySource.cs" />
<Compile Include="System\Diagnostics\DiagnosticSourceActivity.cs" />
<Compile Include="System\Diagnostics\DiagLinkedList.cs" />
<Compile Include="System\Diagnostics\DistributedContextPropagator.cs" />
<Compile Include="System\Diagnostics\LegacyPropagator.cs" />
<Compile Include="System\Diagnostics\NoOutputPropagator.cs" />
<Compile Include="System\Diagnostics\PassThroughPropagator.cs" />
<Compile Include="System\Diagnostics\RandomNumberGenerator.cs" />
<Compile Include="System\Diagnostics\TextMapPropagator.cs" />
<Compile Include="System\Diagnostics\Metrics\AggregationManager.cs" />
<Compile Include="System\Diagnostics\Metrics\Aggregator.cs" />
<Compile Include="System\Diagnostics\Metrics\AggregatorStore.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
namespace System.Diagnostics
{
/// <summary>
/// An implementation of TextMapPropagator determines if and how distributed context information is encoded and decoded as it traverses the network.
/// An implementation of DistributedContextPropagator determines if and how distributed context information is encoded and decoded as it traverses the network.
/// The encoding can be transported over any network protocol that supports string key-value pairs. For example when using HTTP, each key value pair is an HTTP header.
/// TextMapPropagator inject values into and extracts values from carriers as string key/value pairs.
/// DistributedContextPropagator inject values into and extracts values from carriers as string key/value pairs.
/// </summary>
public abstract class TextMapPropagator
public abstract class DistributedContextPropagator
{
private static TextMapPropagator s_current = CreateDefaultPropagator();
private static DistributedContextPropagator s_current = CreateDefaultPropagator();

/// <summary>
/// The callback that is used in propagators' extract methods. The callback is invoked to lookup the value of a named field.
Expand All @@ -38,7 +38,7 @@ public abstract class TextMapPropagator
/// <summary>
/// The set of field names this propagator is likely to read or write.
/// </summary>
/// <returns>Returns list of fields that will be used by the TextMapPropagator.</returns>
/// <returns>Returns list of fields that will be used by the DistributedContextPropagator.</returns>
public abstract IReadOnlyCollection<string> Fields { get; }

/// <summary>
Expand Down Expand Up @@ -69,7 +69,7 @@ public abstract class TextMapPropagator
/// <summary>
/// Get or set the process wide propagator object which used as the current selected propagator.
/// </summary>
public static TextMapPropagator Current
public static DistributedContextPropagator Current
{
get
{
Expand All @@ -91,18 +91,18 @@ public static TextMapPropagator Current
/// "traceparent" of the identifiers which are formatted as W3C trace parent, "Request-Id" of the identifiers which are formatted as a hierarchical identifier.
/// The returned propagator can inject the baggage key-value pair list with header name "Correlation-Context" and it can extract the baggage values mapped to header names "Correlation-Context" and "baggage".
/// </remarks>
public static TextMapPropagator CreateDefaultPropagator() => LegacyPropagator.Instance;
public static DistributedContextPropagator CreateDefaultPropagator() => LegacyPropagator.Instance;

/// <summary>
/// Returns a propagator which attempts to act transparently, emitting the same data on outbound network requests that was received on the in-bound request.
/// When encoding the outbound message, this propagator uses information from the request's root Activity, ignoring any intermediate Activities that may have been created while processing the request.
/// </summary>
public static TextMapPropagator CreatePassThroughPropagator() => PassThroughPropagator.Instance;
public static DistributedContextPropagator CreatePassThroughPropagator() => PassThroughPropagator.Instance;

/// <summary>
/// Returns a propagator which does not transmit any distributed context information in outbound network messages.
/// </summary>
public static TextMapPropagator CreateNoOutputPropagator() => NoOutputPropagator.Instance;
public static DistributedContextPropagator CreateNoOutputPropagator() => NoOutputPropagator.Instance;

// internal stuff

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

namespace System.Diagnostics
{
internal sealed class LegacyPropagator : TextMapPropagator
internal sealed class LegacyPropagator : DistributedContextPropagator
{
internal static TextMapPropagator Instance { get; } = new LegacyPropagator();
internal static DistributedContextPropagator Instance { get; } = new LegacyPropagator();

public override IReadOnlyCollection<string> Fields { get; } = new ReadOnlyCollection<string>(new[] { TraceParent, RequestId, TraceState, Baggage, CorrelationContext });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace System.Diagnostics
{
internal sealed class NoOutputPropagator : TextMapPropagator
internal sealed class NoOutputPropagator : DistributedContextPropagator
{
internal static TextMapPropagator Instance { get; } = new NoOutputPropagator();
internal static DistributedContextPropagator Instance { get; } = new NoOutputPropagator();

public override IReadOnlyCollection<string> Fields { get; } = LegacyPropagator.Instance.Fields;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

namespace System.Diagnostics
{
internal sealed class PassThroughPropagator : TextMapPropagator
internal sealed class PassThroughPropagator : DistributedContextPropagator
{
internal static TextMapPropagator Instance { get; } = new PassThroughPropagator();
internal static DistributedContextPropagator Instance { get; } = new PassThroughPropagator();

public override IReadOnlyCollection<string> Fields { get; } = LegacyPropagator.Instance.Fields;

Expand Down
Loading

0 comments on commit 1904cfc

Please sign in to comment.