disableSend env var also disables automatic traces and transactions creation
See original GitHub issueI have an express nodejs server, and as I’m using webpack, I can’t use the require("elastic-apm-node").start
in the runtime code, due to the way webpack traverses the row of the imports.
So, I’m setting env var: ELASTIC_APM_DISABLE_SEND=true
.
I’m starting the agent using node -r elastic-apm-node/start --unhandled-rejections=strict ./dist/app.js
The communication with apm server stops as expected, but the traces and transactions that were previously automatically generated are no longer generated and i loose log correlation.
Expected behavior
I expect the traces and transactions ids to be generated as well, as mentioned in the API docs.
Environment (please complete the following information)
- OS: Linux
- Node.js version: 10.13
- elastic-apm-node: ^3.18.0
Just in case its helpful, I’m using
winston
,express-winston
and@elastic/ecs-winston-format
)
How are you starting the agent? (please tick one of the boxes)
- Calling
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
) - Requiring
elastic-apm-node/start
from within the source code - Starting node with
-r elastic-apm-node/start
Also, something weird that may has to do with the problem, is that to make it work, i start node using node with -r elastic-apm-node/start
but also on the top of the file, I have: require("elastic-apm-node/start");
. If i remove this line from the top of my entry file executable, the apm automatic traces/transactions etc isn’t working even when i remove the disableSend env var, like it’s never started.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
@angelos3lex Thanks very much for the repo. This is just what I need. I’ve made some progress, but I don’t have an answer yet.
@angelos3lex I’m closing this issue now. Please feel free to re-open if you still have questions or if I’ve missed something. Hopefully using webpack “externals” config is sufficient for your case.