AiTracingScope
class AiTracingScope implements NonCopyableContext
| internal |
Own the current coroutine's AI span stack while sharing invocation lookup with its children.
Constants
| CONTEXT_KEY |
|
Methods
Create a scope with an independent span stack.
Return the current tracing scope without allocating tracking state.
Return or create tracking state for sampled AI work.
Capture the SDK scope used for parent lookup, installation and restoration.
Install a span and retain the scope it changes.
Finish a span and restore its owner when that owner still exists.
Details
at line 29
__construct(AiTracingState $state = new AiTracingState(), AiConversation|null $conversation = null)
Create a scope with an independent span stack.
at line 38
static AiTracingScope|null
current()
Return the current tracing scope without allocating tracking state.
at line 46
static AiTracingScope
getOrCreate()
Return or create tracking state for sampled AI work.
at line 54
static Scope
sentryScope()
Capture the SDK scope used for parent lookup, installation and restoration.
at line 69
void
push(Span $span, Scope $scope)
Install a span and retain the scope it changes.
at line 82
static void
finishSpan(Span $span, AiTracingScope|null $owner, SpanStatus $status)
Finish a span and restore its owner when that owner still exists.