Skip to content
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

Newrelic Agent does not send transaction data when run as release eval #379

Open
nathanjohnson320 opened this issue Mar 18, 2022 · 0 comments

Comments

@nathanjohnson320
Copy link

Describe the bug
When running a function in a release eval the events do not get sent to newrelic without a long running process. This is not the case when running a release with start_iex

Some solutions I have tried

  • Regular function transaction that starts newrelic and the app
  • Calling NewRelic.manual_shutdown() after the stop transaction
  • Using NewRelic.other_transaction instead of start/stop transaction
  • Copying the macro code from instrumented mix tasks
    • This one results in an exception when stopping new_relic_agent # (stdlib 3.15.1) :ets.lookup(NewRelic.Transaction.Sidecar.ContextStore, {:context, nil}
  • Adding a long Process.sleep at the end of the function
    • This works but isn't really feasible

This repo has all these in a minimal app if that helps diagnose the behavior https://github.com/nathanjohnson320/nr_test/blob/master/lib/nr_test.ex#L7

The general way to reproduce is to do a release

  • MIX_ENV=prod mix release

and then eval the run function

  • _build/prod/rel/nr_test/bin/nr_test eval 'NrTest.run()'

If you check newrelic for the events they do not display however if you use the start_iex command instead of eval new_relic will record the transactions. I am not sure what other steps to take to debug/diagnose what the underlying problem is here.

Environment

  • Elixir & Erlang version (elixir -v): Elixir 1.12.2 (compiled with Erlang/OTP 24)
  • Agent version (mix deps | grep new_relic_agent): new_relic_agent 1.27.7 (Hex package) (mix)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant