From 93df87eff35bb8f075c8a230996c6d8703901f2a Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 16 Dec 2019 10:18:30 +0000 Subject: [PATCH 1/2] 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) From 3a5374c6f999875bc73ddd089753bc6c228b354b Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 16 Dec 2019 10:22:50 +0000 Subject: [PATCH 2/2] increase minor version for backwards compatible addition --- libraries/metrics/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/metrics/package.json b/libraries/metrics/package.json index f14f3c2f90..46ad38078c 100644 --- a/libraries/metrics/package.json +++ b/libraries/metrics/package.json @@ -1,6 +1,6 @@ { "name": "metrics-sharelatex", - "version": "2.3.0", + "version": "2.4.0", "description": "A drop-in metrics and monitoring module for node.js apps", "repository": { "type": "git",