Class TraceContextForLogEntry (4.3.1)

[Obsolete("Use Google.Cloud.Diagnostics.Common.ITraceContext instead.")]
public sealed class TraceContextForLogEntry

Represents a trace context (Trace ID and Span ID) for a log entry. These values can be attached to a log entry to establish the relation of it and a trace.

Inheritance

Object > TraceContextForLogEntry

Namespace

Google.Cloud.Diagnostics.AspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Constructors

TraceContextForLogEntry(String, String)

public TraceContextForLogEntry(string traceId, string spanId)

Creates a new trace context.

Parameters
NameDescription
traceIdString

The trace ID. Must not be null.

spanIdString

The span ID, should be null if there's no span.

Properties

SpanId

public string SpanId { get; }

The span ID to associate the log entry with, or null if there's currently no open span.

Property Value
TypeDescription
String
Remarks

For this to be matched to a span being stored in Google Cloud Trace, its format should be the same that the Trace API v2 uses: a 16-character hexadecimal encoding of an 8-byte array, such as 000000000000004a. A check is not performed to ensure this format is used, so as to allow for this value to refer to spans other than those stored in Google Cloud Trace.

TraceId

public string TraceId { get; }

The trace ID to associate the log entry with. Must not be null.

Property Value
TypeDescription
String