A developer is troubleshooting a Python application that invokes a Foundry agent. Its custom application spans reach Application Insights, but SDK model-call spans are missing.
For the next run:
AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACINGis initially unset.OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENTis explicitly set to"false".- The developer can insert one statement before creating the clients.
Model-call spans must be enabled, and message-content capture must remain disabled.
Which statement should the developer insert?
- Blank 1: os.environ["AZURE_EXPERIMENTAL_ENABLE_GENAI_TRACING"] = "true" (correct answer)
Setting the GenAI tracing control to true enables SDK model-call spans while preserving the existing content-capture setting. Setting it to false fails the requirement "Model-call spans must be enabled". Setting the message-content control to true fails "message-content capture must remain disabled" and does not enable the separate GenAI tracing control.
Exporting custom application spans does not establish that SDK model-call tracing is enabled. The reference implementation states that model-call spans are disabled by default and uses a separate environment control to enable them before client creation. Enabling that control leaves the explicitly disabled message-content capture setting unchanged.
- Lab: Task 1 — Trace your agentgithub.com