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

Crashing on local development. Is there an option to disable on local?

tansanDOTeth opened this issue · comments

Describe the bug
A clear and concise description of what the bug is.

This happens when I start up my docker compose which is just starting the phoenix server.

app_1         | [os_mon] memory supervisor port (memsup): Erlang has closed
app_1         | [os_mon] cpu supervisor port (cpu_sup): Erlang has closed
app_1         | [info] Application new_relic_agent exited: NewRelic.Application.start(:normal, []) returned an error: shutdown: failed to start child: NewRelic.Logger
app_1         |     ** (EXIT) an exception was raised:
app_1         |         ** (MatchError) no match of right hand side value: {:error, :eperm}
app_1         |             (new_relic_agent 1.27.7) lib/new_relic/logger.ex:79: NewRelic.Logger.device/1
app_1         |             (new_relic_agent 1.27.7) lib/new_relic/logger.ex:20: NewRelic.Logger.init/1
app_1         |             (stdlib 3.17) gen_server.erl:423: :gen_server.init_it/2
app_1         |             (stdlib 3.17) gen_server.erl:390: :gen_server.init_it/6
app_1         |             (stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Environment

  • Elixir & Erlang version (elixir -v):
    Elixir 1.13.3 (compiled with Erlang/OTP 24)

  • Agent version (mix deps | grep new_relic_agent):
    $ mix deps | grep new_relic_agent

  • new_relic_agent (Hex package) (mix)
    locked at 1.27.7 (new_relic_agent) a0aa7208

Seems related to #181. I couldn't figure out why this was happening.

@astroTANSAN it looks like a file permission error while trying to write to the log file.

Can you try doing something like

config :new_relic_agent, log: "stdout"

?

@astroTANSAN you can disable the agent by changing application config:

config :new_relic_agent, app_name: nil
# or
config :new_relic_agent, license_key: nil

Or adding an environment variable:

NEW_RELIC_HARVEST_ENABLED=false

See #381