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

Submit a `context` without using a scope

Open andyhansen opened this issue 3 years ago • 0 comments

I recently found out about the top level context variable which allows you to set a variable which can be searched with context:variable-value. This would be perfect for us to use as a way of storing which queue had the error, so that we can easily find all errors it's been having.

Unfortunately I can't find a way to include this variable with the error via the Ruby SDK without using a scope. At first I thought the custom_data_method_context was the answer to my problems, but I quickly realised that this was (of course) used by custom_data_method only.

I tested locally and found that I was able to get what I wanted if I could set the context when building the item, but that's a bit deep into the gem for me to make a change unfortunately.

Is there a way of setting this value when sending an individual Rollbar without using a scope? I will use a scope if I have to, but it unfortunately makes some of our abstractions more complex than I'd like.

andyhansen avatar Jul 26 '22 04:07 andyhansen