Skip to content
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

[SqlClient] Clarify behavior when using System.Data.SqlClient with .NET Framework #3937

4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.SqlClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.Build();
```

On .NET Framework, `System.Data.SqlClient` only exposes stored procedure names and
not the full query text. On `Microsoft.Data.SqlClient`, stored procedure command
or full query text will be collected based on `SqlCommand.CommandType`.
vishweshbankwar marked this conversation as resolved.
Show resolved Hide resolved

### EnableConnectionLevelAttributes

**Note:** EnableConnectionLevelAttributes is supported on all runtimes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public class SqlClientInstrumentationOptions
/// <c>SqlCommand</c>s regardless of <see cref="CommandType"/>. Use
/// SetDbStatementForText to capture Text, StoredProcedure, and all
/// other command text.</item>
/// <item>When using <c>System.Data.SqlClient</c> on .NET Framework, the
/// instrumentation will only capture <c>sqlCommand.CommandText</c> for
/// <see cref="CommandType.StoredProcedure"/> commands.</item>
vishweshbankwar marked this conversation as resolved.
Show resolved Hide resolved
/// </list>
/// </para>
/// </remarks>
Expand Down