Skip to content

Commit 3e4f00c

Browse files
authored
fix: use collectDefaultMetrics option (#7)
For apps that make heavy use of prometheus metrics, it may be possible that the default metrics are already registered and managed and configured separately. This is the case in lodestar. Feature to disable default metrics
1 parent 4bb88c1 commit 3e4f00c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class PrometheusMetrics implements Metrics {
5757
;(this.registry ?? register).clear()
5858
}
5959

60-
if (init?.preserveExistingMetrics !== false) {
60+
if (init?.collectDefaultMetrics !== false) {
6161
log('Collecting default metrics')
6262
collectDefaultMetrics({ ...init?.defaultMetrics, register: this.registry ?? init?.defaultMetrics?.register })
6363
}

0 commit comments

Comments
 (0)