azure-monitor-opentelemetry-py

Configure Azure Monitor OpenTelemetry instrumentation for Python applications.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-monitor-opentelemetry-py-davidrrowley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: azure-monitor-opentelemetry-py
Source: https://github.com/davidrrowley/CortexYouV3/tree/main/.agents/skills/azure-monitor-opentelemetry-py
Command: npx skills add https://github.com/davidrrowley/CortexYouV3 --skill azure-monitor-opentelemetry-py-davidrrowley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies configuring Application Insights telemetry for Python applications by providing a one-line OpenTelemetry-based setup that removes manual exporter and instrumentation wiring.

Core Features & Use Cases

  • One-line setup: configure_azure_monitor() bootstraps tracing, metrics, and log capture with auto-instrumentation.
  • Framework and library support: Auto-instrumentation for Flask, Django, FastAPI, requests, httpx, aiohttp, and common DB drivers.
  • Use Case: Add observability to a web service or background worker with minimal code changes to capture traces, custom spans, metrics, and logs in Application Insights.

Quick Start

Call configure_azure_monitor() early in your application startup with the APPLICATIONINSIGHTS_CONNECTION_STRING or an AAD credential to enable auto-instrumentation and start sending telemetry to Application Insights.

Frequently Asked Questions about azure-monitor-opentelemetry-py

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Application Insights tracing for a Python web app?

Application Insights tracing for a Python web app is configured by calling configure_azure_monitor() early in startup with a connection string or AAD credential. This one-line setup bootstraps tracing, metrics, and log capture using the Azure Monitor OpenTelemetry distro.

Does OpenTelemetry auto-instrumentation work with Flask, Django, and FastAPI?

OpenTelemetry auto-instrumentation works with Flask, Django, and FastAPI, as well as common client libraries like requests, httpx, and aiohttp. It automatically captures traces and metrics from these frameworks without requiring manual exporter or instrumentation wiring.

What is the best way to capture Python application logs and metrics in Azure Monitor?

The best way to capture Python application logs and metrics in Azure Monitor is using the Azure Monitor OpenTelemetry distro. It provides a single configure_azure_monitor() function that bootstraps log capture and metrics export alongside tracing to Application Insights.

Can I use Azure AD authentication instead of a connection string for Python telemetry?

You can use Azure AD authentication credentials instead of an Application Insights connection string to configure Python telemetry. The setup function accepts AAD credentials to authenticate and send observability data to Application Insights.

Does Python Application Insights auto-instrumentation support background services and workers?

Python Application Insights auto-instrumentation supports background services and workers. The one-line OpenTelemetry setup applies to both web services and background tasks, capturing traces, custom spans, metrics, and logs for comprehensive observability.

How do I enable live metrics and sampling for Python OpenTelemetry in Azure?

Live metrics and sampling for Python OpenTelemetry are enabled through the configure_azure_monitor() setup. This function supports resource configuration, live metrics streaming, and sampling to manage telemetry data volume sent to Application Insights.