opentelemetry-js-contrib: Hi, I am not able to trace the mongodb in opentelemetry
I have integrated OpenTelemetry in Nestjs with Jaeger and it’s working fine, but i am not able to trace the MongoDB interaction. I am using below code
const sdk = new opentelemetry.NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'demo-service',
}),
instrumentations: [getNodeAutoInstrumentations({
"@opentelemetry/instrumentation-mongodb":{
enhancedDatabaseReporting: true
}
}),
],
spanProcessor: new BatchSpanProcessor(new JaegerExporter(options))
});
I tried without MongoDB instrument also
instrumentations: [getNodeAutoInstrumentations()],
spanProcessor: new BatchSpanProcessor(new JaegerExporter(options))
});
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 20 (9 by maintainers)
@eharaj1 I don’t know why you don’t get mongo spans. I just want to mention you might be able to use the mongoose instrumentation.
@Flarna Ok let me share the whole code,
tracing.ts
main.ts
app.module.ts
cats.module.ts
cats.controller.ts
cats.service.ts
I hope this is enough to reproduce and check the code.