A failed agent step must be traced from a Service Bus message through Application Insights. What correlation practice should developers apply?
Select an answer to reveal the explanation.
Short Explanation
Correlation is writing the same case number on the Service Bus envelope and the Application Insights clipboard—when an agent step fails, investigators can match the ticket to the trace.
Full Explanation
Failed agent steps that begin as Service Bus work must be traceable in Application Insights end to end. Developers should propagate Service Bus message identifiers (MessageId, CorrelationId, Diagnostic-Id / trace context where applicable) into the Application Insights operation context and custom properties. Then a failed tool call or enrichment exception can be joined back to the exact queue message and municipal case, enabling faster incident response.
Logging unrelated random GUIDs in Insights with no link to the Service Bus MessageId fails correlation: you have noise, not a join key. Disabling distributed tracing for all municipal AI messaging paths removes the primary production diagnostic tool. Correlating only by wall-clock hour without message or operation ids produces ambiguous matches when many jobs run concurrently.
Exam caveat: use W3C trace context / Application Insights operation id conventions consistently across Functions, Container Apps, and SDK clients; do not invent a parallel id scheme per team. Scrub sensitive resident payloads from traces. Operational check: process a test message, force a failure in an agent step, open Application Insights, find the exception, and confirm you can navigate to the same MessageId / operation that sat on Service Bus.