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

Provide Notice Errors in Elixir Agent #388

Open
JamieMaclean opened this issue Jul 27, 2022 · 3 comments · May be fixed by #470
Open

Provide Notice Errors in Elixir Agent #388

JamieMaclean opened this issue Jul 27, 2022 · 3 comments · May be fixed by #470
Labels
feature request New feature or request

Comments

@JamieMaclean
Copy link

JamieMaclean commented Jul 27, 2022

I'd just like to say thank you for maintaining this library! So far my experience with it has been great!

Is your feature request related to a problem? Please describe.
From what I can see, error reporting is handled via cowboy telemetry events which means that handled errors are never sent to New Relic to be seen in the UI.

I've seen that some of the other agents support this via e.g. in Python:

newrelic.agent.notice_error(error=None, attributes={}, expected=None, ignore=None, status_code=None, application=None)

It would be good to have similar functionality in Elixir.

Describe the solution you'd like
Creation of something similar to:

NewRelic.report_notice_error(%{error: nil, attributes=%{}, expected: nil, ignore: nil, status_code: nil, application: nil})

Describe alternatives you've considered
So far our work around is to send a custom event with the stacktrace and create an alert in the UI. But this is a non-optimal solution.

I may also be able to find some time to work on this.

@ivanfrias
Copy link

hi @JamieMaclean. May I ask you how have you implemented the workaround you described using this elixir agent ? Thx!

@JamieMaclean
Copy link
Author

JamieMaclean commented Aug 31, 2022

hi @JamieMaclean. May I ask you how have you implemented the workaround you described using this elixir agent ? Thx!

Hey @ivanfrias, sure thing. It is something along the lines of:

try do
  raise("Raise for some reason")
rescue
  e ->
    NewRelic.report_custom_event("MyHandledError", %{
      exception: inspect(e),
      stacktrace: inspect(__STACKTRACE__)
    })

  continue_as_if_nothing_ever_happened()
end

Then, in the UI, you can create alerts based on this custom event.

Like I said, not ideal... But it works.

@ivanovv
Copy link

ivanovv commented Apr 5, 2023

I think Sentry has this one implemented, but they have to parse the log to achieve this. It looks like BEAM is that easy to instrument to catch all unhandled exceptions

@tpitale tpitale added the feature request New feature or request label Jun 16, 2023
@binaryseed binaryseed linked a pull request Dec 28, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants