Add opt-in sidekiq extension for annotating delayed classes
Even if no one wants to use the extension as is, it makes a good example of how one may do it.
Usage: in config/initializers/sidekiq.rb
Marginalia::SidekiqInstrumentation.enable!(annotate_delayed_class_extension: true)
optionally customize the marginalia_annotate_perform method, for example
Sidekiq::Extensions::DelayedClass.class_eval do
def marginalia_annotate_perform(target, method_name, args)
Rollbar.scope!(target, method_name, *args)
"#{target}.#{method_name}"
end
end
I would have put this in the wiki entry but I couldn't edit that, and I thought this pr may be more productive than an issue or blog post.
@sj26 any thoughts on this?
Sorry @bf4, I'm not sure what this is doing? Is it reaching more deeply into Sidekiq integration to craft better annotations?
I really only jumped in to get automated testing working, and update marginalia to modern rails versions, not to introduce new features. 😅