Skip to content

Commit

Permalink
Prefix custom metrics with rotom_ as per naming best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
Jinna Kiisuo committed Dec 1, 2023
1 parent f99624c commit e1a50be
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/server/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit e1a50be

Please sign in to comment.