[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:23 +00:00
parent 38d61710a2
commit 95f3bcef21
13 changed files with 728 additions and 826 deletions

View file

@ -1,4 +1,4 @@
const Metrics = require('metrics-sharelatex')
const Metrics = require('@overleaf/metrics')
Metrics.initialize(process.env.METRICS_APP_NAME || 'filestore')
const logger = require('logger-sharelatex')

View file

@ -1,6 +1,6 @@
const PersistorManager = require('./PersistorManager')
const FileHandler = require('./FileHandler')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const parseRange = require('range-parser')
const Errors = require('./Errors')
const { pipeline } = require('stream')

View file

@ -1,4 +1,4 @@
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const Settings = require('settings-sharelatex')
const { callbackify } = require('util')

View file

@ -1,5 +1,5 @@
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const { callbackify } = require('util')
const safeExec = require('./SafeExec').promises

View file

@ -3,7 +3,7 @@ const uuid = require('node-uuid')
const path = require('path')
const Stream = require('stream')
const { callbackify, promisify } = require('util')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
const Settings = require('settings-sharelatex')
const { WriteError } = require('./Errors')

View file

@ -1,7 +1,7 @@
const settings = require('settings-sharelatex')
const persistorSettings = settings.filestore
persistorSettings.Metrics = require('metrics-sharelatex')
persistorSettings.Metrics = require('@overleaf/metrics')
persistorSettings.paths = settings.path
const ObjectPersistor = require('@overleaf/object-persistor')

View file

@ -1,5 +1,5 @@
const logger = require('logger-sharelatex')
const metrics = require('metrics-sharelatex')
const metrics = require('@overleaf/metrics')
class RequestLogger {
constructor() {

File diff suppressed because it is too large Load diff

View file

@ -20,6 +20,7 @@
"test:unit:_run": "mocha --recursive --reporter spec $@ test/unit/js"
},
"dependencies": {
"@overleaf/metrics": "^3.4.1",
"@overleaf/o-error": "^3.0.0",
"@overleaf/object-persistor": "git+https://github.com/overleaf/object-persistor.git",
"body-parser": "^1.19.0",
@ -28,7 +29,6 @@
"glob": "^7.1.6",
"lodash.once": "^4.1.1",
"logger-sharelatex": "^2.2.0",
"metrics-sharelatex": "^2.7.0",
"node-uuid": "~1.4.8",
"range-parser": "^1.2.1",
"request": "^2.88.2",

View file

@ -59,7 +59,7 @@ describe('FileController', function () {
'./Errors': Errors,
stream: stream,
'settings-sharelatex': settings,
'metrics-sharelatex': {
'@overleaf/metrics': {
inc() {}
}
},

View file

@ -28,7 +28,7 @@ describe('FileConverter', function () {
FileConverter = SandboxedModule.require(modulePath, {
requires: {
'./SafeExec': SafeExec,
'metrics-sharelatex': {
'@overleaf/metrics': {
inc: sinon.stub(),
Timer: sinon.stub().returns({ done: sinon.stub() })
},

View file

@ -20,7 +20,7 @@ describe('ImageOptimiser', function () {
requires: {
'./SafeExec': SafeExec,
'logger-sharelatex': logger,
'metrics-sharelatex': {
'@overleaf/metrics': {
Timer: sinon.stub().returns({ done: sinon.stub() })
}
}

View file

@ -30,7 +30,7 @@ describe('LocalFileWriter', function () {
fs,
stream,
'settings-sharelatex': settings,
'metrics-sharelatex': {
'@overleaf/metrics': {
inc: sinon.stub(),
Timer: sinon.stub().returns({ done: sinon.stub() })
},