-
Notifications
You must be signed in to change notification settings - Fork 67
Dependency Parent IDs not set correctly in 2.8.0 #1277
Comments
Can you share a repro app for us to investigate? |
Sure, here is how I put together a minimum reproduction:
using var conn = new SqlConnection(connectionString);
var junk = await conn.QueryAsync("SELECT * FROM Pewp"); // Dapper, ADO.NET, EF core, doesn't matter It seems like this does not affect all dependency types. I notice it with SQL and ServiceBus but HTTP seems OK. With 2.8.0 the parent ID values will contain the |
@aarondandy Got it! Thanks for sharing! For SQL the parent id is set to Activity.Id, which will be in new w3c format of 00. @lmolkova This should be fixed to set parentid in |trace.span. format https://github.com/microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/Common/W3C/W3CUtilities.cs#L49? |
I just noticed this issue yesterday when looking at the github code and was left scratching my head. What's in master right now:
What's in develop right now:
It looks like at some point someone found and fixed this bug. (Sorry I'm not git/github expert, so maybe this was obvious to everyone else. I also don't know how to find exactly when/where this was fixed.) |
Just to be clear, this is a problem on netcore 2.2 as well which is where I first noticed it. |
@mqtwinter The actual file in master is: https://github.com/microsoft/ApplicationInsights-dotnet-server/blob/master/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticSourceListener.cs#L350 This (https://github.com/microsoft/ApplicationInsights-dotnet-server/blob/master/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnosticSourceListener.cs) is a leftover file somehow not deleted in a refactorings. |
@aarondandy Yes the issue is arising from using new System.Diagnostics.DiagnosticSource, and switching to new W3C Format in Activity. You can try the workaround by running the following snippet in your startup.cs configureservices.
|
Tagging as bug. |
This will be fixed and released as a ".1" release. |
Microsoft.ApplicationInsights.AspNetCore 2.8.1 seems to fix this issue. |
Dependency Parent IDs not set correctly in 2.8.0. Reverting from 2.8.0 back to 2.7.1 is a workaround for me.
Repro Steps
Actual Behavior
A request with a Request Id of
|af71200102f65e46b9c58cd203474526.f0f605963ec9474d.
will have a dependency (SQL for example) with a Parent Id of00-af71200102f65e46b9c58cd203474526-f0f605963ec9474d-00
Expected Behavior
The Parent Id matches the Request Id of the parent.
Version Info
SDK Version (version of https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore) : 2.8.0
.NET Core Version (TargetFramework in your .csproj file) : 3.0 or 2.2
How Application was onboarded with SDK(Installed Nugets/VisualStudio/Azure WebAppExtension) : nuget
OS : Windows
Hosting Info (IIS/Azure Web Apps/Running From Visual Studio etc) : Yes.
The text was updated successfully, but these errors were encountered: