You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wish to add dynamic custom data in Rollbar, so that the data is visible in the errors reported by my system,
It seems there should be a method where you can do something like this:
Rollbar.with_extra(a: 1,b: 2)do# all errors within the block should send the additional parameters passed to the methodend
Initially I thought I could use the Rollbar.scoped method, but it doesn't seem to accept any extra fields. The documentation shows the following example:
# Overwrites any existing person datascope={:person=>{:id=>user.id,:username=>user.username,:email=>user.email}}Rollbar.scoped(scope)
But it only overrides Rollbar-defined data. I tried the simple thing to do which is Rollbar.scoped(a: 1, b:2), but those parameters aren't being passed as extra arguments.I even went as far as this:
but unfortunately, it got rejected by Rollbar, because it overwrites message.body:
API error: Invalid format. data.body.message.body is a required property. data.body must have exactly one of the properties: 'trace', 'trace_chain', 'message', or 'crash_report'.
I'm also aware of the existence of the custom_data_method, but I have no clue how to pass the data to it from the scoped method and it also seems like an overkill for this use-case.
Is there a chance for us to have a methods that work similar to Rollbar.scoped, Rollbar.scope! pair, or enhance those methods to make passing extra arguments easier?
Or perhaps it's already possible but I'm missing something because it's not well-documented?
The text was updated successfully, but these errors were encountered:
I wish to add dynamic custom data in Rollbar, so that the data is visible in the errors reported by my system,
It seems there should be a method where you can do something like this:
Initially I thought I could use the
Rollbar.scoped
method, but it doesn't seem to accept any extra fields. The documentation shows the following example:But it only overrides Rollbar-defined data. I tried the simple thing to do which is
Rollbar.scoped(a: 1, b:2)
, but those parameters aren't being passed as extra arguments.I even went as far as this:but unfortunately, it got rejected by Rollbar, because it overwrites
message.body
:I'm also aware of the existence of the
custom_data_method
, but I have no clue how to pass the data to it from thescoped
method and it also seems like an overkill for this use-case.Is there a chance for us to have a methods that work similar to
Rollbar.scoped
,Rollbar.scope!
pair, or enhance those methods to make passing extra arguments easier?Or perhaps it's already possible but I'm missing something because it's not well-documented?
The text was updated successfully, but these errors were encountered: