Nodejs missing transaction trace

Kibana version:
v7.12.1

Elasticsearch version:
v7.12.1

APM Server version:
v7.12.1

APM Agent language and version:
nodejs : 12
fastify : 2.11.0
mongoose : 5.11.1
elastic-apm-node : 3.14.0
ioredis : 4.14.1

Browser version:
Google Chrome 90.0.4430.85

Original install method (e.g. download page, yum, deb, from source, etc.) and version:

Fresh install or upgraded from other version?
fresh install

Is there anything special in your setup? For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Steps to reproduce:

  1. Launch APM server, elastic search, and Kibana containers
  2. Install Node APM in the server
  3. Call API using postman
  4. Browse the application

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

I'm trying to build a APM tool for server monitoring (server performance, transaction tracing... etc). It is easy to build APM tool, but I can't get some transaction detail like distributed span.

in elastic document, mongoose version used to my project is not supported.

let me know any solution to get transaction tracing.
thank you.

@Max_Lee Hi!

Let me try to make sure I understand what you are saying is the problem. Is the problem that you don't see a span for a query to MongoDB using mongoose? Here is a small example using mongoose@5.11.1 (like you), but using express instead of fastify (in case that matters, but it shouldn't):

var apm = require('elastic-apm-node').start({
  serviceName: 'mongoose-example'
})

const express = require('express')
const mongoose = require('mongoose');

const app = express()
const Cat = mongoose.model('Cat', { name: String });
app.get('/', (req, res) => {
    mongoose.connect('mongodb://localhost/test', {useNewUrlParser: true, useUnifiedTopology: true});
    const kitty = new Cat({ name: 'Zildjian' });
    kitty.save().then(() => {
        res.send('meow')
    });
});

app.listen(3000, function () {
  console.log('listening at http://localhost:3000')
})

When I run that server and make a request via curl -i http://localhost:3000/, I see a trace in Kibana that has a span for the mongo request:

Are you able to post example code showing a small reproducible example?

Or are you saying there is a different problem?

That is true. We have an issue (Extend Mongoose support · Issue #1833 · elastic/apm-agent-nodejs · GitHub) that we need to get to. It may be only that the documentation and the agent's testing needs to be updated that all mongoose@5.x versions work.

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