azure-monitor-opentelemetry
Microsoft Azure Monitor Opentelemetry Distro Client Library for Python
What it is and what it does
Azure Monitor Opentelemetry Distro is a pre-configured bundle of the OpenTelemetry SDK and Azure Monitor exporters designed to simplify telemetry collection in Python applications. It automatically instruments popular web frameworks (Django, FastAPI, Flask), database drivers (psycopg2), and HTTP libraries (requests, urllib, urllib3) to capture traces, metrics, and logs without requiring manual instrumentation of each library. The distro sends all collected telemetry directly to Azure Monitor.
You configure it with a single call to `configure_azure_monitor()`, passing your Application Insights connection string and optional settings for sampling, performance counters, live metrics, and which instrumentations to enable or disable. The package handles resource detection, span processing, and metric aggregation internally, letting you focus on your application code rather than wiring up observability infrastructure.
Use it for:
- Instrument a Django or FastAPI web service to automatically capture HTTP request traces and send them to Azure Monitor.
- Enable distributed tracing across microservices by configuring the distro on each service to report traces to a shared Application Insights resource.
- Collect database query spans from psycopg2 and HTTP client spans from requests to correlate slow endpoints with underlying calls.
- Set up live metrics and performance counters on a production application to monitor CPU, memory, and request rates in real time.
- Disable specific instrumentations in a multi-framework application to avoid double-instrumentation or reduce overhead.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Bundles OpenTelemetry SDK and Azure Monitor exporters to instrument Python applications for automatic collection and reporting of traces, metrics, and logs to Azure Monitor with a single configuration call.
Yes, if you are already using Azure Monitor and need observability in a Python application. The distro eliminates boilerplate by bundling OpenTelemetry and Azure exporters, and it is actively maintained with no known vulnerabilities. The trade-off is a large dependency tree (13 runtime packages) that pulls in instrumentations you may not use; if you need only selective instrumentation or are not on Azure, consider using OpenTelemetry components directly.
Install
azure-monitor-opentelemetry on PyPI
pip
pip install azure-monitor-opentelemetryuv
uv add azure-monitor-opentelemetrypoetry
poetry add azure-monitor-opentelemetryInstalling azure-monitor-opentelemetry
Before you install
Low friction install with a pure-Python wheel. Actively maintained with a recent release. Carries 13 runtime dependencies including the OpenTelemetry SDK and instrumentations for Django, FastAPI, Flask, psycopg2, requests, urllib, urllib3, and logging—all pulled in automatically.
License in practice
MIT License permits commercial and private use with minimal restrictions, making it safe to adopt in most projects.
Quickstart
pip install azure-monitor-opentelemetry
from azure.monitor.opentelemetry import configure_azure_monitor
configure_azure_monitor(connection_string="<your-connection-string>")
Requires Python 3.8 or later and an Azure subscription with an Application Insights resource and its connection string.
Verify before relying
- Whether automatic instrumentation for frameworks beyond those listed is possible without manual setup.
- Performance overhead of live metrics and performance counters when enabled by default.
- Stability guarantees for the bundled OpenTelemetry instrumentations, which the description notes are in beta.
Package facts
| License | MIT License (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 13 — azure-core, azure-core-tracing-opentelemetry, azure-monitor-opentelemetry-exporter, opentelemetry-sdk, opentelemetry-instrumentation-django, opentelemetry-instrumentation-fastapi, opentelemetry-instrumentation-flask, opentelemetry-instrumentation-psycopg2, opentelemetry-instrumentation-requests, opentelemetry-instrumentation-urllib, opentelemetry-instrumentation-urllib3, opentelemetry-instrumentation-logging, opentelemetry-resource-detector-azure |
| Maintenance | actively maintained — 44 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 20,906,017/month — #1,023 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: azure_monitor_opentelemetry-1.8.9-py3-none-any.whl
Keywords: azure, azure sdk
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
azure-monitor-opentelemetry-exporterExports OpenTelemetry traces, metrics, and logs…
permissive · top 1,000 on PyPI
microsoft-opentelemetryProvides a unified OpenTelemetry distribution…
permissive · top 15,000 on PyPI
azure-monitor-events-extensionSends custom events to Azure Application…
permissive · top 15,000 on PyPI
azure-core-tracing-opentelemetryIntegrates Azure SDK clients with OpenTelemetry…
unclear · top 5,000 on PyPI
opencensus-ext-azureExports logs, metrics, and traces from Python…
permissive · top 5,000 on PyPI
applicationinsightsSends telemetry events, metrics, and traces to…
permissive · top 5,000 on PyPI
opentelemetry-container-distroProvides an OpenTelemetry distribution that…
permissive · top 5,000 on PyPI
azure-cli-telemetryCollects and uploads telemetry data for the…
permissive · top 5,000 on PyPI
opentelemetry-distroProvides a Python distribution package for…
permissive · top 1,000 on PyPI
azureml-telemetryCollects telemetry data from Python code by…
unclear · top 15,000 on PyPI