InvokeAgentScope class
Provides OpenTelemetry tracing scope for AI agent invocation operations.
- Extends
Methods
| record |
Records the input messages for telemetry tracking. |
| record |
Records the output messages for telemetry tracking. |
| record |
Records response information for telemetry tracking. |
| start(Invoke |
Creates and starts a new scope for agent invocation tracing. |
Inherited Methods
| dispose() | Legacy dispose method for compatibility |
| record |
Records an error that occurred during the operation |
| with |
Makes this span active for the duration of the async callback execution |
Method Details
recordInputMessages(string[])
Records the input messages for telemetry tracking.
function recordInputMessages(messages: string[])
Parameters
- messages
-
string[]
Array of input messages
recordOutputMessages(string[])
Records the output messages for telemetry tracking.
function recordOutputMessages(messages: string[])
Parameters
- messages
-
string[]
Array of output messages
recordResponse(string)
Records response information for telemetry tracking.
function recordResponse(response: string)
Parameters
- response
-
string
The invocation response
start(InvokeAgentDetails, TenantDetails, EnhancedAgentDetails, CallerDetails)
Creates and starts a new scope for agent invocation tracing.
static function start(invokeAgentDetails: InvokeAgentDetails, tenantDetails: TenantDetails, callerAgentDetails?: EnhancedAgentDetails, callerDetails?: CallerDetails): InvokeAgentScope
Parameters
- invokeAgentDetails
- InvokeAgentDetails
The details of the agent invocation including endpoint, agent information, and conversation context.
- tenantDetails
- TenantDetails
The tenant details.
- callerAgentDetails
- EnhancedAgentDetails
The details of the caller agent.
- callerDetails
- CallerDetails
The details of the non-agentic caller.
Returns
A new InvokeAgentScope instance.
Inherited Method Details
dispose()
Legacy dispose method for compatibility
function dispose()
Inherited From OpenTelemetryScope.dispose
recordError(Error)
Records an error that occurred during the operation
function recordError(error: Error)
Parameters
- error
-
Error
The error that occurred
Inherited From OpenTelemetryScope.recordError
withActiveSpanAsync<T>(() => Promise<T>)
Makes this span active for the duration of the async callback execution
function withActiveSpanAsync<T>(callback: () => Promise<T>): Promise<T>
Parameters
- callback
-
() => Promise<T>
Returns
Promise<T>
Inherited From OpenTelemetryScope.withActiveSpanAsync