yabeda-rb/yabeda

Provide DSL to configure store settings

Arkweid opened this issue · 2 comments

Prometheus define new settings for metrics store_setting
https://github.com/prometheus/client_ruby#aggregation-settings-for-multi-process-stores

It would be nice to have something like this:

gauge :users_count do
  comment "Number of total users"
  store aggregation: :max
end

Looks like enough to add one more option here:
https://github.com/yabeda-rb/yabeda/blob/master/lib/yabeda/metric.rb

option :store,   default: -> { {} }, optional: true, comment: "Custom store settings"
Envek commented

The only thing that worries me is that it is way too specific for prometheus-client so we need either some general solution or way to specify options only for some adapters.

So, maybe it should be something like this?

gauge :users_count do
  adapter :prometheus do
    store_settings aggregation: :max
  end
end

I'm not sure yet

Envek commented

I've released yabeda 0.5 and yabeda-prometheus 0.5 with support for metric aggregation with following syntax in the Yabeda metric declaration:

group :some do
  gauge :tasks do
    comment "Number of test tasks"
    aggregation :max
  end
end

Please try it and share your thoughts!