Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefix custom metrics with rotom_ as per naming best practices #19

Merged
merged 1 commit into from
Dec 1, 2023
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
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