You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insert/update mongo documents that have large datasets (BinData, Arrays, etc).
Namely using GridFS to upload large files (which are chunked into 255KiB documents)
What did you expect to see?
GridFS upload of a 430MiB file takes around a minute (as of instrumentation-mongodb: 0.44.0)
What did you see instead?
GridFS upload of a 430MiB file takes over 5 minutes (as of instrumentation-mongodb: 0.45.0 and after)
It is iterating the mongo cmd operation (which includes the document) recursively through nested objects and arrays, namely with disregard of the operation (for GridFs upload) to contain binary data upwards of (by default) 261120 items in an Array/BinData/Buffer. I will also note, the implementation would not (IMO) handle Date, ObjectId, etc. correctly either.
The text was updated successfully, but these errors were encountered:
DanStory
changed the title
instrumentation-mongodb: perfromance degradation due to _scrubStatement
instrumentation-mongodb: performance degradation due to _scrubStatement
Nov 4, 2024
What version of OpenTelemetry are you using?
What version of Node are you using?
What did you do?
Insert/update mongo documents that have large datasets (BinData, Arrays, etc).
Namely using GridFS to upload large files (which are chunked into 255KiB documents)
What did you expect to see?
GridFS upload of a 430MiB file takes around a minute (as of
instrumentation-mongodb: 0.44.0
)What did you see instead?
GridFS upload of a 430MiB file takes over 5 minutes (as of
instrumentation-mongodb: 0.45.0
and after)Additional context
We were able to deduce that the introduce of
_scrubStatement
as being the culprit: https://github.com/open-telemetry/opentelemetry-js-contrib/pull/1728/files#diff-0dd65d8fe0cee39d03f2ddd06f60730b20553e33521842fdb553056bfc1c8231R929It is iterating the mongo cmd operation (which includes the document) recursively through nested objects and arrays, namely with disregard of the operation (for GridFs upload) to contain binary data upwards of (by default)
261120
items in an Array/BinData/Buffer. I will also note, the implementation would not (IMO) handle Date, ObjectId, etc. correctly either.The text was updated successfully, but these errors were encountered: