Skip to content

SqlClient instrumentation doesn't work for Microsoft.Data.SqlClient under .NET Framework #1597

@mbakalov

Description

@mbakalov

Using latest opentelemetry-dotnet, target net461 and use Microsoft.Data.SqlClient nuget package.

SQL activities are not captured.

EDIT: when submitting this issue I first incorrectly assumed the netfx Sql instrumentation relied on DiagnosticSource events, but that is not the case.

Microsoft.Data.SqlClient on netfx uses the WriteBeginExecuteEvent/WriteEndExecuteEvent methods that operate on the EventSource, similar to the System.Data.SqlClient on netfx.

The reason our instrumentation doesn't pick it up is because in Microsoft.Data.SqlClient this event source is named "Microsoft.Data.SqlClient.EventSource", but the instrumentation only listens to the "Microsoft-AdoNet-SystemData".

Note that we have tests for Microsoft.Data.SqlClient and when running against a docker instance of SQL Server on net461 they do actually fail.

cc @CodeBlanch

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions