Closed djlebersilvestre closed 4 years ago
Just a quick note. The code above works as expected when I pass true
here: Bugsnag.notify(error, true)
to auto_notify
argument.
Probably the best bet would be to write your own custom Bugsnag middleware and then send things to datadog after calling the call
function of the middleware, so that the report has already been sent to Bugsnag by that point and it's complete.
Similar to https://github.com/bugsnag/bugsnag-ruby/blob/master/lib/bugsnag/middleware/callbacks.rb#L14, but shift the callback execution until after the highlighted call
call.
It worked. Thank you 😄
Description
I would like to report to Datadog any Bugsnag notification (either the automatic reporter from Rails gem [global rescue], or manual from handled errors implemented by devs).
Issue
I tried using the
before_notify_callbacks
and a custom middleware, and it partially works because I can see/debug the code hitting the Datadog call I wrote.However, I want to use data from the
report
object to derive some custom tags for Datadog.Here's an example:
On the callback/middleware:
Adding some
binding.pry
we quickly notice that theBugsnag.notify(error)
block is executed only after the callback/middleware, making it impossible to properly evaluate/leveragereport.severity
.Any ideas? Thanks in advance
Environment
Library versions: