# Difference in data captured by APM agent (6.2.3)

**URL:** <https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604>\
**Category:** APM\
**Created:** [June 20, 2018, 4:34am UTC](https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604 "2018-06-20T04:34:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![umapati](https://avatars.discourse-cdn.com/v4/letter/u/9d8465/32.png) [@umapati](https://discuss.elastic.co/u/umapati)\
**Post date:** [June 20, 2018, 4:34am UTC](https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604/1 "2018-06-20T04:34:23Z")

</div>

Hello team,

I am using node.js APM agent to monitor my application. I noticed that the information captured in not consistent for similar consecutive requests. At times, it prints "result": "success", at other times, it prints "result": "HTTP 2xx".

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/5/5/552839c968408879a0dd44905c910bb0c9ecf3b7.png)

Any idea whats the reason behind this and if there is a way to standardizing the response.

my apm config is as follows:

config.apm = {  
serviceName: 'SIT',  
secretToken: '',  
serverUrl: 'http://:8200',  
captureBody: 'all',  
instrument: 'true',  
errorOnAbortedRequests: 'true'  
};

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [June 20, 2018, 10:17am UTC](https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604/2 "2018-06-20T10:17:26Z")

</div>

Thanks for reporting this 🙂

There's already an open issue on this topic on our GitHub issue tacker: [#367](https://github.com/elastic/apm-agent-nodejs/issues/367)

In short, the problem occurs if the Node.js agent looses track of the current active transaction at some point before your app starts responding to the incoming request.

This is most likely due to what's called a "user-land callback queue". What this means is that some 3rd party module (or potentially your own code) is calling a callback after an async operation at a time we didn't anticipate. The way to fix this is for us to write a custom patch for the "offending" module.

As you can probably appreciate, it can take a long time even identifying the module as we potentially have to manually read the source code of all your dependencies ☹

The only known module that we don't support ([yet](https://github.com/elastic/apm-agent-nodejs/pull/396)) is called `express-queue`. Are you using this module? If not, please share the entire `dependencies` section from your `package.json` file and we'll have a look.

---

<div class="post-metadata">

**Author:** ![umapati](https://avatars.discourse-cdn.com/v4/letter/u/9d8465/32.png) [@umapati](https://discuss.elastic.co/u/umapati)\
**Post date:** [June 21, 2018, 6:38am UTC](https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604/3 "2018-06-21T06:38:22Z")

</div>

Thanks for the prompt response Thomas. We are not using express-queue, atleast not explicitly.

pls find the dependenies in the package.json listed towards the end of the message.

can you also share some more literature to help me understand:

> [@wa7son](#):
>
> is calling a callback after an async operation at a time we didn't anticipate

"dependencies": {  
"agentkeepalive": "^3.3.0",  
"elastic-apm-node": "^1.4.0",  
"ansi-regex": "^3.0.0",  
"ansi-styles": "^3.2.0",  
"asn1": "^0.2.3",  
"assert-plus": "^1.0.0",  
"auth-challenge-response": "^0.5.1",  
"aws-sign2": "^0.7.0",  
"aws4": "^1.6.0",  
"base64-arraybuffer": "^0.1.5",  
"bcrypt-pbkdf": "^1.0.1",  
"bignumber.js": "^5.0.0",  
"body-parser": "^1.18.2",  
"boom": "^7.1.1",  
"buffer": "^4.9.1",  
"buffer-shims": "^1.0.0",  
"caseless": "^0.12.0",  
"chalk": "^2.3.0",  
"cookie-parser": "^1.4.3",  
"core-js": "^2.5.3",  
"cryptiles": "^4.1.1",  
"dashdash": "^1.14.1",  
"delayed-stream": "^1.0.0",  
"double-ended-queue": "^2.1.0-0",  
"ecc-jsbn": "^0.1.1",  
"exec-php": "^0.0.3",  
"express": "^4.16.2",  
"extend": "^3.0.1",  
"extsprintf": "^1.4.0",  
"forever-agent": "^0.6.1",  
"form-data": "^2.3.1",  
"fs-extra": "^5.0.0",  
"generate-function": "^2.0.0",  
"generate-object-property": "^1.2.0",  
"generic-pool": "^2.5.4",  
"ioredis": "^3.2.2",  
"js-nacl": "^1.2.2",  
"json-schema": "^0.2.3",  
"json-stringify-safe": "^5.0.1",  
"jsonpointer": "^4.0.1",  
"jsprim": "^2.0.0",  
"loadtest": "^2.3.0",  
"mssql": "^4.1.0",  
"mysql": "^2.15.0",  
"node-uuid": "^1.4.8",  
"promise": "^7.3.1",  
"qrcode-js": "0.0.2",  
"tedious": "^1.14.0",  
"winston": "^2.4.0",  
"winston-daily-rotate-file": "^1.7.2"  
}

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [June 21, 2018, 7:31am UTC](https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604/4 "2018-06-21T07:31:05Z")

</div>

Thanks for sharing your dependencies. I've created an issue on our issue tracker so we can look into it: [https://github.com/elastic/apm-agent-nodejs/issues/406](https://github.com/elastic/apm-agent-nodejs/issues/406)

---

<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 12, 2018, 3:31am UTC](https://discuss.elastic.co/t/difference-in-data-captured-by-apm-agent-6-2-3/136604/5 "2018-07-12T03:31:14Z")

</div>

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