Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom_data_method missing Sidekiq context #893

Closed
msxavi opened this issue Jul 23, 2019 · 2 comments · Fixed by #919
Closed

custom_data_method missing Sidekiq context #893

msxavi opened this issue Jul 23, 2019 · 2 comments · Fixed by #919
Assignees

Comments

@msxavi
Copy link

msxavi commented Jul 23, 2019

Hello there,

I'm very annoyed by this and maybe is such a simple misconfiguration.

So, I have a multi-tenant app and I set custom_data_method within my initializer to always send tenant info to rollbars:

  config.custom_data_method = lambda do
    { tenant: Tenant.current&.database }
  end

It turns out that "trace.extra.tenant" appears as "None" for rollbars triggered from this Sidekiq::Worker I've got.

Just trying to understand why I don't have this context present. Is there anything I'm missing?

Thanks, guys!

@waltjones
Copy link
Contributor

waltjones commented Jul 23, 2019

@msxavi If I'm understanding correctly, it looks like the custom_data_method does get called, and Tenant.current&.database evaluates to the string "None".

Does that match what you're seeing?

Edit:
Also, are you using apartment-sidekiq, or if not, what's your config for Tenant?

@msxavi
Copy link
Author

msxavi commented Jul 23, 2019

@waltjones Yes, I think rollbar returns "None" instead of nil, but custom_data_method gets called.

I'm using apartment-sidekiq which I believe reports "request.params.apartment" correctly. Although I can access Tenant.current&.database from inside my Sidekiq::Worker, it isn't reported to rollbar along with "request.params.apartment"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants