The agent's config file currently accepts strings where boolean values are expected. This can cause an issue where, for example, setting a boolean-expected config to 'false' (or any other string) evaluates to true.
The agent's config parsing logic needs to be updated to allow certain strings when a boolean is expected. Some logic currently exists in the agent for the configs agent_enabled and enabled that gets near the desired behavior, which we may be able to build off:
Following the above logic, the boolean true may accept the strings 'true', 'yes', 'on' while the boolean false may accept 'false', 'no', 'off'. We should log an error and use the default config value when unexpected values are given.
The agent's config file currently accepts strings where boolean values are expected. This can cause an issue where, for example, setting a boolean-expected config to
'false'
(or any other string) evaluates totrue
.The agent's config parsing logic needs to be updated to allow certain strings when a boolean is expected. Some logic currently exists in the agent for the configs
agent_enabled
andenabled
that gets near the desired behavior, which we may be able to build off:https://github.com/newrelic/newrelic-ruby-agent/blob/41430b2aac3cdb69c178cd742b4074618e00227c/lib/new_relic/agent/configuration/yaml_source.rb#L135-L148
Following the above logic, the boolean
true
may accept the strings'true'
,'yes'
,'on'
while the booleanfalse
may accept'false'
,'no'
,'off'
. We should log an error and use the default config value when unexpected values are given.