dotnet / SqlClient

Microsoft.Data.SqlClient provides database connectivity to SQL Server for .NET applications.
MIT License
852 stars 286 forks source link

SQL dependency calls stopped getting logged when we migrated our SQLClient from System.Data.SqlClient to Microsoft.Data.SqlClient #2716

Open mishas2303 opened 3 months ago

mishas2303 commented 3 months ago

Describe the bug

We recently migrated our sdk from System.Data.SqlClient to Microsoft.Data.SqlClient - version="5.2.0" and EF framework - Microsoft.EntityFramework.SqlServer" version="6.5.0-preview2-24180-01

And since then SQL Dependency calls have completely stopped since the date we upgraded to Microsoft.Data.SqlClient.

To reproduce

Attached the solution. For instrumentation key/sql connection connection string, feel free to ping me. I am an MS employee TestSQLDependencyLogging.zip

Expected behavior

SQL dependency should be logged

These are the App Insights versions we're using which we didn't change "Microsoft.ApplicationInsights" version="2.9.1 "Microsoft.ApplicationInsights.Agent.Intercept" version="2.4.0" "Microsoft.ApplicationInsights.DependencyCollector" version="2.9.1" "Microsoft.ApplicationInsights.PerfCounterCollector" version="2.9.1" "Microsoft.ApplicationInsights.Web" version="2.9.1" "Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.9.1" Microsoft.ApplicationInsights.WindowsServer" version="2.9.1"

Is there any additional config or ApplicationInsights version update that we need to do?

ErikEJ commented 3 months ago

Your application insights dependency predates Microsoft.Data.SqlClient, so you really need to update to latest