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); } }); };