Hi team, I am using MongoDB atlas for our DB hosti...
# support
d
Hi team, I am using MongoDB atlas for our DB hosting, I checked Signoz docs and the doc mentioned the steps in case the DB instance is running in our own server, is there any easy way to send Mongo query time taking data to Signoz dashboard if we use Atlas ?
currently its showing no data for mongo, whereas in 1 service where we use postgresql its displaying the data for that without any extra setup steps.
For mongo
a
so these
Database calls
are generated using traces from client libs used to connect to DB
and these are client latency, the latency reported by Atlas might be different as it only starts timing once Atlas receives the request
I have seen people see mongo metrics in the charts you show
which language and framework do you use? and what is the name of the mongo client package used?
d
Framework for service: NestJS (Express,Node) Programming Language : TS (Typescript) MongoClient ORM : Moongoose (@nestjs/mongoose”: “^9.0.3)
Copy code
this.sdk = new opentelemetry.NodeSDK({
      traceExporter,
      instrumentations: [
        getNodeAutoInstrumentations(),
        new MongoDBInstrumentation({
          enhancedDatabaseReporting: true,
        }),
      ],
      resource: new Resource({
        [SemanticResourceAttributes.SERVICE_NAME]: `${config.get<string>(
          'service.name',
        )}:${process.env.NODE_ENV}`,
      }),
    });
here is the updated code where I just added
Copy code
new MongoDBInstrumentation({
          enhancedDatabaseReporting: true,
        })
to instrument mongo data, but still not getting anything on the Signoz Dashboard
d
added this as well, but still no luck no data on the metrics
Copy code
return this.messageRepo.withTransaction(async (session) => {
      const conversation = await this.conversationRepo.findByIdOrFail(
        conversationId,
        { session },
      );
in the code we are calling this on the API call, which is a mongoose code to query db
a
I have little clue after this. @Vishal Sharma did you ever get your hands with mongoose? @Divyanshu Negi check the supported version. Also, might be a good time to join otel slack or open an issue with https://github.com/open-telemetry/opentelemetry-js-contrib
v
@Divyanshu Negi Please check compatible mongoose version. You don’t need to add
opentelemetry/instrumentation-mongoose
separately if you are using
opentelemetry/auto-instrumentations-node
d
Thanks, I just added that as well for testing, mongoose was not working, will try the version issue
v
Which mongoose version are you using?
d
"mongoose": "^5.12.7",
v
And
mongodb
version?
And which
opentelemetry/auto-instrumentations-node
version are you using?
d
mongoDB
I need to check, access issue with the instance where its running
Copy code
"@opentelemetry/api": "^1.4.0",
    "@opentelemetry/auto-instrumentations-node": "^0.36.3",
    "@opentelemetry/exporter-trace-otlp-http": "^0.35.1",
    "@opentelemetry/resources": "^1.9.1",
    "@opentelemetry/sdk-node": "^0.35.1",
    "@opentelemetry/semantic-conventions": "^1.9.1"