Class TraceContext
- Namespace
- DotCompute.Core.Telemetry.Context
- Assembly
- DotCompute.Core.dll
Represents the context for a distributed trace, containing trace metadata, spans, and device operation information.
public sealed class TraceContext
- Inheritance
-
TraceContext
- Inherited Members
Properties
Activity
Gets or sets the Activity associated with this trace context. Provides integration with .NET's built-in activity tracing.
public Activity? Activity { get; set; }
Property Value
- Activity
The Activity instance or null if not available.
CorrelationId
Gets or sets the correlation identifier for this trace. Used for correlating related operations within the same trace.
public string CorrelationId { get; set; }
Property Value
- string
The correlation identifier as a string.
DeviceOperations
Gets or sets the device operations tracked within this trace. Maps device IDs to their corresponding operation traces.
public ConcurrentDictionary<string, DeviceOperationTrace> DeviceOperations { get; }
Property Value
- ConcurrentDictionary<string, DeviceOperationTrace>
A thread-safe dictionary mapping device IDs to operation traces.
OperationName
Gets or sets the name of the root operation for this trace. Typically represents the high-level operation being traced.
public string OperationName { get; set; }
Property Value
- string
The operation name as a string.
ParentSpanContext
Gets or sets the parent span context if this trace is part of a larger trace. Used for establishing parent-child relationships between traces.
public SpanContext? ParentSpanContext { get; set; }
Property Value
- SpanContext
The parent span context or null if this is a root trace.
Spans
Gets the collection of spans belonging to this trace. Spans represent individual operations within the trace.
public ConcurrentBag<SpanData> Spans { get; }
Property Value
- ConcurrentBag<SpanData>
A thread-safe collection of span data.
StartTime
Gets or sets the timestamp when the trace started. Used for calculating total trace duration and timeline analysis.
public DateTimeOffset StartTime { get; set; }
Property Value
- DateTimeOffset
The start time as a DateTimeOffset.
Tags
Gets or sets the tags associated with this trace. Tags are key-value pairs that provide additional metadata about the trace.
public Dictionary<string, object?> Tags { get; init; }
Property Value
- Dictionary<string, object>
A dictionary of tag key-value pairs.
TraceId
Gets or sets the unique trace identifier. This ID is used to correlate spans across service boundaries.
public string TraceId { get; set; }
Property Value
- string
The trace identifier as a string.