yabeda-rb / yabeda-sidekiq

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

Allow to disable collection of general metrics (of the whole Sidekiq setup) #20

Closed mrexox closed 3 years ago

mrexox commented 3 years ago

If you run Kubernetes and have several pods running sidekiq, these general metrics can be overkill. So it is better to choose one pod that will publish these metrics instead of all pods publishing the same values.

To make it simple, I offer the solution with ENV variable checking. But I am open to discussion about how to make it more accurate.

UPD: Also added the setting to force collecting metrics even if an application is not a Sidekiq runner.

Envek commented 3 years ago

Hey! Thanks for the pull request! I like the idea as it can be really useful on large Sidekiq installation.

I just pushed few changes: using anyway_config for configuration (it allows to use not only environment variables, but many other sources) and renaming of setting (however, I'm still not sure about correct naming).

Let's discuss!

mrexox commented 3 years ago

I like the name general or common, but general sounds more like typical. We mean here the metrics that are not specific to any sidekiq runner. What about aggregate or overall name for these metrics?

Envek commented 3 years ago

After further thinking I thought that it is enough to use single setting as force switch for general/global/aggregate metrics (it is by default on in Sidekiq processes and off in non-Sidekiq, thanks for the idea!).