From d52a41e1db601db55cf8433c9a91c2ee6b9b3e09 Mon Sep 17 00:00:00 2001 From: Alex Potsides Date: Thu, 26 Mar 2020 14:29:13 +0000 Subject: [PATCH] fix: only start prometheus metrics in one place (#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 #2019 --- packages/ipfs/src/http/index.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/ipfs/src/http/index.js b/packages/ipfs/src/http/index.js index af27532b93..2bb3abb20c 100644 --- a/packages/ipfs/src/http/index.js +++ b/packages/ipfs/src/http/index.js @@ -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 () {