yabeda-rails icon indicating copy to clipboard operation
yabeda-rails copied to clipboard

Is there a way to disable specific metrics?

Open heka1024 opened this issue 1 year ago • 2 comments

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.

heka1024 avatar Feb 06 '24 08:02 heka1024

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?

Envek avatar Feb 06 '24 13:02 Envek

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.

heka1024 avatar Feb 06 '24 18:02 heka1024