rollbar-gem icon indicating copy to clipboard operation
rollbar-gem copied to clipboard

Sending backtrace for messages events

Open vikalejo opened this issue 9 years ago • 7 comments

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')

vikalejo avatar May 20 '15 14:05 vikalejo

@jondeandres what are the next steps for this? Maybe @rokob can take it over?

coryvirok avatar Jun 08 '17 01:06 coryvirok

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.

jondeandres avatar Jun 08 '17 09:06 jondeandres

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.

rokob avatar Jun 20 '17 18:06 rokob

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!

rivkahstandig3636 avatar May 23 '18 11:05 rivkahstandig3636

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.

bdelo avatar Apr 01 '19 20:04 bdelo

@brianr What's the current status of API support for this?

waltjones avatar Apr 01 '19 20:04 waltjones

Looks like this might be duplicate of https://github.com/rollbar/rollbar-gem/issues/568 ?

bdelo avatar Apr 01 '19 20:04 bdelo