rollbar-gem
rollbar-gem copied to clipboard
Sending backtrace for messages events
We can send the backtrace for no rescued exceptions, using this option in the configuration:
https://github.com/rollbar/rollbar-gem#sending-backtrace-without-rescued-exceptions
config.populate_empty_backtraces = true
and that is great :)
What about to do it also for non exceptions issues?, so we can see the backtrace also for ocurrences with just a message like.
Rollbar.warning('some message to report')
@jondeandres what are the next steps for this? Maybe @rokob can take it over?
We can try to make https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/item.rb#L187 to follow the same strategy than in https://github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/item/backtrace.rb#L83-L99 to get the backtrace.
The problem I see is that we would be sending trace
or trace_chain
at the same time than message
, and as our API says, only one should be sent:
// Option 3: "message"
// Only one of "trace", "trace_chain", "message", or "crash_report" should be present.
// Presence of a "message" key means that this payload is a log message.
So I think we would need to do few changes in our end to support this.
This should be fixed by having the backend support both message and trace/trace_chain, and then sending both. Currently one work around is to take the message and add it as the description to the exception in the trace. We could do that with some configuration option until the backend supports both.
Hi there, I’m closing out all issues opened before 2018 that haven’t had any activity on them since the start of this year. If this is still an issue for you, please comment here and we can reopen this. Thanks!
This is still an enhancement I would love to see. We are using the workaround of Rollbar.info(Exception.new('Warning I want to log'))
in combination with config.populate_empty_backtraces = true
to get the backtrace included for messages logged. It would be great to be able to have backtraces included for messages as well.
@brianr What's the current status of API support for this?
Looks like this might be duplicate of https://github.com/rollbar/rollbar-gem/issues/568 ?