# Instrument Python Apps with Azure Monitor

Python telemetry setup can be repetitive and inconsistent. This skill provides focused guidance for configuring Azure Monitor OpenTelemetry across common frameworks and telemetry types.

## Install

```bash
npx skillstore add sickn33/azure-monitor-opentelemetry-py
```

## Metadata

- Status: approved
- Slug: sickn33-azure-monitor-opentelemetry-py
- Skillstore revision: r2
- Version status: missing
- Tree hash: 923159156135cf28bc7ef2a63fb4e1bd76a2737ec854350e3020f580bd905d11
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/azure-monitor-opentelemetry-py
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-azure-monitor-opentelemetry-py
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-azure-monitor-opentelemetry-py/manifest

## Capabilities

- Configures Azure Monitor OpenTelemetry through environment variables or an explicit connection string.
- Shows initialization patterns for Flask, Django, and FastAPI applications.
- Demonstrates custom traces, metrics, and Python logging.
- Configures sampling ratios and cloud role names for multi-service applications.
- Selects specific instrumentations and enables live metrics.
- Uses DefaultAzureCredential for Azure AD authentication.

## Use Cases

- Add basic Python observability: Configure Azure Monitor quickly for an existing Python service using the standard environment variable.
- Instrument a web framework: Apply the correct initialization pattern to Flask, Django, or FastAPI applications.
- Standardize production telemetry: Define service names, sampling, authentication, and selected instrumentations across multiple services.

## Prompt Templates

### Basic setup

```
Show how to configure Azure Monitor OpenTelemetry for my Python application using an environment variable.
```

### Framework integration

```
Create an Azure Monitor OpenTelemetry setup for my [Flask, Django, or FastAPI] application.
```

### Custom telemetry

```
Add custom traces, metrics, and structured logs for these operations: [describe operations].
```

### Production configuration

```
Design production telemetry settings for [services], including service names, sampling, Azure AD authentication, live metrics, and selected instrumentations.
```

## Limitations

- Does not provision an Application Insights resource or generate a connection string.
- Does not verify telemetry after deployment or diagnose Azure portal configuration.
- Uses placeholder values that must be replaced with environment-specific settings.
- Does not cover advanced privacy, retention, or cost governance.

## Best Practices

- Configure Azure Monitor before importing or initializing instrumented libraries.
- Store connection strings outside source control and use Azure AD authentication for production.
- Set clear service names and tune sampling against traffic, diagnostic needs, and cost.

## Anti Patterns

- Do not commit real Application Insights connection strings to source control.
- Do not initialize telemetry after instrumented frameworks and clients are already active.
- Do not enable full sampling in high-volume production systems without reviewing cost and data volume.

## Security Audit

- Audited at: 2026-07-23T21:58:30.34\+00:00
- Summary: All 35 external-command alerts identify Markdown code fences or inline formatting, not Ruby or shell execution. The two URLs are placeholder Azure Application Insights endpoints in configuration examples, with no hidden destination or exfiltration intent. No prompt injection or other semantic security issue was found.

## Stats

- Views: 91
- Downloads: 10
- Favorites: 0
- Popularity score: 0
