From e1a50be14944226275cc1bae9561d6f4ea49d9e9 Mon Sep 17 00:00:00 2001 From: Jinna Kiisuo Date: Fri, 1 Dec 2023 13:36:23 +0200 Subject: [PATCH] Prefix custom metrics with `rotom_` as per naming best practices --- packages/server/src/utils.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/server/src/utils.ts b/packages/server/src/utils.ts index 3fae0a4..bf0a683 100644 --- a/packages/server/src/utils.ts +++ b/packages/server/src/utils.ts @@ -3,35 +3,37 @@ import { Registry, collectDefaultMetrics, Gauge } from 'prom-client'; export const promRegistry = new Registry(); collectDefaultMetrics({ register: promRegistry }); +const prefix = 'rotom_'; + export const devicesGauge = new Gauge({ - name: 'devices', + name: prefix + 'devices', help: 'Devices in use', registers: [promRegistry], }); export const workersGauge = new Gauge({ - name: 'workers', + name: prefix + 'workers', help: 'Workers in use', labelNames: ['origin'], registers: [promRegistry], }); export const deviceMemoryFree = new Gauge({ - name: 'device_memory_free', + name: prefix + 'device_memory_free', help: 'Device Memory Free', labelNames: ['origin'], registers: [promRegistry], }); export const deviceMemoryMitm = new Gauge({ - name: 'device_memory_mitm', + name: prefix + 'device_memory_mitm', help: 'Device Memory MITM', labelNames: ['origin'], registers: [promRegistry], }); export const deviceMemoryStart = new Gauge({ - name: 'device_memory_start', + name: prefix + 'device_memory_start', help: 'Device Memory Start', labelNames: ['origin'], registers: [promRegistry],