# Azure monitor opentelemetry py

> Azure monitor opentelemetry py is an open-source agent skill for cloud and infrastructure. Set up Application Insights telemetry in Python apps with one OpenTelemetry call. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py
- **Repository:** https://github.com/microsoft/skills
- **GitHub stars:** 3,223
- **License:** MIT
- **Skill name:** azure-monitor-opentelemetry-py
- **Collection:** https://github.com/microsoft/skills
- **Categories:** [cloud and infrastructure](https://ai-powered.com/categories/cloud-and-infrastructure)
- **Listing updated:** 2026-11-18

## About

This skill guides an agent through adding Azure Monitor telemetry to a Python service using the Azure Monitor OpenTelemetry Distro. It covers installing the azure-monitor-opentelemetry package, configuring the connection string from environment variables, and calling a single configuration function early in startup so common libraries are instrumented automatically.

The guidance includes ready-made patterns for Flask, Django and FastAPI, plus manual code for custom spans, metrics and logs, sampling ratios, cloud role names, Live Metrics and selective instrumentation. It also sets rules for authentication: prefer Microsoft Entra credentials via DefaultAzureCredential, constrain the credential chain in production, and flush telemetry providers explicitly at process exit.

The skill expects a Python project and an Application Insights resource whose connection string is available to the app. It refers to additional reference files for secondary scenarios and production checklists.

## When your agent uses it

> Azure Monitor OpenTelemetry Distro for Python. Use for one-line Application Insights setup with auto-instrumentation. Triggers: "azure-monitor-opentelemetry", "configure_azure_monitor", "Application Insights", "OpenTelemetry distro", "auto-instrumentation".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py)
- [License: MIT](https://github.com/microsoft/skills/tree/HEAD/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py)

## Features

- **One-line auto-instrumentation:** Configures Application Insights and automatically instruments supported web frameworks and client libraries with a single call.
- **Entra ID authentication:** Shows how to authenticate ingestion with DefaultAzureCredential and constrain the credential chain for production.
- **Custom traces, metrics and logs:** Provides examples for adding spans, counters and logging so custom telemetry reaches Application Insights.
- **Framework integration patterns:** Includes setup examples for Flask, Django and FastAPI applications.
- **Sampling and live metrics:** Covers sampling ratio configuration, cloud role names for Application Map, and enabling Live Metrics.
- **Instrumentation selection:** Explains how to limit which libraries are instrumented and lists the supported ones with their telemetry types.

## Good for

- Add Application Insights monitoring to a Flask or FastAPI service
- Instrument outgoing HTTP calls and database access in a Python app
- Create custom spans and metrics for a background operation
- Configure sampling to reduce telemetry volume in a high-traffic service
- Set up Entra ID authentication for Application Insights in production

## Install

### Claude Code

Copy the skill folder to `~/.claude/skills/azure-monitor-opentelemetry-py` to use it in all your projects:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/azure-monitor-opentelemetry-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py" ~/.claude/skills/azure-monitor-opentelemetry-py &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/azure-monitor-opentelemetry-py` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/azure-monitor-opentelemetry-py` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/azure-monitor-opentelemetry-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py" ~/.agents/skills/azure-monitor-opentelemetry-py &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/azure-monitor-opentelemetry-py` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/azure-monitor-opentelemetry-py` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/azure-monitor-opentelemetry-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py" ~/.cursor/skills/azure-monitor-opentelemetry-py &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/azure-monitor-opentelemetry-py` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/microsoft/skills.git --path .github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py
```

Or copy the folder to `~/.gemini/skills/azure-monitor-opentelemetry-py` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/azure-monitor-opentelemetry-py`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/microsoft/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/azure-monitor-opentelemetry-py &&
cp -R "$tmp/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py" ~/.copilot/skills/azure-monitor-opentelemetry-py &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/azure-monitor-opentelemetry-py` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/microsoft/skills.git
```

Then copy `skills/.github/plugins/azure-sdk-python/skills/azure-monitor-opentelemetry-py` into your agent's skills folder as `azure-monitor-opentelemetry-py`. Agents that support SKILL.md read one folder per skill.

## FAQ

### What does the skill need to run?

It needs the azure-monitor-opentelemetry package installed and an APPLICATIONINSIGHTS_CONNECTION_STRING environment variable pointing to an Application Insights resource.

### Which libraries are auto-instrumented?

Flask, Django, FastAPI, Requests, urllib3, httpx, aiohttp, psycopg2, pymysql, pymongo and redis are listed with trace collection.

### How is authentication handled?

The skill recommends DefaultAzureCredential for Microsoft Entra authentication, with AZURE_TOKEN_CREDENTIALS=prod set in production to restrict the credential chain.

### Which languages does it cover?

It covers Python code only, using the Azure Monitor OpenTelemetry Distro for Python.

### How do I install Azure monitor opentelemetry py in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/azure-monitor-opentelemetry-py to use it in all your projects, or to .claude/skills/azure-monitor-opentelemetry-py in one project.

### Does Azure monitor opentelemetry py run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Azure monitor opentelemetry py?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to Azure monitor opentelemetry py?

The closest alternatives to Azure monitor opentelemetry py are Azure monitor opentelemetry exporter py, Azure monitor opentelemetry ts, Connect observability, Azure monitor ingestion py and Azure mgmt applicationinsights dotnet.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Azure monitor opentelemetry exporter py](https://ai-powered.com/skills/azure-monitor-opentelemetry-exporter-py): Azure monitor opentelemetry exporter py is an open-source agent skill for cloud and infrastructure.
- [Azure monitor opentelemetry ts](https://ai-powered.com/skills/azure-monitor-opentelemetry-ts): Azure monitor opentelemetry ts is an open-source agent skill for cloud and infrastructure.
- [Connect observability](https://ai-powered.com/skills/connect-observability): Connect observability is an open-source agent skill for cloud and infrastructure.
- [Azure monitor ingestion py](https://ai-powered.com/skills/azure-monitor-ingestion-py): Azure monitor ingestion py is an open-source agent skill for cloud and infrastructure.
- [Azure mgmt applicationinsights dotnet](https://ai-powered.com/skills/azure-mgmt-applicationinsights-dotnet): Azure mgmt applicationinsights dotnet is an open-source agent skill for cloud and infrastructure.
- [Azure identity py](https://ai-powered.com/skills/azure-identity-py): Azure identity py is an open-source agent skill for cloud and infrastructure.
- [Azure monitor query py](https://ai-powered.com/skills/azure-monitor-query-py): Azure monitor query py is an open-source agent skill for cloud and infrastructure.
- [Azure appconfiguration py](https://ai-powered.com/skills/azure-appconfiguration-py): Azure appconfiguration py is an open-source agent skill for cloud and infrastructure.

---
Source: https://ai-powered.com/skills/azure-monitor-opentelemetry-py
