Skip to content

Change db.statement to only be collected if there is sanitization#3127

Merged
reyang merged 28 commits intoopen-telemetry:mainfrom
avzis:sanitize_query_by_default
Apr 6, 2023
Merged

Change db.statement to only be collected if there is sanitization#3127
reyang merged 28 commits intoopen-telemetry:mainfrom
avzis:sanitize_query_by_default

Conversation

@avzis
Copy link
Copy Markdown
Contributor

@avzis avzis commented Jan 22, 2023

Add a recommendation to disable DB_STATEMENT by default.

Fixes #3104

Changes

Currently DB_STATEMENT parameter is collecting the full query that is being made to a DB.
I suggest disabling this attribute by default, and giving users the option to opt-in into logging it.

It is also possible to give users a way to supply a sanitization function, in order to display only specific information.

@avzis avzis changed the title Add a recommendation to sanitize DB_STATEMENT in order to prever secu… Add a recommendation to sanitize DB_STATEMENT by default Jan 22, 2023
@avzis avzis requested review from arminru and joaopgrassi and removed request for arminru and joaopgrassi January 26, 2023 11:59
@joaopgrassi joaopgrassi self-requested a review January 27, 2023 16:48
@joaopgrassi
Copy link
Copy Markdown
Member

@avzis I think this looks good.. I had my approve but then saw it's still in draft. Do you want to do more changes?

@carlosalberto
Copy link
Copy Markdown
Contributor

This PR can stop being a draft btw (unless you plan to add more content, as Joao mentioned). That way you should way more reviews ;)

@avzis avzis marked this pull request as ready for review January 29, 2023 08:26
@avzis avzis requested review from a team January 29, 2023 08:26
@trask trask changed the title Disable collecting DB_STATEMENT by default Change db.statement to only be collected if there is sanitization Apr 5, 2023
@carlosalberto
Copy link
Copy Markdown
Contributor

@trask I will merge this and make it part of the April release, unless you think we should hold it for be May one. Let me know what you think.

@trask
Copy link
Copy Markdown
Member

trask commented Apr 5, 2023

@trask I will merge this and make it part of the April release

👍

@reyang reyang merged commit 10f79bd into open-telemetry:main Apr 6, 2023
@reyang reyang mentioned this pull request Apr 6, 2023
jack-berg pushed a commit that referenced this pull request Apr 6, 2023
Relocate the changelog for #3127.
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
schmikei pushed a commit to schmikei/opentelemetry-specification that referenced this pull request Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:semantic-conventions Related to semantic conventions semconv:database spec:trace Related to the specification/trace directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

db.statement sanitization default behavior