diff --git a/lib/routes/metrics.js b/lib/routes/metrics.js index 3afb81b320..b80820fb4a 100644 --- a/lib/routes/metrics.js +++ b/lib/routes/metrics.js @@ -11,6 +11,8 @@ module.exports = function (app, config) { clientMetricsStore, clientInstanceStore, clientApplicationsStore, + strategyStore, + featureToggleStore, } = config.stores; const metrics = new ClientMetrics(clientMetricsStore); @@ -129,8 +131,10 @@ module.exports = function (app, config) { Promise.all([ clientApplicationsStore.getApplication(appName), clientInstanceStore.getByAppName(appName), + strategyStore.getStrategies(), + featureToggleStore.getFeatures(), ]) - .then(([application, instances]) => { + .then(([application, instances, strategies, features]) => { const appDetails = { appName: application.appName, createdAt: application.createdAt, @@ -138,9 +142,21 @@ module.exports = function (app, config) { url: application.url, color: application.color, icon: application.icon, - strategies: application.strategies, + strategies: application.strategies.map(name => { + const found = strategies.find((feature) => feature.name === name); + if (found) { + return found; + } + return { name, notFound: true }; + }), instances, - seenToggles, + seenToggles: seenToggles.map(name => { + const found = features.find((feature) => feature.name === name); + if (found) { + return found; + } + return { name, notFound: true }; + }), links: { self: `/api/client/applications/${application.appName}`, },