Table of Contents

Class TraceContext

Namespace
JD.AI.Core.Tracing
Assembly
JD.AI.Core.dll

Ambient AsyncLocal<T> holder for the current ExecutionContext.

public static class TraceContext
Inheritance
TraceContext
Inherited Members

Properties

CurrentContext

Gets or sets the current execution context for this async flow.

public static ExecutionContext CurrentContext { get; set; }

Property Value

ExecutionContext

Methods

StartChildSpan()

Creates a child span under the current context. Allocates a new ExecutionContext so each async flow gets its own span state — avoids the read-modify-write race on the shared mutable object.

public static string StartChildSpan()

Returns

string

StartTurn(string?, int)

Starts a new trace for a user turn, setting the ambient context.

public static ExecutionContext StartTurn(string? sessionId, int turnIndex)

Parameters

sessionId string
turnIndex int

Returns

ExecutionContext