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

ActivityTraceId

A TraceId is the format the W3C standard requires for its ID for the entire trace. It represents 16 binary bytes of information, typically displayed as 32 characters of Hexadecimal. A TraceId is a STRUCT, and does contain the 16 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 ActivityTraceId CreateFromBytes(ReadOnlySpan<byte> idData)

public static ActivityTraceId CreateFromString(ReadOnlySpan<char> idData)

public static ActivityTraceId CreateRandom()

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

public static bool op_Equality(ActivityTraceId traceId1, ActivityTraceId traceId2)

public static bool op_Inequality(ActivityTraceId traceId1, ActivityTraceId traceId2)

public void CopyTo(Span<byte> destination)

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

public bool Equals(ActivityTraceId traceId)

public string ToHexString()

Returns the TraceId as a 32 character hexadecimal string.