# azure-core-tracing-opentelemetry

> Microsoft Azure Azure Core OpenTelemetry plugin Library for Python

- **URL**: https://www.freshcrate.ai/projects/azure-core-tracing-opentelemetry
- **Author**: Microsoft Corporation
- **Category**: Frameworks
- **Latest version**: `azure-mgmt-computelimit_1.1.0` (2026-06-02)
- **License**: MIT License
- **Source**: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-core-tracing-opentelemetry
- **Language**: Python
- **GitHub**: 5,526 stars, 3,285 forks
- **Registry**: pypi (`azure-core-tracing-opentelemetry`)
- **Tags**: `azure`, `pypi`, `sdk`

## Description

# Azure Core Tracing OpenTelemetry client library for Python

## Getting started

You can enable distributed tracing in Azure client libraries by configuring the OpenTelemetry SDK.
OpenTelemetry is a popular open-source observability framework for generating, capturing, and collecting telemetry data for cloud-native software.

There are two key concepts related to tracing: span and trace. A span represents a single operation in a trace. A span can represent an HTTP request,
a remote procedure call (RPC), a database query, or even the path that your code takes. A trace is a tree of spans showing the path of work through
a system. You can distinguish a trace on its own by a unique 16-byte sequence called a TraceID. For more information on these concepts and how they
relate to OpenTelemetry, see the [OpenTelemetry documentation](https://opentelemetry.io/docs/).

## Tracing with Azure Monitor OpenTelemetry Distro

[Azure Monitor OpenTelemetry Distro](https://learn.microsoft.com/azure/azure-monitor/app/opentelemetry-enable?tabs=python) supports tracing for Azure
SDKs by default. Just install and configure the distro and use Azure clients as usual.

```python

# Enable Azure Monitor OpenTelemetry Distro
# It confiures Azure SDKs to use OpenTelemetry as well
from azure.monitor.opentelemetry import configure_azure_monitor
from opentelemetry import trace

configure_azure_monitor(
   connection_string="<your-connection-string>"
)

# Use Azure SDKs as usual, here as an example with Storage SDKs
# you may also report your own spans for it.
from azure.storage.blob import BlobServiceClient

tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span(name="MyApplication"):
    client = BlobServiceClient.from_connection_string('connectionstring')
    client.create_container('my_container')  # Call will be traced
```

The Azure Monitor OpenTelemetry Distro can be found in the [`azure-monitor-opentelemetry`](https://pypi.org/project/azure-monitor-opentelemetry) package.

## Tracing with generic OpenTelemetry

Check out your observability provider documentation on how to enable distributed tracing with OpenTelemetry
or follow [OpenTelemetry Python documentation](https://opentelemetry.io/docs/languages/python/) on generic configuration.

In addition to common OpenTelemetry configuration, follow this steps to configure Azure SDKs:

1. Install the Azure Core OpenTelemetry Tracing plugin for Python with [pip](https://pypi.org/project/pip/):

   ```bash
   pip install azure-core-tracing-opentelemetry
   ```

  Now you can use Azure Core OpenTelemetry Tracing plugin for Python as usual with any SDKs that are compatible
  with azure-core tracing. This includes (not exhaustive list), `azure-storage-blob`, `azure-keyvault-secrets`, `azure-eventhub`, etc.

2. Specify which tracing implementation Azure SDK should use in one of the following ways:
   - By setting `AZURE_SDK_TRACING_IMPLEMENTATION` environment variable to `opentelemetry`
     (just make sure you use a fresh version of `azure-core` and `azure-core-tracing-opentelemetry`)

     ```bash
     AZURE_SDK_TRACING_IMPLEMENTATION=opentelemetry
     ```

   - Alternatively, you can set it up in the code:

     ```python
     from azure.core.settings import settings
     settings.tracing_implementation = "opentelemetry"
     ```

This configuration instructs Azure SDK clients to emit spans using global OpenTelemetry instance and
corresponding tracer provider.

There is no need to write any additional code to trace Azure SDK calls or pass trace context explicitly -
Azure SDKs and OpenTelemetry will do it for you.

Here's a full example:

```python

# Declare OpenTelemetry as enabled tracing plugin for Azure SDKs
from azure.core.settings import settings

settings.tracing_implementation = "opentelemetry"

# In the below example, we use a simple console exporter.

# See https://opentelemetry.io/docs/languages/python/ for more details on OpenTelemetry configuration

from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
from opentelemetry.sdk.trace.export import SimpleSpanProcessor

# Simple console exporter
exporter = ConsoleSpanExporter()

trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
    SimpleSpanProcessor(exporter)
)

# Example with Storage SDKs

from azure.storage.blob import BlobServiceClient

tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span(name="MyApplication"):
    client = BlobServiceClient.from_connection_string('connectionstring')
    client.create_container('my_container')  # Call will be traced
```

## HTTP instrumentation

With the Azure Core OpenTelemetry Tracing plugin enabled, HTTP requests made by Azure SDK clients are typically instrumented via the [`DistributedTracingPolicy`](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/azure/core/pipeline/policies/_distributed_tracing

## Recent releases

| Version | Date | Urgency | Changes |
| --- | --- | --- | --- |
| `azure-mgmt-computelimit_1.1.0` | 2026-06-02 | High | ## 1.1.0 (2026-05-26)  ### Features Added    - Client `ComputeLimitMgmtClient` added operation group `vm_families`   - Added model `FeatureEnableRequest`   - Added model `VmFamily`   - Added model `VmFamilyProperties`   - Operation group `FeaturesOperations` added method `begin_disable`   - Added operation group `VmFamiliesOperations` |
| `azure-appconfiguration-provider_2.5.0` | 2026-05-26 | High | ## 2.5.0 (2026-05-22)  ### Features Added  - Added `refresh_enabled` parameter to the `load` method. Defaults to `True` if `refresh_on` is set. When set to `True` without `refresh_on` keys, all selected key-values are monitored for changes. When set to `False`, calling `refresh` will be a no-op. - Added the ability to monitor all selected key-values for refresh with the `refresh_enabled` kwarg. When this kwarg is set to `True`, and `refresh_on` is not specified, changes to any selected key-value |
| `azure-mgmt-storage_25.0.0` | 2026-05-20 | High | ## 25.0.0 (2026-05-19)  ### Features Added    - Client `StorageManagementClient` added method `send_request`   - Client `StorageManagementClient` added operation group `connectors`   - Client `StorageManagementClient` added operation group `data_shares`   - Enum `AccessTier` added member `SMART`   - Enum `AllowedCopyScope` added member `ALL`   - Enum `TriggerType` added member `MOCK_RUN`   - Model `AzureEntityResource` added property `system_data`   - Model `BlobContainer` added property `system |
| `azure-mgmt-storagesync_1.0.1` | 2026-05-14 | High | ## 1.0.1 (2026-05-14)  ### Other Changes    - Regenerated with latest code generator tool |
| `azure-mgmt-attestation_2.0.0` | 2026-05-08 | High | ## 2.0.0 (2026-05-08)  ### Features Added    - Client `AttestationManagementClient` added parameter `cloud_setting` in method `__init__`   - Client `AttestationManagementClient` added method `send_request`   - Client `AttestationManagementClient` added operation group `private_link_resources`   - Model `AttestationServiceCreationSpecificParams` added property `public_network_access`   - Model `AttestationServiceCreationSpecificParams` added property `tpm_attestation_authentication`   - Model `At |
| `azure-batch_15.1.0` | 2026-05-01 | High | ## 15.1.0 (2026-03-06)  ### Other Changes  - This is the GA release of the features introduced in the 15.0.0 and 15.1.0 beta versions, including LRO support, job-level FIFO scheduling, CMK support on pools, IPv6 support, metadata security protocol support, IP tag support, and confidential VM enhancements.  ### Breaking Changes  - Renamed `BatchNodeUserUpdateOptions` to `BatchNodeUserReplaceOptions`. - Renamed `OutputFileUploadConfig` to `OutputFileUploadConfiguration`.  - Removed Models:   - Rem |
| `azure-postgresql-auth_1.0.2` | 2026-04-29 | High | ## 1.0.2 (2026-04-28)  ### Bugs Fixed  - Removed dependency on `DefaultAzureCredential` in source library - Fixed `get_entra_conninfo_async` and `get_entra_token_async` closing the credential by using it as a context manager  ### Other Changes  - Bumped minimum dependency on `azure-core` to `>=1.31.0` |
| `azure-mgmt-hybridkubernetes_1.2.0` | 2026-04-23 | High | ## 1.2.0 (2026-04-23)  ### Other Changes    - Regenerate SDK code with latest code generator tool |
| `azure-template_0.1.0b6187637` | 2026-04-21 | High | ## 0.1.0b6187637 (2026-04-21)  ### Features Added  - Some feature  ### Breaking Changes  - Some breaking change  ### Bugs Fixed  - Some bug fix  ### Other Changes  - Some other change |
| `1.0.0b12` | 2026-04-21 | Low | Imported from PyPI (1.0.0b12) |

## Dependency audit

- **Score**: 98/100
- **Total deps**: 0
- **Resolved**: 0
- **Unresolved**: 0
- **License conflicts**: 0
- **Warnings**: 1
- **Scanned**: 2026-05-25

## Citation

- HTML: https://www.freshcrate.ai/projects/azure-core-tracing-opentelemetry
- Markdown: https://www.freshcrate.ai/projects/azure-core-tracing-opentelemetry.md
- Dependencies JSON: https://www.freshcrate.ai/api/projects/azure-core-tracing-opentelemetry/deps

_Generated by freshcrate.ai. Indexes pypi releases for AI-agent ecosystem packages._
