# Missing mongo spans or distributed tracing for some endpoints

**URL:** <https://discuss.elastic.co/t/missing-mongo-spans-or-distributed-tracing-for-some-endpoints/240782>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [July 11, 2020, 6:31am UTC](https://discuss.elastic.co/t/missing-mongo-spans-or-distributed-tracing-for-some-endpoints/240782 "2020-07-11T06:31:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashrafuzzaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashrafuzzaman/32/71128_2.png) [@ashrafuzzaman](https://discuss.elastic.co/u/ashrafuzzaman)\
**Post date:** [July 11, 2020, 6:31am UTC](https://discuss.elastic.co/t/missing-mongo-spans-or-distributed-tracing-for-some-endpoints/240782/1 "2020-07-11T06:31:31Z")

</div>

**Kibana version** :  
7.4.0  
**Elasticsearch version** :  
7.4.0  
**APM Server version** :  
7.4.0  
**APM Agent language and version** :

```auto
    Node: 12.14.0
    elastic-apm-node: 3.6.1
    express: 4.15.4
    mongoose: 5.0.14

```

Agent configuration:

```auto
{
  serviceName: 'cmp-server',
  asyncHooks: true,
  serverUrl: config.endpoints.serverAPMURL,
  ignoreUrls: [
    /^\/heartbeat/,
    /^\/static/,
    /^\/socket\.io.*/
  ],
  ignoreUserAgents: [
    'curl/',
    /pingdom/i
  ],
  sourceLinesSpanAppFrames: 5,
  breakdownMetrics: true,
  logUncaughtExceptions: true,
  usePathAsTransactionName: true
}

```

Note: without asyncHooks set to false no breakdown data(mongo/traces to other services) is collected  
**Browser version** :  
Google Chrome  
Version 83.0.4103.116 (Official Build) (64-bit)  
**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.  
I have continuation-local-storage V3.2.0 installed for propagating requestId.  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

 ![apm-sample](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b327810f2be3383c39811f5a3f32c91c90e942b4.png)  
**Steps to reproduce** :

1. Launch APM server, elastic search, and Kibana containers
2. Install elastic RUM in ractJs based client
3. Install Node APM in the server
4. Browse the application

**Errors in browser console (if relevant)**:

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

\*\*Additional Note

I am trying this out in development mode using docker containers. In production, stackdriver trace can detect the mongo breakdown for those endpoints.

I see that in different time different endpoints have the details transaction spans.

This is another example,

 ![Screenshot from 2020-07-11 15-39-09](https://us1.discourse-cdn.com/elastic/original/3X/1/1/1111d79a785d923058b42a8190369a24117a3215.png)

---

<div class="post-metadata">

**Author:** ![ashrafuzzaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashrafuzzaman/32/71128_2.png) [@ashrafuzzaman](https://discuss.elastic.co/u/ashrafuzzaman)\
**Post date:** [July 13, 2020, 3:36pm UTC](https://discuss.elastic.co/t/missing-mongo-spans-or-distributed-tracing-for-some-endpoints/240782/2 "2020-07-13T15:36:48Z")

</div>

In most of the other micro-services the async hook works. The API gateway for the front-end is an old repo so there might be some offending packages that is massing with async hook.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 3, 2020, 11:45am UTC](https://discuss.elastic.co/t/missing-mongo-spans-or-distributed-tracing-for-some-endpoints/240782/3 "2020-08-03T11:45:29Z")

</div>

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