Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Instrument your web apps with Azure Application Insights for telemetry and monitoring.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-monitor-opentelemetry-py.md
1# Azure Monitor OpenTelemetry — Python SDK Quick Reference23> Condensed from **azure-monitor-opentelemetry-py**. Full patterns4> (Flask/Django/FastAPI, custom metrics, sampling, live metrics)5> in the **azure-monitor-opentelemetry-py** plugin skill if installed.67## Install8```bash9pip install azure-monitor-opentelemetry10```1112## Quick Start13```python14from azure.monitor.opentelemetry import configure_azure_monitor15configure_azure_monitor()16```1718## Best Practices19- Call configure_azure_monitor() early — before importing instrumented libraries20- Use environment variables for connection string in production21- Set cloud role name for multi-service Application Map22- Enable sampling in high-traffic applications23- Use structured logging for better log analytics queries24- Add custom attributes to spans for better debugging25- Use AAD authentication for production workloads26