https://signoz.io logo
#support
Title
# support
d

Divyanshu Negi

03/15/2023, 6:23 AM
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

Ankit Nayan

03/15/2023, 6:27 AM
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

Divyanshu Negi

03/15/2023, 6:32 AM
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

Divyanshu Negi

03/15/2023, 10:05 AM
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

Ankit Nayan

03/15/2023, 11:17 AM
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

Vishal Sharma

03/15/2023, 12:02 PM
@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

Divyanshu Negi

03/15/2023, 12:03 PM
Thanks, I just added that as well for testing, mongoose was not working, will try the version issue
v

Vishal Sharma

03/15/2023, 12:03 PM
Which mongoose version are you using?
d

Divyanshu Negi

03/15/2023, 12:03 PM
"mongoose": "^5.12.7",
v

Vishal Sharma

03/15/2023, 12:05 PM
And
mongodb
version?
And which
opentelemetry/auto-instrumentations-node
version are you using?
d

Divyanshu Negi

03/15/2023, 12:07 PM
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"