Nodejs Agent not instrumenting MongoDB calls


(Jaya Kishore) #1

Nodejs Express Agent is not instrumenting mongoDB calls


(Thomas Watson) #2

We should instrument all MongoDB queries, but there can be some things can mean we are not able to.

If you don't mind answering a few questions, then we'll take a look:

  • Which Node.js version are you using?
  • Which version of the Node.js agent are you using?
  • Which MongoDB module (and its version) are you using?

Best,
Thomas


(Jaya Kishore) #3

Which Node.js version are you using?
6.11.2
Which version of the Node.js agent are you using?
1.0.3
Which MongoDB module (and its version) are you using?
"mongodb": "^2.2.11",
"mongoose": "~4.4.3",


(Thomas Watson) #4

That should be instrumented. It sounds like you're requiring mongoose before requiring and starting the APM agent. That's required in order for instrumentation to work. Check that you have added the call to start() at the very top of your applications main file (e.g. if you run node server.js, then server.js is your main file)


(Richard Bell) #5

Hi, I am not able to find out what Elastic's recommended way to connect to MongoDB to my ElasicSearch cloud, this discussion seems to be assuming some basic knowledge, could you please point me in the direction of that basic knowledge.

So far I am assuming I use Beats embedded in a NODE.JS service to send to send MongoDB data to Logstash for ingesting into Cloud Elasticseach where I can then interrogate using Kabina.

Would be grateful for any guidance.

Richard


(Jaya Kishore) #6

Thanks. I moved it above routes and it started working. Thank you


(Thomas Watson) #7

Hi Richard

It sounds like your question is regarding Kibana. Could I get you to post it as a new Topic at https://discuss.elastic.co/c/kibana ?

/thomas


(Thomas Watson) #8

Glad to hear that it helped Jaya :smiley:


(system) #9

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.