-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic instrumentation of System.Data.SqlClient not working. #3047
Comments
Sample Program with which I can reproduce the issue: using System.Data.SqlClient;
System.Diagnostics.ActivitySource activitySource = new System.Diagnostics.ActivitySource("MyApp.SqlClientTest", "1.0.0");
using var activity = activitySource.StartActivity("SqlClientTest.Main");
using (var sqlconnection = new SqlConnection(new SqlConnectionStringBuilder
{
InitialCatalog = "test",
DataSource = "np:(local)",
Encrypt = false,
}.ConnectionString))
{
sqlconnection.Open();
using var cmd = sqlconnection.CreateCommand();
cmd.CommandText = "select name from testtable";
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
Console.WriteLine(reader.GetString(0));
}
}
} <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="7.0.2" />
</ItemGroup>
</Project> Register-OpenTelemetryForCurrentSession -OTelServiceName SqlClientTest
$env:OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES="MyApp.*"
./MyTestApp.exe When I switch to Microsoft.Data.SqlClient, the spans appear correctly in jaeger. dotnet version 6.0.415 |
Looks like Line 30 in d470e80
|
Possibly caused by open-telemetry/opentelemetry-dotnet-contrib#1739. |
I don't think so, I added |
Seems correct cause: we have not included https://www.nuget.org/packages/System.Data.SqlClient/ for .NET Core, instead |
Bug Report
Symptom
Describe the bug
No Spans are created for SQL queries for my ASP.NET Core app with System.Data.SqlClient 4.8.5.
Expected behavior
Spans for SQL queries are created.
Runtime environment (please complete the following information):
Additional context
OpenTelemetry.Instrumentation.SqlClient
, the spans are generated correctlyMicrosoft.Data.SqlClient
, the spans are generated correctlyI found only these two lines regarding SqlClient in the log files:
The text was updated successfully, but these errors were encountered: