Adapt for metrics v2

This commit is contained in:
Christopher Hoskin 2019-01-09 08:49:32 +00:00
parent 5dc2df2a70
commit d1854c1897
2 changed files with 6 additions and 3 deletions

View file

@ -1,4 +1,5 @@
Metrics = require "metrics-sharelatex" Metrics = require "metrics-sharelatex"
Metrics.initialize("docstore")
Settings = require "settings-sharelatex" Settings = require "settings-sharelatex"
logger = require "logger-sharelatex" logger = require "logger-sharelatex"
express = require "express" express = require "express"
@ -7,7 +8,7 @@ Errors = require "./app/js/Errors"
HttpController = require "./app/js/HttpController" HttpController = require "./app/js/HttpController"
Path = require "path" Path = require "path"
Metrics.initialize("docstore")
logger.initialize("docstore") logger.initialize("docstore")
Metrics.event_loop?.monitor(logger) Metrics.event_loop?.monitor(logger)
@ -15,6 +16,8 @@ app = express()
app.use Metrics.http.monitor(logger) app.use Metrics.http.monitor(logger)
Metrics.injectMetricsRoute(app)
app.param 'project_id', (req, res, next, project_id) -> app.param 'project_id', (req, res, next, project_id) ->
if project_id?.match /^[0-9a-f]{24}$/ if project_id?.match /^[0-9a-f]{24}$/
next() next()

View file

@ -26,7 +26,7 @@
"coffee-script": "^1.12.7", "coffee-script": "^1.12.7",
"express": "~4.1.1", "express": "~4.1.1",
"logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.4.0",
"metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.10", "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.12",
"mongojs": "2.4.0", "mongojs": "2.4.0",
"settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0", "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",
"underscore": "~1.6.0" "underscore": "~1.6.0"