newrelic / elixir_agent

New Relic's Open Source Elixir Agent

Home Page:https://hex.pm/packages/new_relic_agent

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to disabled harvester via config

krankin opened this issue · comments

Describe the bug
Setting harvester_enabled to false in config does not disable the harvester.

It appears to me the issue is in NewRelic.Init.determine_config#2

If determine_config#1 returns false, it is taking the default option, which for the harvester is true.

This would impact any configuration values where the options are falsey.

Here's a sample failing test (requires exposing Config.harvest_enabled?)

    Application.put_env(:new_relic_agent, :harvest_enabled, false)
    NewRelic.Init.init_config()
      
    refute NewRelic.Config.harvest_enabled?  #Should be false, but is true

I'd be happy to submit a PR to change this to look for an actual false value before doing the default value.

Environment

  • Elixir & Erlang version (elixir -v):
Erlang/OTP 23 [erts-11.1.1] [source] [64-bit] [smp:6:6] [ds:6:6:10] [async-threads:1] [hipe]

Elixir 1.11.1 (compiled with Erlang/OTP 23)
  • Agent version (mix deps | grep new_relic_agent):
new_relic_agent 1.22.3 (Hex package) (mix)
locked at 1.22.3 (new_relic_agent) 8df3db90

Looks like you are correct, we should be doing it more like determine_feature does with the default. PR & that test welcome!