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

Remove user data from logs when not in debug/trace mode #17007

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mgodwan
Copy link
Member

@mgodwan mgodwan commented Jan 13, 2025

Description

Remove user data from logs when not in debug/trace mode.

Related Issues

NA

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

❌ Gradle check result for 5443075: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 16eb613: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Signed-off-by: Mohit Godwani <[email protected]>
Copy link
Contributor

❌ Gradle check result for c0a14c7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 8337fd0:

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@mgodwan mgodwan requested a review from VachaShah as a code owner January 14, 2025 05:40
Signed-off-by: Mohit Godwani <[email protected]>
Copy link
Contributor

✅ Gradle check result for 6fbe5fa: SUCCESS

Copy link

codecov bot commented Jan 14, 2025

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 72.23%. Comparing base (8d5e1a3) to head (6fbe5fa).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ava/org/opensearch/action/update/UpdateHelper.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #17007      +/-   ##
============================================
+ Coverage     72.22%   72.23%   +0.01%     
+ Complexity    65356    65324      -32     
============================================
  Files          5301     5301              
  Lines        303774   303775       +1     
  Branches      44016    44017       +1     
============================================
+ Hits         219386   219447      +61     
+ Misses        66453    66355      -98     
- Partials      17935    17973      +38     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -128,7 +129,11 @@ Tuple<UpdateOpType, Map<String, Object>> executeScriptedUpsert(Map<String, Objec

if (operation != UpdateOpType.CREATE && operation != UpdateOpType.NONE) {
// Only valid options for an upsert script are "create" (the default) or "none", meaning abort upsert
logger.warn("Invalid upsert operation [{}] for script [{}], doing nothing...", operation, script.getIdOrCode());
if (logger.isDebugEnabled() || ScriptType.STORED.equals(script.getType())) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why check for stored script here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case of stored script, id gets logged which should be fine as it shouldn't expose user data and continues to help with debugging. For inline scripts in request, we may end up logging the entire user provided script here. Hence, kept this check to ensure some debuggability,

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