class G5PromRails::SettableCounter

prometheus-client provides a counter that can only be incremented. That works great for instrumenting events, but in the case of something like Sidekiq Processed count, prometheus (the server) can handle resets and all kinds of great stuff if I simply pass the count as-is. Rather than having to monkey with saving the previous value and all that nonsense, I just want to set the value and let the server deal with it.

Public Instance Methods

set(labels, value) click to toggle source
# File lib/g5_prom_rails/settable_counter.rb, line 12
def set(labels, value)
  @values[label_set_for(labels)] = value
end
type() click to toggle source
# File lib/g5_prom_rails/settable_counter.rb, line 8
def type
  :counter
end