skillfed

microsoft-opentelemetry

Minimal template for the Microsoft OpenTelemetry distro for Python

microsoft-opentelemetry v1.3.7 726.9K downloads/30d#5,218 on PyPI1
Permissive license Active released

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-opentelemetry

uv

uv add microsoft-opentelemetry

poetry

poetry add microsoft-opentelemetry

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

opentelemetry distribution pythonazure monitor instrumentationdistributed tracing setupobservability middlewareapplication performance monitoringotlp exporter configurationagent telemetry collection
observabilityazure-integrationinstrumentation

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

azure-monitor-opentelemetry

Bundles OpenTelemetry SDK and Azure Monitor…

permissive · top 5,000 on PyPI

azure-monitor-opentelemetry-exporter

Exports OpenTelemetry traces, metrics, and logs…

permissive · top 1,000 on PyPI

azure-monitor-events-extension

Sends custom events to Azure Application…

permissive · top 15,000 on PyPI

azure-core-tracing-opentelemetry

Integrates Azure SDK clients with OpenTelemetry…

unclear · top 5,000 on PyPI

pytest-otel

A pytest plugin that captures and exports…

permissive · top 15,000 on PyPI

opencensus-ext-azure

Exports logs, metrics, and traces from Python…

permissive · top 5,000 on PyPI

coralogix-opentelemetry

Provides OpenTelemetry extensions for Python…

unclear · top 15,000 on PyPI

opentelemetry-exporter-otlp

Installs OpenTelemetry exporters for sending…

permissive · top 1,000 on PyPI

opentelemetry-exporter-gcp-trace

Exports OpenTelemetry traces to Google Cloud…

permissive · top 5,000 on PyPI