Skip to content

Commit

Permalink
impr: ARSN-315 expose collecting default metrics as fn
Browse files Browse the repository at this point in the history
Collecting default metrics should not be the default, should be invoked when needed. This causes build errors when multiple components use Arsenal.
  • Loading branch information
Naren committed Mar 14, 2023
1 parent bd0a199 commit 1d10434
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/metrics/ZenkoMetrics.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import promClient from 'prom-client';

// 'timeout' property is not needed/supported
// https://github.com/siimon/prom-client/blob/199b7d19f8c8c34ee8653264e8dc0e57b420074f/CHANGELOG.md#1200---2020-02-20
promClient.collectDefaultMetrics();

export default class ZenkoMetrics {
static createCounter(params: promClient.CounterConfiguration<string>) {
return new promClient.Counter(params);
Expand Down Expand Up @@ -32,4 +28,8 @@ export default class ZenkoMetrics {
static asPrometheusContentType() {
return promClient.register.contentType;
}

static collectDefaultMetrics() {
return promClient.collectDefaultMetrics();
}
}

0 comments on commit 1d10434

Please sign in to comment.