<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="8.0.0-preview.2.23128.3" />

ActivitySpanId

A SpanId is the format the W3C standard requires for its ID for a single span in a trace. It represents 8 binary bytes of information, typically displayed as 16 characters of Hexadecimal. A SpanId is a STRUCT, and does contain the 8 bytes of binary information so there is value in passing it by reference. It does know how to convert to and from its Hexadecimal string representation, tries to avoid changing formats until it has to, and caches the string representation after it was created. It is mostly useful as an exchange type.
public static ActivitySpanId CreateFromBytes(ReadOnlySpan<byte> idData)

public static ActivitySpanId CreateFromString(ReadOnlySpan<char> idData)

public static ActivitySpanId CreateFromUtf8String(ReadOnlySpan<byte> idData)

public static ActivitySpanId CreateRandom()

Create a new SpanId with at random number in it (very likely to be unique)

public static bool op_Equality(ActivitySpanId spanId1, ActivitySpanId spandId2)

public static bool op_Inequality(ActivitySpanId spanId1, ActivitySpanId spandId2)

public void CopyTo(Span<byte> destination)

Copy the bytes of the TraceId (8 bytes total) into the 'destination' span.

public bool Equals(ActivitySpanId spanId)

public string ToHexString()

Returns the SpanId as a 16 character hexadecimal string.