opentelemetry Package
Microsoft OpenTelemetry Distro for Python.
Provides a single entry-point — <xref:use_microsoft_opentelemetry> — that initialises OpenTelemetry global providers (tracing, metrics, logging) and optionally configures Azure Monitor as an exporter.
Packages
| a365 |
Agent365 observability for the Microsoft OpenTelemetry Distro. Use The symbols below are internal — kept only for backward compatibility with existing tests. |
Functions
use_microsoft_opentelemetry
Configure OpenTelemetry with optional Azure Monitor support.
This function sets up the OpenTelemetry global providers
(TracerProvider, MeterProvider, LoggerProvider) and optionally
configures Azure Monitor as an exporter. Azure Monitor is off
by default: enable it via enable_azure_monitor=True and
provide a connection string.
use_microsoft_opentelemetry(**kwargs: object) -> None
Keyword-Only Parameters
| Name | Description |
|---|---|
|
enable_azure_monitor
|
Enable Azure Monitor export. Defaults to False. Set to True to enable Azure Monitor setup. |
|
azure_monitor_connection_string
|
Connection string for Application Insights resource. |
|
azure_monitor_exporter_credential
|
Azure AD token credential for authentication. |
|
azure_monitor_enable_live_metrics
|
Enable live metrics. Defaults to True. |
|
azure_monitor_enable_performance_counters
|
Enable performance counters. Defaults to True. |
|
azure_monitor_exporter_disable_offline_storage
|
Disable offline retry storage. Defaults to False. |
|
azure_monitor_exporter_storage_directory
|
Custom directory for offline telemetry storage. |
|
azure_monitor_browser_sdk_loader_config
|
Browser SDK loader configuration. |
|
disable_logging
|
Disable the logging pipeline. Defaults to False. |
|
disable_tracing
|
Disable the tracing pipeline. Defaults to False. |
|
disable_metrics
|
Disable the metrics pipeline. Defaults to False. |
|
resource
|
OpenTelemetry Resource. |
|
span_processors
|
Additional span processors. |
|
log_record_processors
|
Additional log record processors. |
|
metric_readers
|
Additional metric readers. |
|
views
|
Metric views. |
|
logger_name
|
Logger name for log collection. |
|
logging_formatter
|
Formatter for collected logs. |
|
instrumentation_options
|
Per-library instrumentation enable/disable options. |
|
enable_trace_based_sampling_for_logs
|
Enable trace-based sampling for logs. |
|
enable_a365
|
Enable Agent365 trace export. Defaults to False. |
|
a365_token_resolver
|
Optional callable |
|
a365_contextual_token_resolver
|
Optional callable |
|
a365_cluster_category
|
Cluster category for endpoint discovery. Also read from |
|
a365_use_s2s_endpoint
|
Use the S2S endpoint. Also read from |
|
a365_suppress_invoke_agent_input
|
Strip input messages from InvokeAgent spans before export. Also read from
|
|
a365_enable_observability_exporter
|
Enable the A365 HTTP observability exporter. Also read from
|
|
a365_observability_scope_override
|
Override the authentication scope used when acquiring tokens for the
A365 observability service. Equivalent to setting the
|
|
a365_max_queue_size
|
Maximum queue size for the A365 batch span processor. Defaults to 2048 when omitted (BatchSpanProcessor default). |
|
a365_scheduled_delay_ms
|
Delay between A365 export batches in milliseconds. Defaults to 5000 when omitted (BatchSpanProcessor default). |
|
a365_exporter_timeout_ms
|
Timeout for a single A365 export operation in milliseconds. Defaults to 30000 when omitted (BatchSpanProcessor default). |
|
a365_max_export_batch_size
|
Maximum batch size for a single A365 export operation. Defaults to 512 when omitted (BatchSpanProcessor default). |
|
enable_console
|
Enable console exporter for traces, metrics, and logs (development
only). Mirrors |
|
enable_spectra
|
Enable Spectra Collector sidecar export via OTLP. Defaults to False.
Requires |
|
spectra_endpoint
|
Spectra sidecar OTLP endpoint. Also read from |
|
spectra_protocol
|
OTLP protocol for Spectra — |
|
spectra_insecure
|
Use insecure (no TLS) connection. Defaults to True (localhost sidecar). |
|
enable_sensitive_data
|
Enable sensitive data recording (prompts, tool arguments, results) for the Agent Framework SDK instrumentation. Defaults to False. |
Returns
| Type | Description |
|---|---|