aboutsummaryrefslogtreecommitdiff
path: root/lib/longboat/collector.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/longboat/collector.rb')
-rw-r--r--lib/longboat/collector.rb4
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