mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
add count to prom
This commit is contained in:
parent
d01ff95b46
commit
f63b84983d
1 changed files with 8 additions and 0 deletions
|
@ -58,6 +58,14 @@ module.exports = Metrics =
|
|||
|
||||
count : (key, count, sampleRate = 1)->
|
||||
statsd.count buildKey(key), count, sampleRate
|
||||
key = Metrics.buildPromKey(key)
|
||||
if !promMetrics[key]?
|
||||
promMetrics[key] = new prom.Counter({
|
||||
name: key,
|
||||
help: key,
|
||||
labelNames: ['name','host']
|
||||
})
|
||||
promMetrics[key].inc({name: name, host: hostname}, count)
|
||||
|
||||
timing: (key, timeSpan, sampleRate)->
|
||||
statsd.timing(buildKey(key), timeSpan, sampleRate)
|
||||
|
|
Loading…
Reference in a new issue