Application Insights Reporting Duplicate Events for each Server Request

一个人想着一个人 提交于 2020-01-12 23:26:20

问题


I have an API App running under Azure App Service, with Application Insights installed to track server side telemetry of API calls. When viewing Application Insights in the Azure portal, I am seeing two events for every one server call. Each event has an exact duplicate with the same timestamp, response time, telemetry, etc. I have verified that only one event is in the web server logs, so I'm not accidentally calling the same function twice from the client.

Here are a couple of screenshots to illustrate:

What could be causing this? And how can I fix it?


回答1:


There is a one known scenario that may lead to the data duplication:

  1. Application is not onboarded to AI SDK is deployed as an Azure Web App
  2. AI Extension is installed to the app -> after this step you start to receive data without need to modify your code
  3. Later on you decided to use more powerful features of AI let's say custom event tracking and on-boarded your application to AI from VS and re-deployed.

Now you may end up in the situation when HTTP module is registered twice and you start to receive duplicate request data. It happens because AI nuget packages add HTTP module definition in web.config, but extension installation drops additional assembly into your application bin folder that registers HTTP module dynamically during app start - Microsoft.AI.HttpModule.dll (Microsoft.ApplicationInsights.Extensibility.HttpModule.dll in previous versions). To correctly handle this case you need to remove extension leftovers during your application deployment by choosing "Settings->Remove additional files from destination" in case of deploying from VS.



来源:https://stackoverflow.com/questions/37220961/application-insights-reporting-duplicate-events-for-each-server-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!