yabeda-rb / yabeda-sidekiq

Yabeda plugin for complete monitoring of Sidekiq
MIT License
124 stars 15 forks source link

NoMethodError: undefined method `sidekiq_jobs_enqueued_total' for Yabeda:Module #10

Closed inderps closed 4 years ago

inderps commented 4 years ago

I'm running 'rails', '4.2.9' sidekiq (5.2.7)

And I get following error

Bildschirmfoto 2020-02-28 um 16 12 31

Envek commented 4 years ago

Hi, @inderps. Are you using gem yabeda-rails or is there only gem "yabeda-sidekiq" in your Gemfile?

Please try to add gem "yabeda-rails" to your Gemfile. I believe that it should fix the error.

inderps commented 4 years ago

@Envek Thanks for your quick reply. Yes I discovered that to use yabeda-sidekiq, you need to add yabeda-rails as well. But by adding yabeda rails, will it also create metrics for web app? Because in our case, we were interested in sidekiq only.

Envek commented 4 years ago

If you don't want web metrics, you can just copy this railtie to your application: https://github.com/yabeda-rb/yabeda-rails/blob/master/lib/yabeda/rails/railtie.rb

I will add necessary configs and documentation later.

inderps commented 4 years ago

Alright thanks

hallelujah commented 4 years ago

I think the simple fix would be to call:

Yabeda.configure! unless Yabeda.already_configured?

Like in https://github.com/yabeda-rb/yabeda-rails/blob/583b476e0a26ece08f3abefb1b423d5576837748/lib/yabeda/rails/railtie.rb#L18-L21

hallelujah commented 4 years ago

@inderps why do you close the issue?

The gem does not work out of the box on standalone sidekiq. It would be nice to have at least an instruction in the README

Envek commented 4 years ago

@inderps if you don't need rails metrics you can now upgrade to yabeda 0.8 and remove yabeda-rails gem: Yabeda will configure itself automatically.

For non-rails usage I added a note into README.