From f4af82282fdb407eb6f121d339a497c5e8351c6e Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 20 Nov 2018 16:06:02 +0000 Subject: [PATCH] use buildKey for prefixing name and host --- libraries/metrics/metrics.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/metrics/metrics.coffee b/libraries/metrics/metrics.coffee index 22dfd22548..e869ca0cff 100644 --- a/libraries/metrics/metrics.coffee +++ b/libraries/metrics/metrics.coffee @@ -20,8 +20,8 @@ require "./uv_threadpool_size" module.exports = Metrics = initialize: (_name) -> - name = _name - collectDefaultMetrics({ timeout: 5000, prefix: name + "_" }) + name = _name + "_" + collectDefaultMetrics({ timeout: 5000, prefix: name+"_"}) registerDestructor: (func) -> destructors.push func @@ -46,7 +46,7 @@ module.exports = Metrics = key = this.sanitizeKey(key) if !counters[key] counters[key] = new prom.Counter({ - name: key, + name: buildKey(key), help: key, labelNames: ['name','host'] }) @@ -73,7 +73,7 @@ module.exports = Metrics = key = this.sanitizeKey(key) if !gauges[key] gauges[key] = new prom.Gauge({ - name: key, + name: buildKey(key), help: key, labelNames: ['name','host'] }) @@ -84,7 +84,7 @@ module.exports = Metrics = key = this.sanitizeKey(key) if !gauges[key] gauges[key] = new prom.Gauge({ - name: key, + name: buildKey(key), help: key, labelNames: ['name','host'] })