marginalia icon indicating copy to clipboard operation
marginalia copied to clipboard

Add opt-in sidekiq extension for annotating delayed classes

Open bf4 opened this issue 5 years ago • 2 comments

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.

bf4 avatar Sep 24 '20 15:09 bf4

@sj26 any thoughts on this?

bf4 avatar Aug 16 '21 14:08 bf4

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. 😅

sj26 avatar Aug 20 '21 03:08 sj26