mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Make register public so we can support other servers e.g. hapi
This commit is contained in:
parent
f0fd0299fe
commit
93bef54c39
1 changed files with 4 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
prom = require('prom-client')
|
||||
Register = require('prom-client').register
|
||||
|
||||
collectDefaultMetrics = prom.collectDefaultMetrics
|
||||
|
||||
appname = "unknown"
|
||||
|
@ -15,6 +15,7 @@ destructors = []
|
|||
require "./uv_threadpool_size"
|
||||
|
||||
module.exports = Metrics =
|
||||
register: require('prom-client').register
|
||||
initialize: (_name) ->
|
||||
appname = _name
|
||||
collectDefaultMetrics({ timeout: 5000, prefix: Metrics.buildPromKey()})
|
||||
|
@ -60,8 +61,8 @@ module.exports = Metrics =
|
|||
|
||||
injectMetricsRoute: (app) ->
|
||||
app.get('/metrics', (req, res) ->
|
||||
res.set('Content-Type', Register.contentType)
|
||||
res.end(Register.metrics())
|
||||
res.set('Content-Type', register.contentType)
|
||||
res.end(register.metrics())
|
||||
)
|
||||
|
||||
buildPromKey: (key = "")->
|
||||
|
|
Loading…
Reference in a new issue