Microsoft Azure AI Engineer Associate AI-102 Practice Question
You deploy a Python web API that queries an Azure OpenAI gpt-35-turbo deployment. You must capture the following for every completion request so that your operations team can investigate latency spikes and analyze prompt quality in Application Insights:
total processing time on the Azure OpenAI side
number of prompt and completion tokens used
full prompt text and model response (truncated to 8 kB)
You plan to use OpenTelemetry-based distributed tracing, which is already configured to export spans to the same Application Insights instance that the rest of the web API uses. Which single action should you perform in the Python project to ensure the required data is captured for each call to Azure OpenAI?
Add correlation ID headers manually to every request and write a custom middleware that records timings and headers.
Enable diagnostic logging on the Azure OpenAI resource and configure a Log Analytics workspace.
Add the azure-core-tracing-opentelemetry package and import its automatic patching helper at application startup.
Install the opencensus-ext-azure package and configure the Azure exporter.
The Azure SDKs emit OpenTelemetry spans only when a tracing implementation is attached. Installing and importing the azure-core-tracing-opentelemetry package automatically patches all Azure SDK client libraries-including azure-ai-openai-to create detailed spans for each service call. These spans include service-side latency (the value of the "request_process_time" response header), token usage (values in the "x-ms-usage-tokens-prompt" and "x-ms-usage-tokens-completion" headers), and the request/response bodies up to 8 kB. Because your project already initialises an OpenTelemetry exporter for Application Insights, adding this package is the only required step. Other options either capture only logs, require manual span creation, or send data to a different monitoring solution, so they do not meet the requirements.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is azure-core-tracing-opentelemetry?
Open an interactive chat with Bash
How does OpenTelemetry-based distributed tracing work?
Open an interactive chat with Bash
What kind of data does the Azure OpenAI SDK provide for monitoring?
Open an interactive chat with Bash
Microsoft Azure AI Engineer Associate AI-102
Implement generative AI solutions
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .