microsoft / ApplicationInsights-dotnet

ApplicationInsights-dotnet
MIT License
565 stars 287 forks source link

Some fields of dependency telemetry are missing when dependency is invoked asynchronously #2749

Open a-stankevich opened 1 year ago

a-stankevich commented 1 year ago

Describe the bug

While processing request application can make calls to external dependencies, like HTTP or SQL servers. When such calls are done in a synchronous manner (e.g. using WebClient.DownloadData(), EF DbSet.ToList()) corresponding dependency telemetry includes Operation Id as well as Operation Name, User Id, Session Id from request. When such calls are done in asynchronous manner (e.g. using HttpClient.GetAsync(), EF DbSet.ToListAsync()) corresponding dependency telemetry includes only Operation Id, but not Operation Name, User Id, Session Id from request.

This happens at least for HTTP, SQL dependencies. Example screenshot of dependency telemetry for one request: image

To Reproduce

The issue is reproducible with ASP.Net MVC / Web API: https://github.com/a-stankevich/MissingTelemetry The issue does not seem to happen with ASP.Net Core.

github-actions[bot] commented 11 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.

a-stankevich commented 11 months ago

I'd like this to stay open please