elastic / elastic/apm-agent-nodejs
How to log long running aborted HTTP requests - if at all?
- Dominant language
- JavaScript
- Stars
- 594
- Forks
- 244
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Description
Currently we log an "error" if an incoming HTTP request have been taking longer than 25 seconds but then its TCP socket is suddenly closed without the HTTP request being properly ended:
https://github.com/elastic/apm-agent-nodejs/blob/a077ef5462153f8bffd070b8fc41215754b6590d/lib/instrumentation/http-shared.js#L32-L35
Along with the "error" we log the `abortedTime` - i.e. how long the HTTP request was open for before the socket was closed.
This property is currently logged under what used to be called `extra` (which today is called `context.custom`).
First issue is that we no longer support the `extra` property, so this will currently not work. The second issue is that the `context.custom` data is only supposed to be supplied by the user and is not supposed to be touched by the agent.
So we need a better place to put this information. Or we need to remove this feature from the Node agent for now until we figure out a better approach.
Contributor guide
Assessment
This issue has not been assessed yet.