opentelemetry-dotnet-contrib icon indicating copy to clipboard operation
opentelemetry-dotnet-contrib copied to clipboard

Feature/db statement sanitizer #3554

Open alexander-kucherov opened this issue 3 weeks ago • 4 comments

My proposal for #3554 3554

Changes

Introduce a configurable "db-statement sanitizer" option for .NET database instrumentations and connect it to the existing sanitizeQuery parameter:

  1. Add a public configuration option, for example on the relevant instrumentation options type(s), such as:

  2. Wire this option into the code path that calls ApplyConventionsForQueryText, passing sanitizeQuery: options.DbStatementSanitizerEnabled.

  3. Keep DbStatementSanitizerEnabled defaulting to true to preserve the current safe-by-default behavior and stay consistent with the OpenTelemetry guidance that db.statement should generally be sanitized by default.

Merge requirement checklist

  • [x] CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • [x] Unit tests added/updated
  • [ ] Appropriate CHANGELOG.md files updated for non-trivial changes
  • [ ] Changes in public API reviewed (if applicable)

alexander-kucherov avatar Nov 24 '25 09:11 alexander-kucherov

CLA Signed

The committers listed above are authorized under a signed CLA.

  • :white_check_mark: login: alexander-kucherov / name: Alexander Kucherov (10a88357bcf1f71cf778ecf39ba14eef74308103, 88bc1ebd1b7058e39a697a8181726e8ac109f317, f4c711b2bce3c1179c7139ecc23ca445b4e5fce4)

This PR was marked stale due to lack of activity. It will be closed in 7 days.

github-actions[bot] avatar Dec 02 '25 03:12 github-actions[bot]

@martincostello just a gentle ping to see if you could review this PR when it’s convenient.​

alexander-kucherov avatar Dec 02 '25 05:12 alexander-kucherov

Will review properly if we decide we do want to implement this functionality.

martincostello avatar Dec 02 '25 07:12 martincostello

This PR was marked stale due to lack of activity. It will be closed in 7 days.

github-actions[bot] avatar Dec 10 '25 03:12 github-actions[bot]