Skip to content
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

[dbm] add keep_json_path to obfuscator_options #18726

Merged
merged 3 commits into from
Oct 2, 2024
Merged

Conversation

lu-zhengda
Copy link
Contributor

@lu-zhengda lu-zhengda commented Sep 30, 2024

What does this PR do?

This PR adds keep_json_path to obfuscator_options to allow users to control whether JSON paths following JSON operators in SQL statements should be obfuscated. By default, these paths are treated as literals and are obfuscated to ?.

For example, in the SQL statements

-- Extracts JSON object field with the given key
SELECT data::jsonb -> 'name'

The JSON path name following the JSON operator -> would normally be obfuscated to ?, resulting in:

SELECT data::jsonb -> ?

With the keep_json_path option enabled, users can skip this obfuscation, preserving the original JSON path name in the query.

Related change: DataDog/datadog-agent#29655

Motivation

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Changelog entries must be created for modifications to shipped code
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.23%. Comparing base (c1e8530) to head (19544ae).

Additional details and impacted files
Flag Coverage Δ
activemq ?
cassandra ?
hive ?
hivemq ?
hudi ?
ignite ?
jboss_wildfly ?
kafka ?
postgres 93.17% <ø> (+3.87%) ⬆️
presto ?
solr ?

Flags with carried forward coverage won't be shown. Click here to find out more.

@lu-zhengda lu-zhengda merged commit 97eecca into master Oct 2, 2024
38 checks passed
@lu-zhengda lu-zhengda deleted the zhengda.lu/json-path branch October 2, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants