Azure Monitor OpenTelemetry for Python
Connect Python applications to Application Insights with one-line OpenTelemetry setup.
The documentation recommends DefaultAzureCredential, constraining the production credential chain, and storing the connection string in environment variables, showing some least-exposure and authentication awareness. It does not explain telemetry data flow, sensitive-field redaction, collection scope, user confirmation, rollback, or egress controls, so points are deducted.
The install command, basic configuration, and framework examples make the happy path plausible. However, the main document uses an instrumentations parameter while the reference document uses instrumentation_options; lifecycle cleanup is stated as a rule without a complete reproducible example, and abnormal-input or failure feedback is not covered. The score remains within the static-review ceiling.
Trigger phrases, the Python package, and primary scenarios are reasonably clear, covering Flask, Django, FastAPI, and custom telemetry. Non-fit ranges, compatibility boundaries, sensitive-data guidance, and mainland-China network fit are not clearly stated; the core function also depends on reachability of Azure Application Insights services, so points are deducted.
The skill has front matter, MIT licensing, a version, installation notes, a parameter table, best practices, and layered reference files. It lacks a changelog, explicit maintenance owner and update path, troubleshooting guidance, version pinning, and complete limitation disclosure; the two documents also disagree on an API parameter name.
It can directly help with basic Application Insights auto-instrumentation and includes examples for common frameworks, sampling, role naming, and authentication. Several examples omit the required connection-string setup or exit-time flush/shutdown, and the parameter inconsistency may require manual correction. No comparative benefit or verified representative output is supplied.
The supplied files contain auditable code snippets, parameter tables, repository licensing, and general CI/test materials. They do not provide skill-specific acceptance tests, execution results, or independent corroboration, and some API/capability claims conflict across files, so only limited static evidence supports the score.
- The main document's instrumentations parameter conflicts with the reference document's instrumentation_options; verify the current azure-monitor-opentelemetry API before use.
- Telemetry may include requests, logs, exceptions, and custom attributes, but the skill provides no sensitive-data filtering, sampling-boundary, or data-residency guidance.
- Production use should add complete connection-string injection, credential-scope, and exit-time force_flush/shutdown handling, and confirm service reachability from mainland China.
What it does & when to use it
This skill helps Python developers configure the Azure Monitor OpenTelemetry Distro for Application Insights. It covers automatic tracing for Flask, Django, FastAPI, HTTP clients, databases, and Redis, plus custom traces, metrics, and logs. Configuration examples include Microsoft Entra authentication, sampling, cloud role naming, Live Metrics, and selective instrumentations. Production guidance requires an environment-provided connection string and explicit telemetry-provider flushing and shutdown at process exit.
Shows how to install azure-monitor-opentelemetry and initialize Application Insights with configure_azure_monitor(). It reads APPLICATIONINSIGHTS_CONNECTION_STRING and supports DefaultAzureCredential or a specified Azure credential for ingestion authentication. It provides examples for Flask, Django, and FastAPI, along with custom spans, metrics, logs, sampling ratios, cloud role names, Live Metrics, and instrumentation selection.
- A Python web developer wants minimal-code Application Insights setup for a Flask, Django, or FastAPI service.
- A platform team needs automatic tracing for services using Requests, httpx, database clients, or Redis.
- A production team wants Microsoft Entra authentication instead of relying only on an instrumentation key.
- A high-traffic application needs sampling and cloud role names for Application Map service identification.
Pros & cons
- Includes direct Flask, Django, and FastAPI examples.
- Covers custom traces, metrics, and logs.
- Supports DefaultAzureCredential, sampling, Live Metrics, cloud role names, and selective instrumentations.
- Provides explicit production guidance for authentication and telemetry flushing.
- The source does not provide a compatibility matrix, test results, or troubleshooting guide.
- It does not explain Azure resource creation, Entra permission setup, or Application Insights pricing.
- Automatic instrumentation is documented only for the listed libraries; support for others is not established by this source.
How to install
Install the Agent Skills collection with npx skills add microsoft/skills, then select the required skill in the wizard. The README states that skills are installed in the selected agent directory, such as .github/skills/ for GitHub Copilot. Install the Python runtime package with pip install azure-monitor-opentelemetry.
How to use
Example trigger: Configure azure-monitor-opentelemetry and Application Insights auto-instrumentation for this Python service. In code, import configure_azure_monitor and call configure_azure_monitor(credential=DefaultAzureCredential()) early; set APPLICATIONINSIGHTS_CONNECTION_STRING. For production, also set AZURE_TOKEN_CREDENTIALS=prod or a specific credential, and call the provider's force_flush() or shutdown() when the process exits.
Compared to similar skills
Compared with instrumentation-key-only authentication, the skill recommends DefaultAzureCredential for Microsoft Entra authentication; the connection string still identifies the target Application Insights resource.