Trace distributed systems with OpenTelemetry
Unlock the complete study guide + 1,040 practice questions across 16 full exams.
Bundled into the existing Developing AI Cloud Solutions on Azure premium course — no separate purchase.
14-day money-back guarantee — no questions asked.
Included in this chapter:
- From a unit of work to a row you can query
- A span on the wire, a request in the portal
- Distro, SDK, exporter, instrumentation library
- Two ways to instrument without writing a span
- Writing your own spans, and reporting your own errors
- Four places to cut volume, and they multiply
- A sampler built to keep traces whole
- Live Metrics, the channel that never reaches a table
- When the dashboard says success and the caller says failure
- Telling the traps apart
Three ways to get Python telemetry into Application Insights
| Question | App Service autoinstrumentation | In-code distro | Exporter on your own TracerProvider |
|---|---|---|---|
| How it is turned on | App settings only: connection string plus the agent extension version. No code change. | configure_azure_monitor() called once at startup, in your own code. | You build a TracerProvider, add a BatchSpanProcessor wrapping AzureMonitorTraceExporter, and register it. |
| Where it runs | Linux App Service apps deployed as code. Custom containers are not supported. | Anywhere your Python process runs. | Anywhere your Python process runs. |
| Which libraries it instruments | Django, FastAPI, Flask, psycopg2, requests, urllib, urllib3, plus community packages you add to requirements.txt. | The same bundled set, each individually switchable by name. | Nothing until you add instrumentation libraries yourself. |
| Logging | Collects from the root logger. | logger_name selects the namespace, which keeps SDK logs out of your telemetry. | You wire the log pipeline yourself, or send no logs. |
| Live Metrics | Not available. | Enabled by default. | Not part of the exporter; the Azure Monitor sampler is required for compatibility. |
| Entra authenticated ingestion | On the published unsupported list for Python on App Service. | Supported. | Supported through the exporter's credential option. |
| Sampler | Configured through OTEL_TRACES_SAMPLER_ARG as an app setting. | sampling_ratio or traces_per_second, or the OTEL_TRACES_SAMPLER pair. | Yours to add. The exporter's own documentation states the Application Insights sampler must be used whenever the exporter is. |
Decision tree
Cheat sheet
Unlock with Premium — includes all practice exams and the complete study guide.
Also tested in
References
- OpenTelemetry traces
- Add and modify OpenTelemetry in Application Insights
- Telemetry correlation in Application Insights
- OpenTelemetry context propagation
- Migrate to workspace-based Application Insights resources
- OpenTelemetry distributions
- Enable OpenTelemetry in Application Insights
- Application Insights connection strings
- Migrate from instrumentation keys to connection strings
- Azure Monitor OpenTelemetry Exporter client library for Python
- Configure automatic data collection and resource detectors for Azure Monitor OpenTelemetry
- Azure Monitor OpenTelemetry Distro client library for Python
- Enable Application Insights for Python applications on Azure App Service
- Microsoft Entra authentication for Application Insights
- Troubleshoot OpenTelemetry issues in Python
- Filter OpenTelemetry in Application Insights
- Sampling in Application Insights with OpenTelemetry
- Data collection transformations in Azure Monitor
- Create a transformation in Azure Monitor
- Application Insights FAQ
- Configure OpenTelemetry in Application Insights
- Live metrics: monitor and diagnose with 1-second latency
- Application Insights telemetry data model
- OpenTelemetry trace SDK specification