These samples demonstrate how to enable and customize OpenTelemetry tracing for the Azure AI Voice Live SDK.
Text-mode samples: These samples use text mode (
Modality.TEXT) so they run without a microphone. The telemetry setup code is isolated inside region tags (e.g.,# <enable_console_tracing>/# </enable_console_tracing>) and can be copied into any existing Voice Live application — including audio-mode quickstarts and demos in this repo.
- Enable telemetry and tracing for Voice Live — full how-to guide on Microsoft Learn
| File | Region tag(s) | Description |
|---|---|---|
telemetry-console.py |
enable_console_tracing |
Export Voice Live traces to the console |
telemetry-azure-monitor.py |
enable_azure_monitor_tracing |
Export traces to Azure Monitor / Application Insights |
telemetry-custom-attributes.py |
custom_span_processor, add_custom_processor |
Add custom span attributes for correlation |
telemetry-content-recording.py |
enable_content_recording |
Enable full message payload recording in traces |
Copy the code between the region tags into your own sample. For example, to add console tracing to any Voice Live app, copy the code inside # <enable_console_tracing> / # </enable_console_tracing> from telemetry-console.py and place it before your connect() call.
- Python 3.9 or later
- An Azure AI Services or Speech resource
- Complete one of the Voice Live quickstarts first:
-
Install dependencies:
pip install -r requirements.txt
-
Set environment variables:
export AZURE_VOICELIVE_ENDPOINT="https://<your-resource>.services.ai.azure.com" export AZURE_VOICELIVE_API_KEY="<your-api-key>"
For the Azure Monitor sample, also set:
export APPLICATIONINSIGHTS_CONNECTION_STRING="<your-connection-string>"
-
Run any sample:
python telemetry-console.py