From 89fc640ec4a33bd339d07290409e1c894947d258 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Wed, 22 Jul 2020 16:57:41 +0100 Subject: [PATCH 1/2] Use METRICS_APP_NAME env var to initialise metrics, if present --- services/filestore/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/filestore/app.js b/services/filestore/app.js index c242c8267b..661b131de6 100644 --- a/services/filestore/app.js +++ b/services/filestore/app.js @@ -1,8 +1,8 @@ const logger = require('logger-sharelatex') -const Metrics = require('metrics-sharelatex') +logger.initialize(process.env.METRICS_APP_NAME || 'filestore') -logger.initialize('filestore') -Metrics.initialize('filestore') +const Metrics = require('metrics-sharelatex') +Metrics.initialize(process.env.METRICS_APP_NAME || 'filestore') const settings = require('settings-sharelatex') const express = require('express') From cb86ee8c10c43609df898adb1e090b2621b5c6a9 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Thu, 23 Jul 2020 13:35:52 +0100 Subject: [PATCH 2/2] Initialise metrics before logger --- services/filestore/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/filestore/app.js b/services/filestore/app.js index 661b131de6..83113f6b42 100644 --- a/services/filestore/app.js +++ b/services/filestore/app.js @@ -1,9 +1,9 @@ -const logger = require('logger-sharelatex') -logger.initialize(process.env.METRICS_APP_NAME || 'filestore') - const Metrics = require('metrics-sharelatex') Metrics.initialize(process.env.METRICS_APP_NAME || 'filestore') +const logger = require('logger-sharelatex') +logger.initialize(process.env.METRICS_APP_NAME || 'filestore') + const settings = require('settings-sharelatex') const express = require('express') const bodyParser = require('body-parser')