# NodeJS APM not reporting transactions but reporting metrics

**URL:** <https://discuss.elastic.co/t/nodejs-apm-not-reporting-transactions-but-reporting-metrics/235843>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [June 4, 2020, 8:17pm UTC](https://discuss.elastic.co/t/nodejs-apm-not-reporting-transactions-but-reporting-metrics/235843 "2020-06-04T20:17:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandra2037](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandra2037/32/72142_2.png) [@chandra2037](https://discuss.elastic.co/u/chandra2037)\
**Post date:** [June 4, 2020, 8:17pm UTC](https://discuss.elastic.co/t/nodejs-apm-not-reporting-transactions-but-reporting-metrics/235843/1 "2020-06-04T20:17:52Z")

</div>

**Kibana version** : 7.6.2

**Elasticsearch version** : 7.6.2

**APM Server version** : 7.6.2

**APM Agent language and version** : NodeJS 3.6.1

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
APM Agent reporting metrics but not reporting any transactions.

**Code** :  
1.app.ts

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/9/4991c024c462f2d050931e69164a4bf474acd137.png)  
2.server.ts  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/c/5c3dfab3eb9d81c30e23ecc204005da1e3deed16.png)  
3.inversify.config.ts  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/8/98325c31c550186bc12293c41da92166934f33fa.png)

**APM Config** :  
Everything is set through env variables

```
ELASTIC_APM_SERVER_URL=https://test-apm-server:8200
ELASTIC_APM_SECRET_TOKEN=secret-token
ELASTIC_APM_VERIFY_SERVER_CERT=false
ELASTIC_APM_SERVICE_NAME=chandra-test
ELASTIC_APM_ENVIRONMENT=local
ELASTIC_APM_LOG_LEVEL=trace

```

**APM Agent Trace Log** :  
[https://pastebin.com/10E0RhEQ](https://pastebin.com/10E0RhEQ)

Am I missing something in the configuration?

Any advice/help would be appreciated.

Thanks,  
Chandra

---

<div class="post-metadata">

**Author:** ![chandra2037](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandra2037/32/72142_2.png) [@chandra2037](https://discuss.elastic.co/u/chandra2037)\
**Post date:** [June 12, 2020, 8:12pm UTC](https://discuss.elastic.co/t/nodejs-apm-not-reporting-transactions-but-reporting-metrics/235843/2 "2020-06-12T20:12:16Z")

</div>

Able to resolve the issue by doing the APM agent initialization before importing anything in server.ts

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/e/f/ef29776680f283a5a122dbf108fe8f3213dc6801.png)

Now NodeJs app is reporting the transactions properly.

---

<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:** [July 3, 2020, 4:12pm UTC](https://discuss.elastic.co/t/nodejs-apm-not-reporting-transactions-but-reporting-metrics/235843/3 "2020-07-03T16:12:21Z")

</div>

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