-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"active" config not being respected when the agent is started with -r or top level import #4112
Comments
I think I've found the issue - https://github.com/elastic/apm-agent-nodejs/blob/main/lib/config/schema.js#L879
The fix would be to change that check on line 879 to be If I get some time next week I can fork and submit a PR |
This allows a "false" boolean value to override a "true" default value when loading the options via the elastic-apm-node.js config file Fixes: elastic#4112 Closes: elastic#4112
This allows a "false" boolean value to override a "true" default value when loading the options via the elastic-apm-node.js config file Fixes: elastic#4112 Closes: elastic#4112
can anyone look at the PR? It's pretty straightforward |
@csnate thanks for the elaborated issue report and the PR. I've already added my feedback in it :) |
Describe the bug
The active config value is not being respected when it's set to "false" if I start the agent with the require start module or the -r opt and I use the agent config file to load the configuration. All of the other options are correctly being used (data is getting to the apm server, service name and environment are set, etc.) but if I set
active: false
, Elastic APM is still recording data.If I use the require and start way to start the agent, then it looks like the
active
flag is working as expected.To Reproduce
Steps to reproduce the behavior:
elastic-apm-node.js
node -r elastic-apm-node/start.js app.js
Expected behavior
No data is sent to Elastic APM when
active: false
when started with "require start module" or "-r opt"Environment (please complete the following information)
How are you starting the agent? (please tick one of the boxes)
agent.start()
directly (e.g.require('elastic-apm-node').start(...)
)elastic-apm-node/start
from within the source code-r elastic-apm-node/start
Additional context
Agent config options:
Click to expand
package.json
dependencies:Click to expand
The text was updated successfully, but these errors were encountered: