mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Merge pull request #13214 from overleaf/bg-add-socket-leak-detection-to-all-services
add socket leak detection to all services GitOrigin-RevId: 9481222258b796ca8c3b50cdd7ce60c05f0f9f61
This commit is contained in:
parent
1194e9a942
commit
c625fef364
9 changed files with 10 additions and 0 deletions
|
@ -13,6 +13,8 @@ metrics.initialize('chat')
|
|||
logger.initialize('chat')
|
||||
metrics.open_sockets.monitor()
|
||||
|
||||
metrics.leaked_sockets.monitor(logger)
|
||||
|
||||
export async function createServer() {
|
||||
const app = express()
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ const Path = require('path')
|
|||
|
||||
Metrics.open_sockets.monitor(true)
|
||||
Metrics.memory.monitor(logger)
|
||||
Metrics.leaked_sockets.monitor(logger)
|
||||
|
||||
const ProjectPersistenceManager = require('./app/js/ProjectPersistenceManager')
|
||||
const OutputCacheManager = require('./app/js/OutputCacheManager')
|
||||
|
|
|
@ -23,6 +23,7 @@ logger.initialize('docstore')
|
|||
if (Metrics.event_loop != null) {
|
||||
Metrics.event_loop.monitor(logger)
|
||||
}
|
||||
Metrics.leaked_sockets.monitor(logger)
|
||||
Metrics.open_sockets.monitor()
|
||||
|
||||
const app = express()
|
||||
|
|
|
@ -27,6 +27,7 @@ Metrics.memory.monitor(logger)
|
|||
if (Metrics.event_loop) {
|
||||
Metrics.event_loop.monitor(logger)
|
||||
}
|
||||
Metrics.leaked_sockets.monitor(logger)
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
Metrics.inc('http-request')
|
||||
|
|
|
@ -29,6 +29,7 @@ logger.initialize('history-v1')
|
|||
Metrics.open_sockets.monitor()
|
||||
Metrics.injectMetricsRoute(app)
|
||||
app.use(Metrics.http.monitor(logger))
|
||||
Metrics.leaked_sockets.monitor(logger)
|
||||
|
||||
// We may have fairly large JSON bodies when receiving large Changes. Clients
|
||||
// may have to handle 413 status codes and try creating files instead of sending
|
||||
|
|
|
@ -16,6 +16,7 @@ if (Settings.sentry.dsn) {
|
|||
Metrics.initialize('project-history')
|
||||
Metrics.event_loop.monitor(logger)
|
||||
Metrics.memory.monitor(logger)
|
||||
Metrics.leaked_sockets.monitor(logger)
|
||||
Metrics.open_sockets.monitor()
|
||||
|
||||
// log updates as truncated strings
|
||||
|
|
|
@ -6,6 +6,7 @@ const async = require('async')
|
|||
const logger = require('@overleaf/logger')
|
||||
logger.initialize('real-time')
|
||||
Metrics.event_loop.monitor(logger)
|
||||
Metrics.leaked_sockets.monitor(logger)
|
||||
Metrics.open_sockets.monitor()
|
||||
|
||||
const express = require('express')
|
||||
|
|
|
@ -12,6 +12,7 @@ if (Settings.sentry?.dsn != null) {
|
|||
logger.initializeErrorReporting(Settings.sentry.dsn)
|
||||
}
|
||||
metrics.memory.monitor(logger)
|
||||
metrics.leaked_sockets.monitor(logger)
|
||||
metrics.open_sockets.monitor()
|
||||
|
||||
export const app = express()
|
||||
|
|
|
@ -34,6 +34,7 @@ http.globalAgent.maxSockets = Settings.limits.httpGlobalAgentMaxSockets
|
|||
https.globalAgent.maxSockets = Settings.limits.httpsGlobalAgentMaxSockets
|
||||
|
||||
metrics.memory.monitor(logger)
|
||||
metrics.leaked_sockets.monitor(logger)
|
||||
metrics.open_sockets.monitor()
|
||||
|
||||
const Server = require('./app/src/infrastructure/Server')
|
||||
|
|
Loading…
Reference in a new issue