-
Notifications
You must be signed in to change notification settings - Fork 352
[EFCore] [SqlClient] Remove SetDbStatementFor*
options
#3072
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
[EFCore] [SqlClient] Remove SetDbStatementFor*
options
#3072
Conversation
- Remove the `SetDbStatementForText` option and behave as if it were enabled. - Fix copy-pasta for `SetDbQueryParameters` in the README. - Use `TheoryData<T>` for `EventSourceFakeTests`.
- Remove the `SetDbStatementFor*` options from the EntityFramework instrumentation. - Fix-up SqlClient CHANGELOG and README from previous commit.
Remove members from the public API that no nothing on .NET Framework and .NET Standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR tidies up the public API surface for SqlClient and EntityFramework instrumentation by removing configuration options that are now always enabled and consolidating behaviors across platforms.
- Remove
SetDbStatementForText
and related options from SqlClient and EntityFramework instrumentation - Remove non-functional members from SqlClient public API on .NET Framework and .NET Standard
- Fix documentation and use
TheoryData<T>
for improved test maintainability
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
SqlEventSourceTests.netfx.cs |
Convert to TheoryData<T> and remove captureText parameter from test cases |
SqlClientTraceInstrumentationOptions.cs |
Remove SetDbStatementForText property and platform-specific functionality |
SqlClientDiagnosticListener.cs |
Remove conditional logic for SetDbStatementForText and wrap .NET-only features |
EntityFrameworkInstrumentationOptions.cs |
Remove SetDbStatementFor* properties that controlled statement capture |
EntityFrameworkDiagnosticListener.cs |
Remove conditional checks for statement capture options |
Various test files | Update tests to remove captureText /SetDbStatementForText parameters |
README files | Remove documentation for removed options and fix parameter name typos |
CHANGELOG files | Document the removal of these configuration options |
PublicAPI files | Update API surface to reflect removed properties |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3072 +/- ##
==========================================
- Coverage 69.84% 69.80% -0.04%
==========================================
Files 410 410
Lines 16289 16280 -9
==========================================
- Hits 11377 11365 -12
- Misses 4912 4915 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md
Outdated
Show resolved
Hide resolved
Add PR numbers to CHANGELOGs.
Fix grammar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would split removal of Enrich/Filter/etc from this PR and keep here only DBStatement related options
It might be easier to review, especially for the user of library.
* The `SetDbStatementForStoredProcedure` and `SetDbStatementForText` properties have | ||
been removed. Behaviors related to this option are now always enabled. | ||
([#3072](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3072)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* The `SetDbStatementForStoredProcedure` and `SetDbStatementForText` properties have | |
been removed. Behaviors related to this option are now always enabled. | |
([#3072](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3072)) | |
* **Breaking change**: The `SetDbStatementForStoredProcedure` and | |
`SetDbStatementForText` properties have been removed. Behaviors related | |
to this option are now always enabled. | |
([#3072](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3072)) |
listener. | ||
([#3041](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3041)) | ||
|
||
* The `SetDbStatementForText` property has been removed. Behaviors related to this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change note
option are now always enabled. | ||
([#3072](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3072)) | ||
|
||
* The `Enrich`, `Filter` and `RecordException` properties have been removed from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Breaking change note
src/OpenTelemetry.Instrumentation.SqlClient/.publicApi/net8.0/PublicAPI.Unshipped.txt
Outdated
Show resolved
Hide resolved
src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs
Outdated
Show resolved
Hide resolved
They could review the individual commits? I can split it up if needed, but given this PR was already deleting things I figured doing in en-masse was better than having two PRs essentially doing the same thing one after another. |
Add breaking change note to removed items.
Line too long.
Sure, it is not blocking, easier, less clicks to do. Especially in context of removing in partially from .NET Framework only |
Reverts most of b800f6a.
SetDbStatementFor*
options
OpenTelemetry.Instrumentation.SqlClient.SqlClientTraceInstrumentationOptions.SetDbQueryParameters.get -> bool | ||
OpenTelemetry.Instrumentation.SqlClient.SqlClientTraceInstrumentationOptions.SetDbQueryParameters.set -> void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, but I missed the PR this was introduced in. The db.query.parameter.* attribute is not stable and still considered in development. This means it could be renamed or perhaps even removed altogether.
Because of this, I do not think we should expose this configuration publicly in prep for the stable release. I'd be ok gating it behind an experimental environment variable or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Issue created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thanks @martincostello! Just left a comment unrelated to this PR about SetDbQueryParameters
SetDbStatementForText
configuration option #3026Changes were agreed in the SIG on Tuesday 2nd September.
Changes
SetDbStatementForText
option from SqlClient and behave as if it were enabled.SetDbStatementFor*
options from the EntityFramework instrumentation and behave as if they were enabled.SetDbQueryParameters
in the EFCore and SqlClient READMEs.TheoryData<T>
forEventSourceFakeTests
.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes