protor-ruby
Prometheus aggregator client for ruby
Installation
In Gemfile
gem 'protor'
Then run
bundle install
Usage
Counter
It automatically aggregate value
protor.counter(:counter, 1, {label1: 1})
protor.counter(:counter, 1, {label1: 1})
Gauge
It automatically replace value
protor.gauge(:gauge, 50)
protor.gauge(:gauge, 20)
Histogram
It save all observed values
protor.histogram(:histogram, 10, {label1: 1}, [1,2,3,4])
protor.histogram(:histogram, 2, {label1: 1}, [1,2,3,4](
Publish
To publish all saved metrics to aggregator
protor.publish
Configuration
To configure protor:
$protor = Protor.new do |conf|
conf[:service] = 'service name'
conf[:host] = 'localhost'
conf[:port] = 8080
conf[:logger] = Rails.logger
conf[:silent] = True
end