<PackageReference Include="Microsoft.ApplicationInsights" Version="2.23.0" />

Microsoft.ApplicationInsights.Extensibility.W3C.W3CActivityExtensions

public static class W3CActivityExtensions
Extends Activity to support W3C distributed tracing standard.
public static Activity GenerateW3CContext(this Activity activity)

Generate new W3C context.

public static string GetParentSpanId(this Activity activity)

Gets ParentSpanId from the Activity.

public static string GetSpanId(this Activity activity)

Gets SpanId from the Activity.

public static string GetTraceId(this Activity activity)

Gets TraceId from the Activity.

public static string GetTraceparent(this Activity activity)

Gets traceparent header value for the Activity or null if there is no W3C context on it.

public static string GetTracestate(this Activity activity)

Gets tracestate header value from the Activity.

public static bool IsW3CActivity(this Activity activity)

Checks if current Activity has W3C properties on it.

public static void SetTraceparent(this Activity activity, string value)

Initializes W3C context on the Activity from traceparent header value.

public static void SetTracestate(this Activity activity, string value)

Sets tracestate header value on the Activity.

public static Activity UpdateContextOnActivity(this Activity activity)

Updates context on the Activity based on the W3C Context in the parent Activity tree.

public static void UpdateTelemetry(this Activity activity, ITelemetry telemetry, bool forceUpdate)

Sets Activity W3C context on the telemetry.