Sensors: per-service and container sensors, pattern-limited tokens, fleet query, steady sampler
- service.<unit>.active|state for services that are enabled, up or failed - containers.* and container.<name>.running|state|health|mem|cpu (cgroup reads, no docker stats) - sensors:read tokens can be limited to ID patterns, enforced on every endpoint and, through the hub's filter header, on managed machines; the header can only narrow - /api/fleet/sensors/query: one shaped query, every machine, one request - the sampler waits what's left of the interval, so 250 ms means 4 a second - Monitors asks for the families it draws instead of * - unpowered hwmon sentinels (-93 °C) are not temperatures Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
4ddf10be51
commit
4c2eb57ea6
@@ -8,7 +8,16 @@ export type Values = Record<string, number | boolean | string>
|
||||
export type Catalog = Map<string, Sensor>
|
||||
|
||||
// Everything the modules draw, as one stream query.
|
||||
export const MONITOR_SHAPE = { v: '*' }
|
||||
export const MONITOR_SHAPE = ['cpu.*', 'load.*', 'uptime', 'hamlab.*', 'mem.*', 'swap.*', 'temp.*', 'fan.*', 'net.*', 'disk.*', 'fs.*', 'ups.*']
|
||||
// The stream answers a list with a list; the modules want one flat map.
|
||||
export function mergeValues(parts: unknown[]): Values {
|
||||
const out: Values = {}
|
||||
parts.forEach((part, i) => {
|
||||
if (part && typeof part === 'object') Object.assign(out, part)
|
||||
else if (part !== null && part !== undefined) out[MONITOR_SHAPE[i]] = part as Values[string]
|
||||
})
|
||||
return out
|
||||
}
|
||||
// The curves they keep: CPU, memory, per-NIC and per-disk rates, every temperature.
|
||||
export const MONITOR_HISTORY = 'cpu.usage,mem.used,net.*.rx,net.*.tx,disk.*.read,disk.*.write,disk.*.util,temp.*'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user