Closed
Description
Package + Version
-
@sentry/tracing
: 6.13.3
Version:
6.13.3
Description
Using the mongoose tracing plugin does not produce useful data because it seems to patch functions like .find()
which are usually chained:
Calls usually look like:
const results = await model.find({
...query
})
.sort({ scheduledDate: 1 })
.lean();
However, the plugin attaches to the find
method which returns immediately. Proof of this here:
Instead of attaching to find
, it should attach to exec
.
Reference for properly instrumenting mongoose: https://github.com/aspecto-io/opentelemetry-ext-js/blob/master/packages/instrumentation-mongoose/src/mongoose.ts