Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { createMetricsRegistry } from "@hivegrid/metrics";
|
||||
import { Counter, Gauge, Histogram } from "prom-client";
|
||||
|
||||
export function createControllerMetrics(revision: string, collectDefaultProcessMetrics = true) {
|
||||
const registry = createMetricsRegistry({
|
||||
serviceName: "portal-domain-controller",
|
||||
collectDefaultProcessMetrics,
|
||||
defaultLabels: { revision },
|
||||
});
|
||||
const commands = new Counter({
|
||||
name: "hivegrid_portal_domain_commands_total",
|
||||
help: "Portal domain commands by action and outcome.",
|
||||
labelNames: ["action", "status"] as const,
|
||||
registers: [registry],
|
||||
});
|
||||
const duration = new Histogram({
|
||||
name: "hivegrid_portal_domain_command_duration_seconds",
|
||||
help: "Portal domain command processing duration.",
|
||||
labelNames: ["action"] as const,
|
||||
buckets: [0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30],
|
||||
registers: [registry],
|
||||
});
|
||||
const ready = new Gauge({
|
||||
name: "hivegrid_portal_domain_controller_ready",
|
||||
help: "Whether Redis and the dedicated Traefik config directory are ready.",
|
||||
registers: [registry],
|
||||
});
|
||||
return { registry, commands, duration, ready };
|
||||
}
|
||||
|
||||
export type ControllerMetrics = ReturnType<typeof createControllerMetrics>;
|
||||
Reference in new issue
Block a user