Describe the bug
According to https://github.com/DataDog/dd-trace-dotnet/releases/tag/v1.21.0 support was added for automatic instrumentation of Microsoft.Data.SqlClient.SqlCommand.
This works as expected as long as the SqlCommand is not inside a Microsoft.Data.SqlClient.SqlTransaction. Any SqlCommand's in a SqlTransaction do not have traces.
To Reproduce
Steps to reproduce the behavior:
- Create a .NET 5 Console App
- Add the
Microsoft.Data.SqlClient and Datadog.Trace NuGet packages
- Manuall start a trace and execute a query against SQL Server e.g.:
using (var traceScope = Tracer.Instance.StartActive("some.operation"))
{
await using var connection = new SqlConnection(_configuration.Value.SqlServerConnectionString);
connection.Open();
await using SqlTransaction transaction = connection.BeginTransaction();
await using var command = new SqlCommand(@"..", connection, transaction);
await using (SqlDataReader reader = await command.ExecuteReaderAsync())
{
if (reader.Read())
{
}
}
transaction.Commit();
}
Expected behavior
The query is expected to be visible in the corresponding APM trace
Runtime environment (please complete the following information):
- Instrumentation mode: manual
- Tracer version: 1.27.1
- OS: ASP.NET docker image on GCP (mcr.microsoft.com/dotnet/aspnet:5.0)
- CLR: .NET 5
Additional context
Oskar Rittsél asked me to create this ticket.
Describe the bug
According to https://github.com/DataDog/dd-trace-dotnet/releases/tag/v1.21.0 support was added for automatic instrumentation of
Microsoft.Data.SqlClient.SqlCommand.This works as expected as long as the
SqlCommandis not inside aMicrosoft.Data.SqlClient.SqlTransaction. AnySqlCommand's in aSqlTransactiondo not have traces.To Reproduce
Steps to reproduce the behavior:
Microsoft.Data.SqlClientandDatadog.TraceNuGet packagesExpected behavior
The query is expected to be visible in the corresponding APM trace
Runtime environment (please complete the following information):
Additional context
Oskar Rittsél asked me to create this ticket.