dd-trace-js
dd-trace-js copied to clipboard
Filtering MongoDB span won't work
Hey guys!
I use Mongoose here, and it always tries to create the MongoDB collection, and when this collection already exists MongoDB throws an error that is ignored by Mongoose, but the tracer catches it, and I want it to ignore it, I've tried two ways:
tracer.init({ profiling: true, runtimeMetrics: true })
tracer.use('mongodb-core', { measured: { 'create core.$cmd': false } })
tracer.init({ profiling: true, runtimeMetrics: true })
tracer.use('mongodb-core', { measured: { 'create core\\.\\$cmd': false } })
Both failed. Am I doing something wrong? Shouldn't this make the tracer ignore the spans?
Thanks!
Expected behaviour
The tracer should be filtering the specific span.
Actual behaviour
The span is not filtered.
Steps to reproduce
Setting up Mongoose with a schema with autoupdate enabled, and a DD tracer.
Environment
- Operation system: macOS 13.3.1
- Node.js version: v16
- Tracer version: 4.6.0
- Relevant library versions: Mongoose 7.4.2
Having a similar issue with:
tracer.use('mongodb-core', {
measured: {
"ismaster admin.$cmd": false,
}
});