From 93df87eff35bb8f075c8a230996c6d8703901f2a Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 16 Dec 2019 10:18:30 +0000 Subject: [PATCH] allow options for count --- libraries/metrics/metrics.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/metrics/metrics.coffee b/libraries/metrics/metrics.coffee index 256eb3a854..8f72e778dc 100644 --- a/libraries/metrics/metrics.coffee +++ b/libraries/metrics/metrics.coffee @@ -83,9 +83,11 @@ module.exports = Metrics = if process.env['DEBUG_METRICS'] console.log("doing inc", key, opts) - count : (key, count, sampleRate = 1)-> + count : (key, count, sampleRate = 1, opts = {})-> key = Metrics.buildPromKey(key) - prom.metric('counter', key).inc({app: appname, host: hostname}, count) + opts.app = appname + opts.host = hostname + prom.metric('counter', key).inc(opts, count) if process.env['DEBUG_METRICS'] console.log("doing count/inc", key, opts)