pkg/trace/obfuscate: fix bug where obfuscation fails for autovacuum sql text#9649
Merged
pkg/trace/obfuscate: fix bug where obfuscation fails for autovacuum sql text#9649
Conversation
dujuku
requested changes
Oct 26, 2021
dujuku
reviewed
Nov 2, 2021
dujuku
requested changes
Nov 2, 2021
dujuku
left a comment
There was a problem hiding this comment.
I agree with this direction, but one small comment about returning the correct token and not a bind var.
gbbr
reviewed
Nov 3, 2021
Contributor
|
You should add a release note for this. Please make sure to prefix it with |
fec5440 to
4f211c4
Compare
4f211c4 to
45d990b
Compare
Contributor
Author
thanks for review, @gbbr! look OK now? |
zandrewitte
pushed a commit
to StackVista/stackstate-agent
that referenced
this pull request
Nov 17, 2022
…ql text (DataDog#9649) For example, SQL text like `autovacuum: VACUUM ANALYZE fake.table` will no longer fail obfuscation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
we are seeing query text like
autovacuum: VACUUM ANALYZE fake.tablefail obfuscation in the postgres integration check, and we want to be able to ingest things like this for DBM. It is failing due to the fact that it has a:followed by a space char. Because it has a:, the obfuscater assumes it is the beginning of a bind variable. Since the bindVar scanner code does not handle this case, obfuscation fails.simply checking if the char in front of the
:is a space will prevent this from happeningMotivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Describe how to test your changes
Write here in detail how you have tested your changes
and instructions on how this should be tested in QA.
Describe or link instructions to set up environment
for testing, if the process requires more than just
running the agent on one of the supported platforms.
Checklist
changelog/no-changeloglabel has been applied.need-change/operatorandneed-change/helmlabels has been applied if applicable.team/..label has been applied, if known.Triagemilestone is set.Note: Adding GitHub labels is only possible for contributors with write access.