diff options
Diffstat (limited to 'lib/longboat/collector.rb')
-rw-r--r-- | lib/longboat/collector.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/longboat/collector.rb b/lib/longboat/collector.rb index c812b05..d1a5d93 100644 --- a/lib/longboat/collector.rb +++ b/lib/longboat/collector.rb @@ -1,10 +1,12 @@ module Longboat class Collector - def initialize + def initialize(config) @metrics = {} + @config = config end def report!(name, value, help: nil, type: nil, labels: {}, timestamp: Time.now) + name = "#{@config[:metric_prefix]}#{name}" @metrics[name] ||= {help: help, type: type} @metrics[name][labels] = {value: value, timestamp: timestamp} end |