Reputation: 169
How does Azure Application Insights assigns the same operation ID to various events?
Upvotes: 1
Views: 968
Reputation: 1900
I assume we are talking about Web SDK where ApplicationInsights uses http module to track requests, exceptions and dependencies. On request begin in the module unique id is saved in the HttpContext. When new items are tracked in the scope of the same request HttpContext.Current is checked; if it is not null and has id, it is used as operation id. The obvious limitation of this approach is that it will not be prorogated to async operations since HttpContext.Current would be null.
For async operations you can use operations API that would require code modifications from your side. Documentation about operations API: https://azure.microsoft.com/documentation/articles/app-insights-api-custom-events-metrics/#operation-context
Upvotes: 2