[misc] bump metrics module to 3.4.1

- renamed package from `metrics-sharelatex` to `@overleaf/metrics`
- drop support for statsd backend
- decaffeinate
- compress `/metrics` response using gzip
- bump debugging agents to latest versions
- expose prometheus interfaces for custom metrics (custom tags)
- cleanup of open sockets metrics
- fix deprecation warnings for header access
This commit is contained in:
Jakob Ackermann
2020-11-25 11:57:20 +00:00
parent 728736e080
commit f16fbdcdbf
7 changed files with 839 additions and 750 deletions

View File

@@ -5,7 +5,7 @@
* DS207: Consider shorter variations of null checks
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
metrics.initialize('notifications')
const Settings = require('settings-sharelatex')
const logger = require('logger-sharelatex')

View File

@@ -14,7 +14,7 @@
let Notifications
const logger = require('logger-sharelatex')
const { db, ObjectId } = require('./mongodb')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
module.exports = Notifications = {
getUserNotifications(user_id, callback) {

View File

@@ -12,7 +12,7 @@
*/
const Notifications = require('./Notifications')
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
module.exports = {
getUserNotifications(req, res) {

File diff suppressed because it is too large Load Diff

View File

@@ -17,6 +17,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@overleaf/metrics": "^3.4.1",
"async": "^2.6.3",
"body-parser": "^1.19.0",
"coffee-script": "^1.12.7",
@@ -24,7 +25,6 @@
"express": "4.17.1",
"logger-sharelatex": "^2.2.0",
"method-override": "^3.0.0",
"metrics-sharelatex": "^2.6.2",
"mongodb": "^3.6.0",
"node-statsd": "0.1.1",
"request": "^2.88.2",

View File

@@ -29,7 +29,7 @@ describe('Notifications Controller', function () {
requires: {
'logger-sharelatex': { log() {} },
'./Notifications': this.notifications,
'metrics-sharelatex': {
'@overleaf/metrics': {
inc: sinon.stub()
}
}

View File

@@ -49,7 +49,7 @@ describe('Notifications Tests', function () {
},
'settings-sharelatex': {},
'./mongodb': { db: this.db, ObjectId },
'metrics-sharelatex': { timeAsyncMethod: sinon.stub() }
'@overleaf/metrics': { timeAsyncMethod: sinon.stub() }
},
globals: {
console