Search code examples
azure-application-insights

Why requests table having duplicate operation_id in application insights?


I would like to ask why Operation_Id is duplicate in Requests table. or what is proper configuration of Application Insights so telemetry will be unique based on opeartion_id ?

requests | where operation_Name contains "GetFuelPriceAsync"

enter image description here

enter image description here


Solution

  • Every request/dependency telemetry item has the following identifiers:

    1. operation_Id is unique per distributed transaction. So it is by design not to be unique per request
    2. id is unique per telemetry item
    3. parent_Id points to a parent's telemetry item id in a distributed transaction identified by operation_Id

    This is based on default behavior of applications instrumented with Application Insights SDKs.

    If your web app is also instrumented with JavaScript Application Insights SDK then it starts a transaction per web page. If this web page does multiple calls to your app service then requests originated from the same web page will have the same operation_Id. If your web page is SPA then the current default behavior is that whole session will be treated as one transaction.