InferenceScope Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides OpenTelemetry tracing scope for generative AI inference operations.
public sealed class InferenceScope : Microsoft.Agents.A365.Observability.Runtime.Tracing.Scopes.OpenTelemetryScope
type InferenceScope = class
inherit OpenTelemetryScope
Public NotInheritable Class InferenceScope
Inherits OpenTelemetryScope
- Inheritance
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) |
| 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) |
| RecordFinishReasons(String[]) |
Records the finish reasons for telemetry tracking. |
| RecordInputMessages(String[]) |
Records the input messages for telemetry tracking. |
| RecordInputTokens(Int32) |
Records the number of input tokens for telemetry tracking. |
| RecordOutputMessages(String[]) |
Records the output messages for telemetry tracking. |
| RecordOutputTokens(Int32) |
Records the number of output tokens for telemetry tracking. |
| RecordResponseId(String) |
Records the response id 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(InferenceCallDetails, AgentDetails, TenantDetails, String) |
Creates and starts a new scope for inference tracing. |