From 150e484eda5c4aed6b2e5263cd7042d5a429db1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Wed, 18 Dec 2019 15:13:42 +0100 Subject: [PATCH] fix: add appName as label --- lib/metrics.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/metrics.js b/lib/metrics.js index 48435679bb..fb27abedcd 100644 --- a/lib/metrics.js +++ b/lib/metrics.js @@ -44,7 +44,7 @@ exports.startMonitoring = ( const featureToggleUsageTotal = new client.Counter({ name: 'feature_toggle_usage_total', help: 'Number of times a feature toggle has been used', - labelNames: ['toggle', 'active'], + labelNames: ['toggle', 'active', 'appName'], }); eventBus.on(events.REQUEST_TIME, ({ path, method, time, statusCode }) => { @@ -70,8 +70,8 @@ exports.startMonitoring = ( clientMetricsStore.on('metrics', m => { for (const [feature, { yes, no }] of Object.entries(m.bucket.toggles)) { - featureToggleUsageTotal.labels(feature, true).inc(yes); - featureToggleUsageTotal.labels(feature, false).inc(no); + featureToggleUsageTotal.labels(feature, true, m.appName).inc(yes); + featureToggleUsageTotal.labels(feature, false, m.appName).inc(no); } }); };