Skip to content

Conversation

@onurtemizkan
Copy link
Member

Which problem is this PR solving?

Resolves: #2281
Resolves: #2516

  • _scrubStatement scrubs all data, including binary data, and with large datasets it can create performance issues.
  • Also, it seems it can also end up scrubbing circular references, which can be added by mongoose. (eg: __parentArray)

Short description of the changes

This PR updates the behaviour as described in @trentm's comment.

  • Sets a depth limit of 10 for recursion inside deeply nested objects. Please let me know if that needs to be configurable.
  • Skips Buffer and Uint8Array data while scrubbing.
  • Skips mongoose-added keys, which are marked as non-enumerable from mongoose versions after 5.13.14.

Note: I was not able to test with mongoose versions under 5.13.14 in the unit tests due to type mismatches between [email protected] and mongoose < 5.13.14 devDependencies.

@onurtemizkan onurtemizkan requested a review from a team as a code owner January 16, 2025 17:24
@github-actions github-actions bot added pkg:instrumentation-mongodb pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found. labels Jan 16, 2025
@codecov
Copy link

codecov bot commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.97%. Comparing base (4f1e605) to head (ce6b786).
Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2653   +/-   ##
=======================================
  Coverage   90.96%   90.97%           
=======================================
  Files         172      172           
  Lines        8137     8144    +7     
  Branches     1649     1652    +3     
=======================================
+ Hits         7402     7409    +7     
  Misses        735      735           
Files with missing lines Coverage Δ
...try-instrumentation-mongodb/src/instrumentation.ts 48.93% <100.00%> (+0.97%) ⬆️

@github-actions
Copy link
Contributor

This package does not have an assigned component owner and is considered unmaintained. As such this package is in feature-freeze and this PR will be closed with 14 days unless a new owner or a sponsor (a member of @open-telemetry/javascript-approvers) for the feature is found. It is the responsibility of the author to find a sponsor for this feature.
Are you familiar with this package? Consider becoming a component owner.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2025

This issue was closed because no owner or sponsor has been found after 14 days

@Matth--
Copy link

Matth-- commented Jul 16, 2025

@onurtemizkan should this be re-opened since you have been added as owner? I see this PR as a fix for both open issues linked to this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:instrumentation-mongodb pkg-status:unmaintained:autoclose-scheduled pkg-status:unmaintained This package is unmaintained. Only bugfixes may be acceped until a new owner has been found.

Projects

None yet

2 participants