Skip to content

Commit 6fc43eb

Browse files
authored
fix: only start prometheus metrics in one place (ipfs#2954)
When the `IPFS_MONITORING` env var is set, we use prometheus to collect resource usage stats. We only need to set them up in one place though. Fixes ipfs#2019
1 parent 15c478b commit 6fc43eb

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/http/index.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ class HttpApi {
4545
this._options = options || {}
4646
this._log = debug(LOG)
4747
this._log.error = debug(LOG_ERROR)
48-
49-
if (process.env.IPFS_MONITORING) {
50-
// Setup debug metrics collection
51-
const prometheusClient = require('prom-client')
52-
const prometheusGcStats = require('prometheus-gc-stats')
53-
const collectDefaultMetrics = prometheusClient.collectDefaultMetrics
54-
collectDefaultMetrics({ timeout: 5000 })
55-
prometheusGcStats(prometheusClient.register)()
56-
}
5748
}
5849

5950
async start () {

0 commit comments

Comments
 (0)