Difference in data captured by APM agent (6.2.3)


(Umapati Singh) #1

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".

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'
};


(Thomas Watson) #2

Thanks for reporting this :slight_smile:

There's already an open issue on this topic on our GitHub issue tacker: #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 :frowning:

The only known module that we don't support (yet) 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.


(Umapati Singh) #3

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:

"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"
}


(Thomas Watson) #4

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


(system) #5

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