-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add DBM SQL obfuscator options #9639
Add DBM SQL obfuscator options #9639
Conversation
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.
approved for docs!
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. |
…/github.com/DataDog/integrations-core into alex.barksdale/quantize-config-option-mysql
@@ -377,7 +377,7 @@ def test_statement_metrics_with_duplicates(aggregator, dbm_instance, datadog_age | |||
|
|||
mysql_check = MySql(common.CHECK_NAME, {}, instances=[dbm_instance]) | |||
|
|||
def obfuscate_sql(query): | |||
def obfuscate_sql(query, options=None): |
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.
Probably worth having a test with the option set.
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.
Totally, however, in order to create a proper test for methods that interact with C bindings that communicate with the agent directly would require a hard dependency (rtloader) which would have some overhead to do because it would need to touch the build system in some way. Methods like this (agent stub methods) are difficult to test because of the disconnect, but I agree that it would be nice, it's just currently not worth it as we'd like to get this in before the 7.30 freeze.
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.
LGTM from agent-core perspective!
@@ -65,7 +65,7 @@ def write_persistent_cache(self, key, value): | |||
def read_persistent_cache(self, key): | |||
return self._cache.get(key, '') | |||
|
|||
def obfuscate_sql(self, query): | |||
def obfuscate_sql(self, query, options=None): |
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.
Let's do this in a separate PR https://datadoghq.dev/integrations-core/guidelines/pr/#separation-of-concerns
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.
Done: #9662
What does this PR do?
The obfuscation library within the datadog-agent is being updated to support options to configure how the obfuscator behaves. This PR adds an obfuscator option (
quantize_sql_tables
) to the MySQL instance config and implements the necessary changes to use options on the integration side. For more context, please refer to this PR that is responsible for implementing the obfuscator options on the agent.Motivation
This integration implements the obfuscator library located in the datadog-agent and it needs to be updated to support the new options functionality. For a full explanation how this integration implements the library, please refer to this PR.
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached