microsoft / ApplicationInsights-dotnet

ApplicationInsights-dotnet
MIT License
565 stars 287 forks source link

Azure Application Insights showing duplicate entries #2509

Closed DeepMalh44 closed 11 months ago

DeepMalh44 commented 2 years ago

We are using Azure Function App, Azure SQL server and API management a very simply solution and we are reporting all our telemetry back to Application Insights. Right now we are trying to review some performance issue and what we are observing is that Application Insights is showing duplicate records (screenshot below). Anyone know how we can avoid this duplicate entries and have a clean hierarchical flow of telemetry data?

img1

UPDATE: 01/05/2022: We created a new Application Insights Instance and just created out of the box Function App From Azure portal and attached this instance of App Insights (no custom code nothing just sample code) and still we see DUPLICATE telemetry for that new function App as shown below from the App Insights logs:

img2

Also posted the same issue here: https://stackoverflow.com/questions/70475470/azure-application-insights-showing-duplicate-entries

cijothomas commented 2 years ago

If you're running the application in Azure Functions, please file an issue here.

DeepMalh44 commented 2 years ago

hello @cijothomas this issue is not alone with Function Apps, this is happening across all azure service we have on board .. and Telemetry for all these Azure components is getting duplicated, I just posted my question with simple one service (function app in this case) but in my environment I have SQL Server logs, Service bus, functions apps, etc.. and Telemetry is duplicated for everything.

cijothomas commented 2 years ago

Can you share a non-function repro app showing this behavior for us to review if the config is correct? Also check this FAQ: https://docs.microsoft.com/en-us/azure/azure-monitor/app/telemetry-channels#does-the-application-insights-channel-guarantee-telemetry-delivery-if-not-what-are-the-scenarios-in-which-telemetry-can-be-lost

Additionally, the duplication is possible in backend as well. (you'll need to open support ticket to get someone to investigate that)

Elsa2604 commented 2 years ago

Same issue for me : Duplication of log entries in application insights. I'm using bot framework composer and i have configured the instrumentation key and connection string in advanced app setting json and publishing profile. AppInsight

Sudheerkumar commented 2 years ago

Hi, This issue still persists any possible resolution?

flatproject commented 2 years ago

Same problem here for nearly a year. All logs are duplicating.

image

Elsa2604 commented 2 years ago

If your using workspace application insights, refer this https://docs.microsoft.com/en-us/answers/questions/775202/workspace-based-app-insights-vs-diagnostic-setting.html
Usage of both both diagnostic settings and workspace-based Application Insights cause double data

torbennehmer commented 2 years ago

I can confirm this behavior in my case as well (no Azure function, but a customized Dynamics 365 Finops instance). Especially parallelized (10+ Threads) tasks emit the effect. There is a lot of data, that doesn't get duplicated, that tends not to run parallelized as well. We might have a synchronization problem here. Unfortunately, this also means that I have not yet been able to explicitly trigger the effect on my installation.

mis046 commented 2 years ago

Our application have duplicate logs & custom events in our Application Insights (running in workspace-based mode with another Log Analytics). I confirmed that we don't have a diagnostic setting that forwards the logs.

We are running on Java and are using 'com.microsoft.azure:applicationinsights-runtime-attach:3.3.1' & 'com.microsoft.azure:applicationinsights-core:2.6.4'. But still want to share here. Maybe this isn't an agent specific problem.

carolineAgicap commented 2 years ago

We are having the same issue : we have duplicated logs while other applications with the same ApplicationInsight commection string do not. Also it is not always duplicated, and not only 2 times but I have seen up to 5 times (same timestamp, duration, & all properties)

fifuente commented 1 year ago

I'm having a similar issue where I see the same log twice in an Azure Function slot. One log has set the SessionId and ParentId while the other does not.

Also noticed that the SDKVersion seems to be different in the telemetry:

image image

I wonder what the problem is since I have the same code deployed to two different slots (Prod and PPE), and only the PPE slot is having this issue.

github-actions[bot] commented 12 months ago

This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.

wpinto-ahc commented 10 months ago

Does anyone know why this is happening? I have the same problem, but the only duplicated entries are coming from exceptions

hybridtechie commented 8 months ago

Same issue happening for me - Logs from APIM being duplicated. No diagnostic setting present.