Share via


opentelemetry Package

Functions

configure_azure_monitor

This function works as a configuration layer that allows the end user to configure OpenTelemetry and Azure monitor components. The configuration can be done via arguments passed to this function.

configure_azure_monitor(**kwargs) -> None

Keyword-Only Parameters

Name Description
connection_string
str

Connection string for your Application Insights resource.

credential

Token credential, such as ManagedIdentityCredential or ClientSecretCredential, used for Azure Active Directory (AAD) authentication. Defaults to None.

disable_offline_storage

Boolean value to determine whether to disable storing failed telemetry records for retry. Defaults to False.

logger_name
str

The name of the Python logger that telemetry will be collected.

instrumentation_options

A nested dictionary that determines which instrumentations to enable or disable. Instrumentations are referred to by their Library Names. For example, {"azure_sdk": {"enabled": False}, "flask": {"enabled": False}, "django": {"enabled": True}} will disable Azure Core Tracing and the Flask instrumentation but leave Django and the other default instrumentations enabled.

resource
<xref:opentelemetry.sdk.resources.Resource>

OpenTelemetry Resource object. Passed in Resource Attributes take priority over default attributes and those from Resource Detectors.

span_processors
list[<xref:opentelemetry.sdk.trace.SpanProcessor>]

List of SpanProcessor objects to process every span prior to exporting. Will be run sequentially.

enable_live_metrics

Boolean value to determine whether to enable live metrics feature. Defaults to False.

enable_performance_counters

Boolean value to determine whether to enable performance counters. Defaults to True.

storage_directory
str

Storage directory in which to store retry files. Defaults to <tempfile.gettempdir()>/Microsoft/AzureMonitor/opentelemetry-python-<your-instrumentation-key>.

views
list[<xref:opentelemetry.sdk.metrics.view.View>]

List of View objects to configure and filter metric output.

enable_trace_based_sampling_for_logs

Boolean value to determine whether to enable trace based sampling for logs. Defaults to False

Returns

Type Description