Possible reasons for double entries in App Insights logs

Abhishek Sinha 61 Reputation points
2024-07-23T17:26:47.82+00:00

Hello,

I've noticed that all my app insights for app service and Azure function have started showing two entries for every request. These logs have the same operation ID or app insight ID. Can anyone please suggest the possible reasons for these sudden multiple logs with the same ID?

User's image

Thank you,

Abhishek

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,661 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,397 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pinaki Ghatak 3,260 Reputation points Microsoft Employee
    2024-07-24T08:57:27.1666667+00:00

    Hello @Abhishek Sinha

    Please know, there could be multiple reasons for double entries in App Insights logs.

    One of the most common reasons is that the Application Insights SDK is initialized twice in your application. This can happen if you have multiple instances of the SDK installed or if you have manually initialized the SDK in your code.

    Another possible reason could be that your application is making multiple requests to the server for the same operation. This can happen if your application is making multiple AJAX requests or if your application is using a load balancer that is sending multiple requests to the server.

    To troubleshoot this issue, you can start by checking if the Application Insights SDK is initialized multiple times in your application. You can also check if your application is making multiple requests for the same operation.

    If you are still unable to identify the issue, you can try enabling the Application Insights trace logs and reviewing them to see if they provide any additional information.

    You can use the Azure AD B2C extension for VS Code with Azure Application Insights trace explorer to filter the trace log and see the relevant logs based on the local timestamp.

    I hope this helps! Let me know if you have any further questions.


    I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts, but also assist other community members who may be looking for similar solutions.

    0 comments No comments