microsoft-opentelemetry
Minimal template for the Microsoft OpenTelemetry distro for Python
What it is and what it does
microsoft-opentelemetry is a Microsoft-maintained OpenTelemetry distribution that bundles the SDK, instrumentation plugins, and exporters into a single package. It abstracts away the complexity of configuring tracing, metrics, and logging pipelines by providing a single entry point—the `use_microsoft_opentelemetry()` function—that handles setup for Azure Monitor, OTLP-compatible backends, and Microsoft Agent 365 simultaneously.
The package automatically instruments popular Python frameworks (Django, FastAPI, Flask, etc.) and HTTP libraries (requests, httpx, urllib3, aiohttp) out of the box. It supports environment-variable-based configuration for sampling strategies, offline storage for Azure Monitor, and flexible token resolution for Agent 365 authentication. Developers can enable or disable individual pipelines (logging, tracing, metrics) and customize exporters, span processors, and metric readers as needed.
Use it for:
- Enable distributed tracing across a Django or FastAPI application with a single function call, automatically capturing HTTP spans and database queries.
- Export telemetry to Azure Monitor with offline retry storage for resilience in unreliable network conditions.
- Send traces to both Azure Monitor and an OTLP-compatible backend (e.g., Jaeger, Grafana Loki) simultaneously for multi-destination observability.
- Instrument AI agent applications with Agent 365 telemetry while propagating trace context to Azure Monitor for end-to-end visibility.
- Configure trace sampling (fixed percentage or rate-limited) via environment variables without code changes.
- Collect and correlate application logs, traces, and metrics from a single instrumentation setup.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a unified OpenTelemetry distribution for Python that simplifies instrumentation across Azure Monitor, OTLP-compatible backends, and Microsoft Agent 365 integrations.
Yes, if you are building on Azure or need multi-destination observability. The package eliminates boilerplate for OpenTelemetry setup and provides seamless integration with Azure Monitor and Agent 365. The 24 runtime dependencies are substantial but necessary for the breadth of instrumentation it offers. Install it if you want a batteries-included distribution; skip it if you need minimal dependencies or are not using Azure.
Install
microsoft-opentelemetry on PyPI
pip
pip install microsoft-opentelemetryuv
uv add microsoft-opentelemetrypoetry
poetry add microsoft-opentelemetryInstalling microsoft-opentelemetry
Before you install
Low install friction with a pure Python wheel. Active maintenance—released 2026-08-05, last commit 2026-08-13. Requires Python 3.10 or later and pulls in 24 runtime dependencies, including the full OpenTelemetry SDK and instrumentation libraries for Django, FastAPI, Flask, and other frameworks.
License in practice
MIT license (permissive). No restrictions on commercial or private use.
Quickstart
pip install microsoft-opentelemetry
from microsoft.opentelemetry import use_microsoft_opentelemetry
use_microsoft_opentelemetry(
enable_azure_monitor=True,
azure_monitor_connection_string="InstrumentationKey=...;IngestionEndpoint=...",
)
Requires Python 3.10 or later. Azure Monitor export requires an Application Insights resource and connection string or Azure credentials.
Verify before relying
- Whether the 24 runtime dependencies are all required or if subsets can be installed conditionally based on enabled exporters.
- Performance overhead of automatic instrumentation across all included libraries when only a subset is needed.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 24 — azure-core, azure-core-tracing-opentelemetry, azure-monitor-opentelemetry-exporter, opentelemetry-sdk, opentelemetry-api, opentelemetry-exporter-otlp-proto-http, opentelemetry-instrumentation, opentelemetry-instrumentation-django, opentelemetry-instrumentation-fastapi, opentelemetry-instrumentation-flask, opentelemetry-instrumentation-httpx, opentelemetry-instrumentation-psycopg2, opentelemetry-instrumentation-requests, opentelemetry-instrumentation-urllib, opentelemetry-instrumentation-urllib3, opentelemetry-instrumentation-logging, opentelemetry-instrumentation-openai-agents-v2, opentelemetry-instrumentation-openai-v2, opentelemetry-resource-detector-azure, wrapt, opentelemetry-util-genai, aiohttp, PyJWT, requests |
| Maintenance | actively maintained — 9 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 726,926/month — #5,218 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: microsoft_opentelemetry-1.3.7-py3-none-any.whl
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-opentelemetryBundles OpenTelemetry SDK and Azure Monitor…
permissive · top 5,000 on PyPI
azure-monitor-opentelemetry-exporterExports OpenTelemetry traces, metrics, and logs…
permissive · top 1,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
pytest-otelA pytest plugin that captures and exports…
permissive · top 15,000 on PyPI
opencensus-ext-azureExports logs, metrics, and traces from Python…
permissive · top 5,000 on PyPI
coralogix-opentelemetryProvides OpenTelemetry extensions for Python…
unclear · top 15,000 on PyPI
opentelemetry-exporter-otlpInstalls OpenTelemetry exporters for sending…
permissive · top 1,000 on PyPI
opentelemetry-exporter-gcp-traceExports OpenTelemetry traces to Google Cloud…
permissive · top 5,000 on PyPI