brokenchapt3r/astralnexus/azure-monitor-opentelemetry-py
Claude Code and agent skill by brokenchapt3r/astralnexus
- community
Checking that the SKILL.md file is still in the repository.
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".
Install
npx vskill@latest install brokenchapt3r/astralnexus/azure-monitor-opentelemetry-pySKILL.md
The same SKILL.md was published earlier as brokenchapt3r/astralnexus/azure-monitor-opentelemetry-py.
Azure Monitor OpenTelemetry Distro for Python
One-line setup for Application Insights with OpenTelemetry auto-instrumentation.
Installation
Environment Variables
Authentication & Lifecycle
🔑 Two rules apply to every code sample below:1. Prefer `DefaultAzureCredential` for ingestion auth when supported.APPLICATIONINSIGHTS_CONNECTION_STRINGidentifies the target Application Insights resource, andcredential=DefaultAzureCredential(...)provides Microsoft Entra authentication.- Local dev:DefaultAzureCredentialworks as-is.- Production: setAZURE_TOKEN_CREDENTIALS=prod(orAZURE_TOKEN_CREDENTIALS=<specific_credential>) to constrain the credential chain to production-safe credentials.2. Providers are not context managers. Flush and shut down telemetry providers explicitly at process exit so buffers are exported deterministically.Snippets may abbreviate this setup, but production code should always follow both rules.
Quick Start
Explicit Connection String
Pass the connection string explicitly by reading it from the environment variable. The value includes both InstrumentationKey and IngestionEndpoint.
With Flask
With Django
With FastAPI
Custom Traces
Custom Metrics
Custom Logs
Sampling
Cloud Role Name
Set cloud role name for Application Map:
Disable Specific Instrumentations
Enable Live Metrics
Azure AD Authentication
Auto-Instrumentations Included
| Library | Telemetry Type | |
|---|---|---|
| Flask | Traces | |
| Django | Traces | |
| FastAPI | Traces | |
| Requests | Traces | |
| urllib3 | Traces | |
| httpx | Traces | |
| aiohttp | Traces | |
| psycopg2 | Traces | |
| pymysql | Traces | |
| pymongo | Traces | |
| redis | Traces |
Configuration Options
| Parameter | Description | Default | |
|---|---|---|---|
connection_string | Application Insights connection string | From env var | |
credential | Azure credential for AAD auth | None | |
sampling_ratio | Sampling rate (0.0 to 1.0) | 1.0 | |
resource | OpenTelemetry Resource | Auto-detected | |
instrumentations | List of instrumentations to enable | All | |
enable_live_metrics | Enable Live Metrics stream | False |
Best Practices
- Pick sync OR async and stay consistent. Do not mix
azure.xxxsync clients withazure.xxx.aioasync clients in the same call path. Choose one mode per module. - Call `provider.shutdown()` / `force_flush()` at process exit to flush telemetry — providers are not context managers.
- Call configure_azure_monitor() early — Before importing instrumented libraries
- Use environment variables for connection string in production
- Set cloud role name for multi-service applications
- Enable sampling in high-traffic applications
- Use structured logging for better log analytics queries
- Add custom attributes to spans for better debugging
- Use Microsoft Entra authentication for production workloads
Reference Files
| File | Contents | |
|---|---|---|
| references/capabilities.md | Additional non-hero capabilities, operation-group coverage, and production checklists. | |
| references/non-hero-scenarios.md | Dedicated non-hero examples for secondary/advanced scenarios. |
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingsrc/AstralNexus/skills/vendor/microsoft/azure-monitor-opentelemetry-py/SKILL.md
Popularity
- Repository stars
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/brokenchapt3r/astralnexus/azure-monitor-opentelemetry-py)