mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 04:13:41 -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')
|
prom = require('prom-client')
|
||||||
Register = require('prom-client').register
|
|
||||||
collectDefaultMetrics = prom.collectDefaultMetrics
|
collectDefaultMetrics = prom.collectDefaultMetrics
|
||||||
|
|
||||||
appname = "unknown"
|
appname = "unknown"
|
||||||
|
@ -15,6 +15,7 @@ destructors = []
|
||||||
require "./uv_threadpool_size"
|
require "./uv_threadpool_size"
|
||||||
|
|
||||||
module.exports = Metrics =
|
module.exports = Metrics =
|
||||||
|
register: require('prom-client').register
|
||||||
initialize: (_name) ->
|
initialize: (_name) ->
|
||||||
appname = _name
|
appname = _name
|
||||||
collectDefaultMetrics({ timeout: 5000, prefix: Metrics.buildPromKey()})
|
collectDefaultMetrics({ timeout: 5000, prefix: Metrics.buildPromKey()})
|
||||||
|
@ -60,8 +61,8 @@ module.exports = Metrics =
|
||||||
|
|
||||||
injectMetricsRoute: (app) ->
|
injectMetricsRoute: (app) ->
|
||||||
app.get('/metrics', (req, res) ->
|
app.get('/metrics', (req, res) ->
|
||||||
res.set('Content-Type', Register.contentType)
|
res.set('Content-Type', register.contentType)
|
||||||
res.end(Register.metrics())
|
res.end(register.metrics())
|
||||||
)
|
)
|
||||||
|
|
||||||
buildPromKey: (key = "")->
|
buildPromKey: (key = "")->
|
||||||
|
|
Loading…
Reference in a new issue