yabeda-rb / yabeda-rails

Yabeda plugin to collect basic metrics for Rails applications
MIT License
155 stars 20 forks source link

Is there a way to disable specific metrics? #27

Open heka1024 opened 9 months ago

heka1024 commented 9 months ago

I'm considering turning off certain metrics that I think negligible because our metrics have too high cardinality. Is there any way to do that? If not, I'd love to make a pull request.

Envek commented 9 months ago

Hey. Nope, there is no way to disable arbitrary metrics yet.

I was thinking about something similar, but there was neither need of it to me nor request from the community (see Help wanted section in the Yabeda README for examples).

So, ideas (or pull requests) are welcome

Please tell more about your use case. Do you want to skip both declaration and collection of all rails-specific metrics for the whole process lifetime?

heka1024 commented 9 months ago

Do you want to skip both declaration and collection of all rails-specific metrics for the whole process lifetime?

What I want is to disable rails_view_runtime, rails_db_runtime and some other metrics in another Yabeda gem. Since the primary purpose of my main application is an API, I think metrics on view or db are redundant.

I think it would be great if we can provide an option for disable specific metrics likes the following:.

Yabeda::Rails.configure do |c|
  c.rails_view_runtime = false
  c.rails_db_runtime = false
end

I'll try and make a pull request for it. I'd love to hear your thoughts on this.