From 69a8d9c7f1d720a62611c57d1d673c4e4c088a59 Mon Sep 17 00:00:00 2001 From: Christopher Hoskin Date: Thu, 10 Jan 2019 09:11:15 +0000 Subject: [PATCH] Switch metrics to v2 --- services/contacts/app.coffee | 9 +++++++-- services/contacts/package.json | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/services/contacts/app.coffee b/services/contacts/app.coffee index b72f63030b..7465c9fa64 100644 --- a/services/contacts/app.coffee +++ b/services/contacts/app.coffee @@ -1,13 +1,16 @@ +Metrics = require "metrics-sharelatex" +Metrics.initialize("contacts") + Settings = require "settings-sharelatex" logger = require "logger-sharelatex" express = require "express" bodyParser = require "body-parser" Errors = require "./app/js/Errors" HttpController = require "./app/js/HttpController" -Metrics = require "metrics-sharelatex" + Path = require "path" -Metrics.initialize("contacts") + logger.initialize("contacts") Metrics.event_loop?.monitor(logger) @@ -15,6 +18,8 @@ app = express() app.use Metrics.http.monitor(logger) +Metrics.injectMetricsRoute(app) + app.get '/user/:user_id/contacts', HttpController.getContacts app.post '/user/:user_id/contacts', bodyParser.json(limit: "2mb"), HttpController.addContact diff --git a/services/contacts/package.json b/services/contacts/package.json index d1b7807110..bdde307c03 100644 --- a/services/contacts/package.json +++ b/services/contacts/package.json @@ -26,7 +26,7 @@ "coffee-script": "^1.7.1", "express": "~4.1.1", "logger-sharelatex": "git+https://github.com/sharelatex/logger-sharelatex.git#v1.1.0", - "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v1.7.1", + "metrics-sharelatex": "git+https://github.com/sharelatex/metrics-sharelatex.git#v2.0.12", "mongojs": "2.4.0", "request": "~2.34.0", "settings-sharelatex": "git+https://github.com/sharelatex/settings-sharelatex.git#v1.0.0",