Files
peardata/shared/metrics-more.js
T
Raven Scott 1458915d78
CI / test (push) Successful in 56s
Release rolling / release (push) Successful in 7m4s
Docker work
2026-07-19 13:13:45 -04:00

577 lines
16 KiB
JavaScript

/**
* Remaining host / app chart definitions (merged into STATIC_CHART_DEFS).
*/
/** @type {import('./metrics.js').ChartDef[]} */
export const MORE_STATIC_CHARTS = [
// Memory extras
{
id: 'mem.high_low',
name: 'mem.high_low',
context: 'mem.high_low',
title: 'High / low memory watermarks',
units: 'MiB',
family: 'watermarks',
chartType: 'line',
priority: 264,
plugin: 'proc',
dimensions: [
{ id: 'high', name: 'high', algorithm: 'absolute' },
{ id: 'low', name: 'low', algorithm: 'absolute' },
],
},
{
id: 'mem.cma',
name: 'mem.cma',
context: 'mem.cma',
title: 'Contiguous Memory Allocator',
units: 'MiB',
family: 'cma',
chartType: 'stacked',
priority: 265,
plugin: 'proc',
dimensions: [
{ id: 'total', name: 'total', algorithm: 'absolute' },
{ id: 'free', name: 'free', algorithm: 'absolute' },
],
},
{
id: 'mem.directmaps',
name: 'mem.directmaps',
context: 'mem.directmaps',
title: 'DirectMap page sizes',
units: 'MiB',
family: 'directmap',
chartType: 'stacked',
priority: 266,
plugin: 'proc',
dimensions: [
{ id: '4k', name: '4k', algorithm: 'absolute' },
{ id: '2M', name: '2M', algorithm: 'absolute' },
{ id: '1G', name: '1G', algorithm: 'absolute' },
],
},
{
id: 'mem.ksm_savings',
name: 'mem.ksm_savings',
context: 'mem.ksm_savings',
title: 'KSM memory savings',
units: 'MiB',
family: 'ksm',
chartType: 'line',
priority: 267,
plugin: 'proc',
dimensions: [
{ id: 'offered', name: 'offered', algorithm: 'absolute' },
{ id: 'saved', name: 'saved', algorithm: 'absolute' },
],
},
{
id: 'mem.ksm_ratios',
name: 'mem.ksm_ratios',
context: 'mem.ksm_ratios',
title: 'KSM savings ratio',
units: 'percentage',
family: 'ksm',
chartType: 'line',
priority: 268,
plugin: 'proc',
dimensions: [{ id: 'savings', name: 'savings', algorithm: 'absolute' }],
},
{
id: 'mem.thp_file',
name: 'mem.thp_file',
context: 'mem.thp_file',
title: 'THP file events',
units: 'events/s',
family: 'thp',
chartType: 'line',
priority: 269,
plugin: 'proc',
dimensions: [
{ id: 'alloc', name: 'alloc', algorithm: 'incremental' },
{ id: 'fallback', name: 'fallback', algorithm: 'incremental' },
{ id: 'mapped', name: 'mapped', algorithm: 'incremental' },
],
},
{
id: 'mem.thp_zero',
name: 'mem.thp_zero',
context: 'mem.thp_zero',
title: 'THP zero-page events',
units: 'events/s',
family: 'thp',
chartType: 'line',
priority: 270,
plugin: 'proc',
dimensions: [
{ id: 'alloc', name: 'alloc', algorithm: 'incremental' },
{ id: 'failed', name: 'failed', algorithm: 'incremental' },
],
},
{
id: 'mem.thp_collapse',
name: 'mem.thp_collapse',
context: 'mem.thp_collapse',
title: 'THP collapse events',
units: 'events/s',
family: 'thp',
chartType: 'line',
priority: 271,
plugin: 'proc',
dimensions: [
{ id: 'alloc', name: 'alloc', algorithm: 'incremental' },
{ id: 'failed', name: 'failed', algorithm: 'incremental' },
],
},
{
id: 'mem.thp_swapout',
name: 'mem.thp_swapout',
context: 'mem.thp_swapout',
title: 'THP swapout events',
units: 'events/s',
family: 'thp',
chartType: 'line',
priority: 272,
plugin: 'proc',
dimensions: [
{ id: 'swapout', name: 'swapout', algorithm: 'incremental' },
{ id: 'fallback', name: 'fallback', algorithm: 'incremental' },
],
},
{
id: 'mem.thp_compact',
name: 'mem.thp_compact',
context: 'mem.thp_compact',
title: 'Memory compaction',
units: 'events/s',
family: 'thp',
chartType: 'line',
priority: 273,
plugin: 'proc',
dimensions: [
{ id: 'success', name: 'success', algorithm: 'incremental' },
{ id: 'fail', name: 'fail', algorithm: 'incremental' },
{ id: 'stall', name: 'stall', algorithm: 'incremental' },
],
},
{
id: 'mem.pagetype_global',
name: 'mem.pagetype_global',
context: 'mem.pagetype_global',
title: 'Free pages by order (global)',
units: 'pages',
family: 'pagetype',
chartType: 'stacked',
priority: 274,
plugin: 'proc',
dimensions: Array.from({ length: 11 }, (_, i) => ({
id: `order${i}`,
name: `order${i}`,
algorithm: 'absolute',
})),
},
{
id: 'system.softirqs',
name: 'system.softirqs',
context: 'system.softirqs',
title: 'SoftIRQs by vector',
units: 'softirqs/s',
family: 'softirq',
chartType: 'stacked',
priority: 781,
plugin: 'proc',
dimensions: [
{ id: 'HI', name: 'HI', algorithm: 'incremental' },
{ id: 'TIMER', name: 'TIMER', algorithm: 'incremental' },
{ id: 'NET_TX', name: 'NET_TX', algorithm: 'incremental' },
{ id: 'NET_RX', name: 'NET_RX', algorithm: 'incremental' },
{ id: 'BLOCK', name: 'BLOCK', algorithm: 'incremental' },
{ id: 'IRQ_POLL', name: 'IRQ_POLL', algorithm: 'incremental' },
{ id: 'TASKLET', name: 'TASKLET', algorithm: 'incremental' },
{ id: 'SCHED', name: 'SCHED', algorithm: 'incremental' },
{ id: 'HRTIMER', name: 'HRTIMER', algorithm: 'incremental' },
{ id: 'RCU', name: 'RCU', algorithm: 'incremental' },
],
},
{
id: 'ipv4.icmpmsg',
name: 'ipv4.icmpmsg',
context: 'ipv4.icmpmsg',
title: 'IPv4 ICMP message types',
units: 'messages/s',
family: 'icmp',
chartType: 'line',
priority: 757,
plugin: 'proc',
dimensions: [
{ id: 'InEchoes', name: 'InEchoes', algorithm: 'incremental' },
{ id: 'OutEchoes', name: 'OutEchoes', algorithm: 'incremental' },
{ id: 'InDestUnreachs', name: 'InDestUnreachs', algorithm: 'incremental' },
{ id: 'OutDestUnreachs', name: 'OutDestUnreachs', algorithm: 'incremental' },
{ id: 'InTimeExcds', name: 'InTimeExcds', algorithm: 'incremental' },
{ id: 'OutTimeExcds', name: 'OutTimeExcds', algorithm: 'incremental' },
{ id: 'InRedirects', name: 'InRedirects', algorithm: 'incremental' },
{ id: 'OutRedirects', name: 'OutRedirects', algorithm: 'incremental' },
],
},
{
id: 'ipv6.packets',
name: 'ipv6.packets',
context: 'ipv6.packets',
title: 'IPv6 packets',
units: 'packets/s',
family: 'ipv6',
chartType: 'line',
priority: 758,
plugin: 'proc',
dimensions: [
{ id: 'received', name: 'received', algorithm: 'incremental' },
{ id: 'sent', name: 'sent', algorithm: 'incremental' },
{ id: 'forwarded', name: 'forwarded', algorithm: 'incremental' },
{ id: 'delivered', name: 'delivered', algorithm: 'incremental' },
],
},
{
id: 'ipv6.errors',
name: 'ipv6.errors',
context: 'ipv6.errors',
title: 'IPv6 errors',
units: 'packets/s',
family: 'ipv6',
chartType: 'line',
priority: 759,
plugin: 'proc',
dimensions: [
{ id: 'InHdrErrors', name: 'InHdrErrors', algorithm: 'incremental' },
{ id: 'InAddrErrors', name: 'InAddrErrors', algorithm: 'incremental' },
{ id: 'InDiscards', name: 'InDiscards', algorithm: 'incremental' },
{ id: 'OutDiscards', name: 'OutDiscards', algorithm: 'incremental' },
{ id: 'InTruncatedPkts', name: 'InTruncatedPkts', algorithm: 'incremental' },
],
},
{
id: 'ipv6.icmp',
name: 'ipv6.icmp',
context: 'ipv6.icmp',
title: 'IPv6 ICMP',
units: 'messages/s',
family: 'ipv6',
chartType: 'line',
priority: 760,
plugin: 'proc',
dimensions: [
{ id: 'received', name: 'received', algorithm: 'incremental' },
{ id: 'sent', name: 'sent', algorithm: 'incremental' },
{ id: 'InErrors', name: 'InErrors', algorithm: 'incremental' },
{ id: 'OutErrors', name: 'OutErrors', algorithm: 'incremental' },
],
},
{
id: 'net.conntrack',
name: 'net.conntrack',
context: 'net.conntrack',
title: 'Connection tracking',
units: 'connections',
family: 'conntrack',
chartType: 'line',
priority: 770,
plugin: 'proc',
dimensions: [
{ id: 'entries', name: 'entries', algorithm: 'absolute' },
{ id: 'max', name: 'max', algorithm: 'absolute' },
{ id: 'searched', name: 'searched', algorithm: 'incremental' },
{ id: 'found', name: 'found', algorithm: 'incremental' },
{ id: 'new', name: 'new', algorithm: 'incremental' },
{ id: 'invalid', name: 'invalid', algorithm: 'incremental' },
{ id: 'drop', name: 'drop', algorithm: 'incremental' },
{ id: 'insert_failed', name: 'insert_failed', algorithm: 'incremental' },
],
},
{
id: 'system.inotify',
name: 'system.inotify',
context: 'system.inotify',
title: 'Inotify watches',
units: 'watches',
family: 'inotify',
chartType: 'line',
priority: 790,
plugin: 'proc',
dimensions: [
{ id: 'max_user_watches', name: 'max_user_watches', algorithm: 'absolute' },
{ id: 'max_user_instances', name: 'max_user_instances', algorithm: 'absolute' },
],
},
{
id: 'md.health',
name: 'md.health',
context: 'md.health',
title: 'MD RAID arrays',
units: 'arrays',
family: 'md',
chartType: 'line',
priority: 4500,
plugin: 'mdstat',
dimensions: [
{ id: 'active', name: 'active', algorithm: 'absolute' },
{ id: 'degraded', name: 'degraded', algorithm: 'absolute' },
{ id: 'recovering', name: 'recovering', algorithm: 'absolute' },
],
},
{
id: 'system.power',
name: 'system.power',
context: 'system.power',
title: 'Package power (RAPL)',
units: 'Watts',
family: 'power',
chartType: 'line',
priority: 7100,
plugin: 'powercap',
dimensions: [{ id: 'package', name: 'package', algorithm: 'absolute' }],
},
{
id: 'mem.edac',
name: 'mem.edac',
context: 'mem.edac',
title: 'EDAC memory errors',
units: 'errors',
family: 'edac',
chartType: 'line',
priority: 275,
plugin: 'edac',
dimensions: [
{ id: 'corrected', name: 'corrected', algorithm: 'absolute' },
{ id: 'uncorrected', name: 'uncorrected', algorithm: 'absolute' },
],
},
{
id: 'peardata.cpu',
name: 'peardata.cpu',
context: 'peardata.cpu',
title: 'Agent CPU usage',
units: 'percentage',
family: 'self',
chartType: 'area',
priority: 9000,
plugin: 'self',
dimensions: [
{ id: 'user', name: 'user', algorithm: 'absolute' },
{ id: 'system', name: 'system', algorithm: 'absolute' },
],
},
{
id: 'peardata.mem',
name: 'peardata.mem',
context: 'peardata.mem',
title: 'Agent memory',
units: 'MiB',
family: 'self',
chartType: 'area',
priority: 9010,
plugin: 'self',
dimensions: [
{ id: 'rss', name: 'rss', algorithm: 'absolute' },
{ id: 'heap', name: 'heap', algorithm: 'absolute' },
],
},
{
id: 'peardata.charts',
name: 'peardata.charts',
context: 'peardata.charts',
title: 'Agent chart cardinality',
units: 'charts',
family: 'self',
chartType: 'line',
priority: 9020,
plugin: 'self',
dimensions: [{ id: 'registered', name: 'registered', algorithm: 'absolute' }],
},
]
export function makeDiskSvctmChart(disk) {
return {
id: `disk_svctm.${disk}`,
name: `disk_svctm.${disk}`,
context: 'disk.svctm',
title: `Disk ${disk} service time`,
units: 'milliseconds/operation',
family: disk,
chartType: 'line',
priority: 2090,
plugin: 'proc',
dimensions: [{ id: 'svctm', name: 'svctm', algorithm: 'absolute' }],
}
}
export function makeDiskMergedChart(disk) {
return {
id: `disk_merged.${disk}`,
name: `disk_merged.${disk}`,
context: 'disk.merged',
title: `Disk ${disk} merged operations`,
units: 'operations/s',
family: disk,
chartType: 'line',
priority: 2095,
plugin: 'proc',
dimensions: [
{ id: 'reads', name: 'reads', algorithm: 'incremental' },
{ id: 'writes', name: 'writes', algorithm: 'incremental' },
],
}
}
export function makeDiskFlushChart(disk) {
return {
id: `disk_flush.${disk}`,
name: `disk_flush.${disk}`,
context: 'disk.flush',
title: `Disk ${disk} flush requests`,
units: 'operations/s',
family: disk,
chartType: 'line',
priority: 2096,
plugin: 'proc',
dimensions: [{ id: 'operations', name: 'operations', algorithm: 'incremental' }],
}
}
export function makeNetDuplexChart(iface) {
return {
id: `net_duplex.${iface}`,
name: `net_duplex.${iface}`,
context: 'net.duplex',
title: `Interface ${iface} duplex`,
units: 'state',
family: iface,
chartType: 'line',
priority: 3045,
plugin: 'proc',
dimensions: [
{ id: 'full', name: 'full', algorithm: 'absolute' },
{ id: 'half', name: 'half', algorithm: 'absolute' },
],
}
}
export function makeNetMtuChart(iface) {
return {
id: `net_mtu.${iface}`,
name: `net_mtu.${iface}`,
context: 'net.mtu',
title: `Interface ${iface} MTU`,
units: 'octets',
family: iface,
chartType: 'line',
priority: 3046,
plugin: 'proc',
dimensions: [{ id: 'mtu', name: 'mtu', algorithm: 'absolute' }],
}
}
export function makeNetQueueChart(iface) {
return {
id: `net_queue.${iface}`,
name: `net_queue.${iface}`,
context: 'net.queue_length',
title: `Interface ${iface} TX queue length`,
units: 'packets',
family: iface,
chartType: 'line',
priority: 3047,
plugin: 'proc',
dimensions: [{ id: 'tx_queue_len', name: 'tx_queue_len', algorithm: 'absolute' }],
}
}
export function makeIrqChart(irq, name) {
const id = String(irq).replace(/[^\w.-]/g, '_')
return {
id: `system.intr_irq.${id}`,
name: `system.intr_irq.${id}`,
context: 'system.intr_irq',
title: `IRQ ${irq} ${name || ''}`.trim(),
units: 'interrupts/s',
family: 'irq',
chartType: 'line',
priority: 115,
plugin: 'proc',
dimensions: [{ id: 'interrupts', name: 'interrupts', algorithm: 'incremental' }],
}
}
export function makeCpuIdleChart(coreId) {
return {
id: `cpuidle.cpu${coreId}`,
name: `cpuidle.cpu${coreId}`,
context: 'cpuidle.cpu_cstate_residency_time',
title: `CPU ${coreId} C-state residency`,
units: 'percentage',
family: `cpu${coreId}`,
chartType: 'stacked',
priority: 190,
plugin: 'proc',
dimensions: [{ id: 'active', name: 'active', algorithm: 'absolute' }],
}
}
export function makeNumaNodeMemChart(node) {
return {
id: `mem.numa_node.${node}`,
name: `mem.numa_node.${node}`,
context: 'mem.numa_node_mem_usage',
title: `NUMA node ${node} memory`,
units: 'MiB',
family: `node${node}`,
chartType: 'stacked',
priority: 276,
plugin: 'proc',
dimensions: [
{ id: 'MemTotal', name: 'MemTotal', algorithm: 'absolute' },
{ id: 'MemFree', name: 'MemFree', algorithm: 'absolute' },
{ id: 'MemUsed', name: 'MemUsed', algorithm: 'absolute' },
],
}
}
export function makeCgroupMemDetailChart(id, title) {
const safe = String(id).replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 96)
const display = title || safe
return {
id: `cgroup.mem_detail.${safe}`,
name: `cgroup.mem_detail.${safe}`,
context: 'cgroup.mem_detail',
title: `${display} · memory detail`,
units: 'MiB',
family: display,
chartType: 'stacked',
priority: 6110,
plugin: 'cgroups',
dimensions: [
{ id: 'anon', name: 'anon', algorithm: 'absolute' },
{ id: 'file', name: 'file', algorithm: 'absolute' },
{ id: 'kernel', name: 'kernel', algorithm: 'absolute' },
{ id: 'sock', name: 'sock', algorithm: 'absolute' },
],
}
}
export function makeCgroupThrottleChart(id, title) {
const safe = String(id).replace(/[^a-zA-Z0-9_.-]/g, '_').slice(0, 96)
const display = title || safe
return {
id: `cgroup.throttle.${safe}`,
name: `cgroup.throttle.${safe}`,
context: 'cgroup.cpu_throttle',
title: `${display} · CPU throttle`,
units: 'percentage',
family: display,
chartType: 'area',
priority: 6010,
plugin: 'cgroups',
dimensions: [{ id: 'throttled', name: 'throttled', algorithm: 'absolute' }],
}
}