microsoft.opentelemetry.a365.core.opentelemetry_scope module
- class microsoft.opentelemetry.a365.core.opentelemetry_scope.OpenTelemetryScope(operation_name, activity_name, agent_details=None, span_details=None)[source]
Bases:
objectBase class for OpenTelemetry tracing scopes in the SDK.
- record_attributes(attributes)[source]
Record multiple attribute key/value pairs for telemetry tracking.
This method allows setting multiple custom attributes on the span at once.
- set_end_time(end_time)[source]
Set a custom end time for the scope.
When set, dispose() will pass this value to span.end() instead of using the current wall-clock time. This is useful when the actual end time of the operation is known before the scope is disposed.
- get_context()[source]
Get the OpenTelemetry context for this scope’s span.
This method returns a Context object containing this scope’s span, which can be used to propagate trace context to child operations or downstream services.