Freigeben über


ExecuteToolScope Class

Definition

Provides OpenTelemetry tracing scope for AI tool execution operations.

public sealed class ExecuteToolScope : Microsoft.Agents.A365.Observability.Runtime.Tracing.Scopes.OpenTelemetryScope
type ExecuteToolScope = class
    inherit OpenTelemetryScope
Public NotInheritable Class ExecuteToolScope
Inherits OpenTelemetryScope
Inheritance
ExecuteToolScope

Remarks

Learn more about tool execution

Fields

Name Description
OperationName

The operation name for tool execution tracing.

Properties

Name Description
Id

Gets the span ID for the current activity.

(Inherited from OpenTelemetryScope)
TraceId

Gets the trace ID for the current activity.

(Inherited from OpenTelemetryScope)

Methods

Name Description
AddBaggage(String, String)

Adds baggage to the current activity for distributed tracing context propagation.

(Inherited from OpenTelemetryScope)
Dispose()

Disposes the scope and finalizes telemetry data collection.

(Inherited from OpenTelemetryScope)
GetActivityContext()

Gets the ActivityContext for this scope's span.

(Inherited from OpenTelemetryScope)
InjectTraceContext()

Injects this span's trace context into W3C HTTP headers.

(Inherited from OpenTelemetryScope)
RecordAttributes(IEnumerable<KeyValuePair<String,Object>>)

Records multiple attribute key/value pairs for telemetry tracking.

(Inherited from OpenTelemetryScope)
RecordCancellation()

Record the task cancellation event.

(Inherited from OpenTelemetryScope)
RecordError(Exception)

Log the error.

(Inherited from OpenTelemetryScope)
RecordResponse(IDictionary<String,Object>)

Records a structured tool call result for telemetry tracking. Per OTEL spec, the result SHOULD be recorded in structured form. The dictionary is serialized to JSON.

RecordResponse(String)

Records response information for telemetry tracking. Per OTEL spec, the result SHOULD be recorded in structured form. If the string is already valid JSON, it is recorded as-is. Otherwise, it is wrapped as {"result":"..."}.

RecordThreatDiagnosticsSummary(ThreatDiagnosticsSummary)

Records threat diagnostics summary for telemetry tracking.

SetEndTime(DateTimeOffset)

Sets a custom end time for the scope. This allows for manual control of the scope duration.

(Inherited from OpenTelemetryScope)
SetStartTime(DateTimeOffset)

Sets a custom start time for the scope. This allows for manual control of the scope start time. Can be used in addition to or instead of setting start time via constructor.

(Inherited from OpenTelemetryScope)
SetTagMaybe(String, Object)

Set the tag on the activity if the tag is present.

(Inherited from OpenTelemetryScope)
Start(Request, ToolCallDetails, AgentDetails, UserDetails, SpanDetails, ThreatDiagnosticsSummary)

Creates and starts a new scope for tool execution tracing.

Applies to