<PackageReference Include="OpenTelemetry.Api" Version="1.13.1" />

OpenTelemetry.Trace.SpanContext

A struct that represents a span context. A span context contains the portion of a span that must propagate to child TelemetrySpan and across process boundaries. It contains the identifiers ActivityTraceIdand ActivitySpanId associated with the TelemetrySpan along with a set of common TraceFlags and system-specific TraceState values>.
public bool IsRemote { get; }

Gets a value indicating whether this SpanContext was propagated from a remote parent.

public bool IsValid { get; }

Gets a value indicating whether this SpanContext is valid.

public ActivitySpanId SpanId { get; }

Gets the ActivitySpanId associated with this SpanContext.

Gets the ActivityTraceFlags associated with this SpanContext.

public ActivityTraceId TraceId { get; }

Gets the ActivityTraceId associated with this SpanContext.

public IEnumerable<KeyValuePair<string, string>> TraceState { get; }

Gets the TraceState associated with this SpanContext.

public SpanContext(ref ActivityTraceId traceId, ref ActivitySpanId spanId, ActivityTraceFlags traceFlags, bool isRemote = false, IEnumerable<KeyValuePair<string, string>> traceState = null)

Initializes a new instance of the SpanContext struct with the given identifiers and options.

public SpanContext(ref ActivityContext activityContext)

Initializes a new instance of the SpanContext struct with the given identifiers and options.

public static bool op_Equality(SpanContext spanContext1, SpanContext spanContext2)

Compare two SpanContext for equality.

public static ActivityContext op_Implicit(SpanContext spanContext)

Converts a SpanContext into an ActivityContext.

public static bool op_Inequality(SpanContext spanContext1, SpanContext spanContext2)

Compare two SpanContext for not equality.

public bool Equals(SpanContext other)