Skip to content

Commit

Permalink
[SqlClient] Clarify behavior when using System.Data.SqlClient with …
Browse files Browse the repository at this point in the history
….NET Framework (#3937)

* Add System.Data.SqlClient clarification for netfmk

* wrap comment

* readme update

* readme

* Update src/OpenTelemetry.Instrumentation.SqlClient/README.md

Co-authored-by: Timothy Mothra <tilee@microsoft.com>

* resolve PR comments

Co-authored-by: Timothy Mothra <tilee@microsoft.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
  • Loading branch information
3 people authored Nov 29, 2022
1 parent 6c73e36 commit e376aef
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/OpenTelemetry.Instrumentation.SqlClient/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ using var tracerProvider = Sdk.CreateTracerProviderBuilder()
.Build();
```

**Note:** When using the built-in `System.Data.SqlClient` only stored procedure
command names will ever be captured. When using the `Microsoft.Data.SqlClient`
NuGet package (v1.1+) stored procedure command names, full query text, and other
command text will be captured.

### EnableConnectionLevelAttributes

**Note:** EnableConnectionLevelAttributes is supported on all runtimes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,15 @@ public class SqlClientInstrumentationOptions
/// <item>On .NET and .NET Core SetDbStatementForText only applies to
/// <c>SqlCommand</c>s with <see cref="CommandType.Text"/>.</item>
/// <item>On .NET Framework SetDbStatementForText applies to all
/// <c>SqlCommand</c>s regardless of <see cref="CommandType"/>. Use
/// <c>SqlCommand</c>s regardless of <see cref="CommandType"/>.
/// <list type="bullet">
/// <item>When using <c>System.Data.SqlClient</c> use
/// SetDbStatementForText to capture StoredProcedure command
/// names.</item>
/// <item>When using <c>Microsoft.Data.SqlClient</c> use
/// SetDbStatementForText to capture Text, StoredProcedure, and all
/// other command text.</item>
/// </list></item>
/// </list>
/// </para>
/// </remarks>
Expand Down

0 comments on commit e376aef

Please sign in to comment.