Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: only start prometheus metrics in one place (#2954)
Browse files Browse the repository at this point in the history
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 #2019
  • Loading branch information
achingbrain authored Mar 26, 2020
1 parent bfef306 commit d52a41e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions packages/ipfs/src/http/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@ class HttpApi {
this._options = options || {}
this._log = debug(LOG)
this._log.error = debug(LOG_ERROR)

if (process.env.IPFS_MONITORING) {
// Setup debug metrics collection
const prometheusClient = require('prom-client')
const prometheusGcStats = require('prometheus-gc-stats')
const collectDefaultMetrics = prometheusClient.collectDefaultMetrics
collectDefaultMetrics({ timeout: 5000 })
prometheusGcStats(prometheusClient.register)()
}
}

async start () {
Expand Down

0 comments on commit d52a41e

Please sign in to comment.