DataDog / dd-trace-dotnet

.NET Client Library for Datadog APM
https://docs.datadoghq.com/tracing/
Apache License 2.0
443 stars 138 forks source link

No Tracking ADO.NET #1249

Closed SlavkaOnline closed 3 years ago

SlavkaOnline commented 3 years ago

Describe the bug We have that code

            await using var connection = new SqlConnection(databaseContext.Database.GetDbConnection().ConnectionString);
            connection.Open();
            const string sql = @"...";

            await using var command = new SqlCommand(sql, connection);

            await using var reader = await command.ExecuteReaderAsync();
            while (reader.Read())
            {
                var item = new Foo()
                {
                    item1 = reader.GetString(0),
                    item2 = reader.GetInt32(1),
                    item3 = reader.GetString(2),
                };
                results.Add(item);
            }

and we don't see information about that in the flame graph in datalog. Other parts of code use EF Core 3.1 and all fine

Runtime environment (please complete the following information):

kevingosse commented 3 years ago

Hello,

Some netstandard calls are not traced by default. Could you please try setting the DD_TRACE_NETSTANDARD_ENABLED=1 environment variable and see if it fixes your issue?

SlavkaOnline commented 3 years ago

I updated the version to 1.24 and it fixed my problem. Thanks.