Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/metrics-gatherer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ export class MetricsGatherer {
// create either a counter if `_total` suffix is found, or
// a gauge otherwise
const kind =
this.meta[name]?.kind ?? (/.+_total$/.test(name) ? 'counter' : 'gauge');
this.meta[name]?.kind ??
(name.endsWith('_total') ? 'counter' : 'gauge');
this.ensureExists(kind, name, labels);
if (!this.checkMetricType(name, ['gauge', 'counter'])) {
throw new MetricsGathererError(
Expand Down
Loading