Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
struct System.​Diagnostics.​ActivityTraceId
Assembly: System.Diagnostics.DiagnosticSource
Implemented Interfaces
Represents a <see cref="P:System.Diagnostics.Activity.TraceId" /> whose format is based on a W3C standard.
Methods
public
void
CopyTo​(Span<​byte> destination)
Copies the 16 bytes of the current <see cref="T:System.Diagnostics.ActivityTraceId" /> to a specified span.
destination
The span to which the 16 bytes of the trace ID are to be copied.
public static
ActivityTraceId
CreateFromBytes​(ReadOnlySpan<​byte> idData)
Creates a new <see cref="T:System.Diagnostics.ActivityTraceId" /> value from a read-only span of 16 bytes.
Returns The new trace ID.
idData
A read-only span of 16 bytes.
public static
ActivityTraceId
CreateFromString​(ReadOnlySpan<​char> idData)
Creates a new <see cref="T:System.Diagnostics.ActivityTraceId" /> value from a read-only span of 32 hexadecimal characters.
Returns The new trace ID.
idData
A span that contains 32 hexadecimal characters.
public static
ActivityTraceId
CreateFromUtf8String​(ReadOnlySpan<​byte> idData)
Creates a new <see cref="T:System.Diagnostics.ActivityTraceId" /> value from a read-only span of UTF8-encoded bytes.
Returns The new trace ID.
idData
A read-only span of UTF8-encoded bytes.
public static
ActivityTraceId
CreateRandom​()
Creates a new <see cref="T:System.Diagnostics.ActivityTraceId" /> based on a random number (that is very likely to be unique).
Returns The new <see cref="T:System.Diagnostics.ActivityTraceId" /> .
public
bool
Equals​(ActivityTraceId traceId)
Determines whether the current instance and a specified <see cref="T:System.Diagnostics.ActivityTraceId" /> are equal.
Returns <see langword="true" /> if <paramref name="traceId" /> has the same hex value as the current instance; otherwise, <see langword="false" /> .
traceId
The instance to compare.
public
bool
Equals​(object obj)
Determines whether this instance and a specified object, which must also be an <see cref="T:System.Diagnostics.ActivityTraceId" /> instance, have the same value.
Returns <see langword="true" /> if <paramref name="obj" /> is an instance of <see cref="T:System.Diagnostics.ActivityTraceId" /> and has the same hex value as the current instance; otherwise, <see langword="false" /> .
obj
The object to compare.
public
int
GetHashCode​()
Returns the hash code of the TraceId.
Returns The hash code of the TraceId.
public
string
ToHexString​()
Returns a 32-character hexadecimal string that represents this span ID.
Returns The 32-character hexadecimal string representation of this trace ID.
public
string
ToString​()
Returns a 32-character hexadecimal string that represents this trace ID.
Returns The 32-character hexadecimal string representation of this trace ID.
protected
void
Finalize​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object