1 - Metrics Reference
This reference lists metric names, units, labels, sources, and measurement semantics. See Kernel-Wide Insight for capabilities and troubleshooting scenarios.
How to Read This Reference
Common metrics are grouped by CPU, memory, network, I/O, system events, and GPU for querying and troubleshooting. Actual output depends on kernel interfaces, device drivers, enabled collectors, and filters. The node’s /metrics output is authoritative for the complete set. See Node Configuration for enablement.
- Names: tables omit the
huatuo_bamai_ prefix. For example, cpu_util_total is exposed as huatuo_bamai_cpu_util_total.
- Labels: all metrics include
host and region. Container metrics also include container_host, container_hostnamespace, container_level, container_name, and container_type. Tables list only additional labels; — means none.
- Counts and units: counts measure events or objects, not latency. Use
rate() or increase() for cumulative Counters. Some cumulative kernel statistics are exported as Gauges; interpret their field semantics rather than inferring from type or name alone.
- Examples: values illustrate output format, not diagnostic thresholds. A missing metric does not mean zero.
# TYPE huatuo_bamai_runqlat_latency counter
huatuo_bamai_runqlat_latency{host="hostname",region="dev",zone="0"} 35100
# TYPE huatuo_bamai_runqlat_container_latency counter
huatuo_bamai_runqlat_container_latency{container_host="coredns-855c4dd65d-8v5kg",container_hostnamespace="kube-system",container_level="burstable",container_name="coredns",container_type="normal",host="hostname",region="dev",zone="0"} 226
This example shows host and container scheduling-latency bucket counts. The zone ranges are listed below.
huatuo_bamai_build_info and huatuo_apiserver_build_info are Gauges with a
constant value of 1, describing the running bamai and apiserver builds
respectively. Each is exposed by its application’s /metrics endpoint and
uses the same build information as that application’s /version endpoint.
They carry the existing host and region labels (empty for apiserver) and
these build labels:
| Label |
Meaning |
name |
Application name, matching name in /version |
version |
Application release version, matching version in /version |
git_commit |
Build Git identifier, matching git_commit in /version; not necessarily a full SHA |
git_tree_state |
Build working-tree state: clean, dirty, or unknown |
build_time |
Timestamp from /version: injected build time, falling back to VCS commit time or (devel) |
go_version |
Go toolchain version used to build the application |
compiler |
Go compiler, such as gc |
platform |
Operating system and architecture, such as linux/amd64 |
When no release version is supplied, version uses (devel). git_commit
uses the injected identifier first, then the VCS revision from Go build information,
and falls back to (devel) when neither is available.
Build labels apply only to this metric; business metric labels remain unchanged.
After scraping, join build information with business metrics using the same
job and instance. Cross-cluster queries must also include the labels that
distinguish targets between clusters.
CPU
Scheduling Latency
Scheduling latency is the wait from becoming runnable to actually receiving CPU time. These eBPF metrics are cumulative Counters bucketed by zone: 0 = [0, 10) ms, 1 = [10, 20) ms, 2 = [20, 50) ms, and 3 = >=50 ms.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
runqlat_container_latency |
Scheduling-latency bucket count |
Count |
Container |
eBPF |
zone |
runqlat_latency |
Scheduling-latency bucket count |
Count |
Host |
eBPF |
zone |
Softirq Latency
Measures the wait from softirq raise to processing on each CPU. Currently only NET_RX and NET_TX are emitted. This is a cumulative Counter with zone buckets: 0 = [0, 10) μs, 1 = [10, 100) μs, 2 = [100, 1000) μs, and 3 = >=1 ms.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
softirq_latency |
Softirq response-latency bucket count |
Count |
Host |
eBPF |
cpuid, type, zone |
Utilization
Host utilization is normalized by online CPU cores; container utilization by available CPU capacity. Values range from 0 to 100%.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
cpu_util_sys |
Kernel-mode CPU utilization |
% |
Host |
— |
cpu_util_usr |
User-mode CPU utilization |
% |
Host |
— |
cpu_util_total |
Total CPU utilization |
% |
Host |
— |
cpu_util_container_sys |
Kernel-mode CPU utilization |
% |
Container |
— |
cpu_util_container_usr |
User-mode CPU utilization |
% |
Container |
— |
cpu_util_container_total |
Total CPU utilization |
% |
Container |
— |
Available Cores
Container CPU capacity is the smaller of quota-derived cores and the effective CPU set size. Without a quota, it uses the effective CPU set size; if unavailable, it falls back to online host cores.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
cpu_util_container_cores |
Available CPU capacity (may be fractional) |
Cores |
Container |
— |
Throttling and Contention
Throttling statistics come from cgroup CPU interfaces and include only fields provided by the kernel. The wait ratio also requires kernel wait_sum and kernel.sched_schedstats=1.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
cpu_stat_container_nr_throttled |
Cumulative periods in which the cgroup was CPU-throttled |
Count |
Container |
— |
cpu_stat_container_throttled_time |
Cumulative time the cgroup was throttled |
Nanoseconds |
Container |
— |
cpu_stat_container_wait_sum_percent |
Cgroup wait time in the parent run queue as a share of schedulable time during the interval |
% |
Container |
— |
The interval wait ratio is wait-time delta / (wait-time delta + CPU-usage delta) × 100%. It measures waiting as a share of schedulable time, not the share spent throttled.
References:
Burst Usage
Counts periods and time using burst CPU capacity. Emitted only when the kernel provides the corresponding fields.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
cpu_stat_container_burst_time |
Cumulative time using burst CPU capacity |
Nanoseconds |
Container |
— |
cpu_stat_container_nr_bursts |
Cumulative periods using burst CPU capacity |
Count |
Container |
— |
Load
Hosts report 1-, 5-, and 15-minute load averages. Containers report current runnable and uninterruptible task counts, which use a different time basis.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
Notes |
loadavg_load1 |
System load average over the past 1 minute |
Tasks |
Host |
— |
— |
loadavg_load5 |
System load average over the past 5 minutes |
Tasks |
Host |
— |
— |
loadavg_load15 |
System load average over the past 15 minutes |
Tasks |
Host |
— |
— |
loadavg_container_nr_running |
Current runnable tasks, including running tasks and tasks waiting for CPU |
Count |
Container |
— |
cgroup v1 only |
loadavg_container_nr_uninterruptible |
Uninterruptible tasks in the container |
Count |
Container |
— |
cgroup v1 only |
Memory
Reclaim
Memory reclaim and compaction can block tasks. These metrics record host cumulative durations and container direct-reclaim event counts.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
memory_free_allocpages_stall |
Cumulative host direct-reclaim duration |
Milliseconds |
Host |
eBPF |
— |
memory_free_compaction_stall |
Cumulative host memory-compaction duration |
Milliseconds |
Host |
eBPF |
— |
memory_reclaim_container_directstall |
Container direct-reclaim event count |
Count |
Container |
eBPF |
— |
memory_others_container_directstall_time, memory_others_container_asyncreclaim_time, and memory_others_container_local_direct_reclaim_time depend on DiDi custom-kernel interfaces memory.directstall_stat, memory.asynreclaim_stat, and memory.local_direct_reclaim_time.
Mainline and common distribution kernels without these interfaces do not emit the metrics; no additional module is needed. Use memory_reclaim_container_directstall for container direct-reclaim counts on standard kernels.
Memory State
Container fields come from memory.stat; host fields from /proc/vmstat. Both are subject to MetricCollector.Vmstat filters. Field availability and meanings depend on kernel and cgroup versions.
Container memory
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_container_active_file |
Active file memory |
Bytes |
Container |
— |
memory_vmstat_container_active_anon |
Active anonymous memory |
Bytes |
Container |
— |
memory_vmstat_container_inactive_file |
Inactive file memory |
Bytes |
Container |
— |
memory_vmstat_container_inactive_anon |
Inactive anonymous memory |
Bytes |
Container |
— |
memory_vmstat_container_file_dirty |
Modified file memory not yet written to disk |
Bytes |
Container |
— |
memory_vmstat_container_file_writeback |
File memory being written back |
Bytes |
Container |
— |
memory_vmstat_container_dirty |
Modified memory not yet written to disk |
Bytes |
Container |
— |
memory_vmstat_container_writeback |
Memory being written back |
Bytes |
Container |
— |
memory_vmstat_container_pgdeactivate |
Pages moved from the active to inactive LRU |
Pages |
Container |
— |
memory_vmstat_container_pgrefill |
Total pages scanned on the active LRU |
Pages |
Container |
— |
memory_vmstat_container_pgscan_direct |
Total pages scanned on the inactive LRU during direct reclaim |
Pages |
Container |
— |
memory_vmstat_container_pgscan_kswapd |
Total pages scanned on the inactive LRU by kswapd |
Pages |
Container |
— |
memory_vmstat_container_pgsteal_direct |
Total pages reclaimed from the inactive LRU by direct reclaim |
Pages |
Container |
— |
memory_vmstat_container_pgsteal_kswapd |
Total pages reclaimed from the inactive LRU by kswapd |
Pages |
Container |
— |
memory_vmstat_container_unevictable |
Bytes in unevictable pages |
Bytes |
Container |
— |
Host memory
The names below include memory_vmstat_. Underlying values are exported unchanged rather than uniformly converted to bytes. pgpgin and pgpgout use the kernel’s KiB units; see the Linux vmstat implementation.
Page state and LRU
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_nr_free_pages |
Free pages immediately allocatable by the buddy system |
Pages |
Host |
— |
memory_vmstat_nr_inactive_anon |
Inactive anonymous pages |
Pages |
Host |
— |
memory_vmstat_nr_inactive_file |
Inactive file pages |
Pages |
Host |
— |
memory_vmstat_nr_active_anon |
Active anonymous pages |
Pages |
Host |
— |
memory_vmstat_nr_active_file |
Active file pages |
Pages |
Host |
— |
memory_vmstat_nr_unevictable |
Unevictable pages |
Pages |
Host |
— |
memory_vmstat_nr_mlock |
Pages locked by mlock() |
Pages |
Host |
— |
memory_vmstat_nr_shmem |
Pages used by tmpfs/shmem |
Pages |
Host |
— |
memory_vmstat_nr_slab_reclaimable |
Pages used by reclaimable Slab |
Pages |
Host |
— |
memory_vmstat_nr_slab_unreclaimable |
Pages used by unreclaimable Slab |
Pages |
Host |
— |
Dirty pages and writeback
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_nr_dirty |
Current dirty pages |
Pages |
Host |
— |
memory_vmstat_nr_writeback |
Pages being written back |
Pages |
Host |
— |
memory_vmstat_nr_dirty_threshold |
Dirty-page throttling threshold |
Pages |
Host |
— |
memory_vmstat_nr_dirty_background_threshold |
Background writeback threshold |
Pages |
Host |
— |
Page faults and swapping
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_pgfault |
Total page faults |
Count |
Host |
— |
memory_vmstat_pgmajfault |
Major page faults |
Count |
Host |
— |
memory_vmstat_pgpgin |
Data read from block devices |
KiB |
Host |
— |
memory_vmstat_pgpgout |
Data written to block devices |
KiB |
Host |
— |
memory_vmstat_pswpin |
Pages swapped in |
Pages |
Host |
— |
memory_vmstat_pswpout |
Pages swapped out |
Pages |
Host |
— |
Reclaim and scanning
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_pgscan_kswapd |
Pages scanned by kswapd |
Pages |
Host |
— |
memory_vmstat_pgscan_direct |
Pages scanned by direct reclaim |
Pages |
Host |
— |
memory_vmstat_pgscan_khugepaged |
Pages scanned by khugepaged |
Pages |
Host |
— |
memory_vmstat_pgsteal_kswapd |
Pages reclaimed by kswapd |
Pages |
Host |
— |
memory_vmstat_pgsteal_direct |
Pages reclaimed by direct reclaim |
Pages |
Host |
— |
memory_vmstat_pgsteal_khugepaged |
Pages reclaimed by khugepaged |
Pages |
Host |
— |
Transparent Huge Pages (THP)
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_thp_fault_alloc |
Successful THP allocations on page faults |
Count |
Host |
— |
memory_vmstat_thp_fault_fallback |
THP allocation failures on faults that fall back to ordinary pages |
Count |
Host |
— |
memory_vmstat_thp_collapse_alloc |
Successful THP collapses by khugepaged |
Count |
Host |
— |
memory_vmstat_thp_collapse_alloc_failed |
Failed THP collapses by khugepaged |
Count |
Host |
— |
NUMA
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_vmstat_numa_hit |
Pages allocated on the preferred NUMA node |
Pages |
Host |
— |
memory_vmstat_numa_miss |
Pages allocated on this node when another node was preferred |
Pages |
Host |
— |
memory_vmstat_numa_foreign |
Pages allocated elsewhere when this node was preferred |
Pages |
Host |
— |
memory_vmstat_numa_local |
Pages allocated on the current CPU’s NUMA node |
Pages |
Host |
— |
memory_vmstat_numa_other |
Pages allocated outside the current CPU’s NUMA node |
Pages |
Host |
— |
memory_vmstat_numa_pages_migrated |
Total pages successfully migrated by automatic NUMA balancing |
Pages |
Host |
— |
References:
Memory Events
These fields come from memory.events and count reclaim, memory-limit, and OOM events. Mainline kernels provide it in cgroup v2; DiDi custom kernels may also provide it in cgroup v1. Nothing is emitted if the interface is absent. Fields count different conditions and must not be added as independent events.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
memory_events_container_low |
Reclaims under pressure below memory.low, usually indicating overcommitted low-memory protection |
Count |
Container |
— |
memory_events_container_high |
Throttling and direct-reclaim events after exceeding memory.high |
Count |
Container |
— |
memory_events_container_max |
Attempts to exceed memory.max |
Count |
Container |
— |
memory_events_container_oom |
Events where memory reaches the limit, allocation is about to fail, and OOM handling is considered |
Count |
Container |
— |
memory_events_container_oom_kill |
Processes in this cgroup killed by any OOM killer |
Count |
Container |
— |
memory_events_container_oom_group_kill |
Group OOM kill events |
Count |
Container |
— |
Free Memory Blocks
Shows free block counts by NUMA node, memory zone, and order. order=n means each block contains 2^n contiguous pages. The value counts blocks, not pages.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
memory_buddyinfo_blocks |
Free blocks for the specified NUMA node, zone, and order |
Blocks |
Host |
procfs |
node, order, zone |
Container reclaim and compaction stall times
| Metric |
Description |
Unit |
Target |
Source |
Labels |
| memory_free_container_allocpages_stall |
Container task time in global direct reclaim |
milliseconds |
Container |
eBPF |
container_host, container_hostnamespace, container_level, container_name, container_type, host, region |
| memory_free_container_compaction_stall |
Container task time in direct compaction |
milliseconds |
Container |
eBPF |
same container labels |
These cumulative Gauge values measure task time in global direct reclaim and compaction. Host totals include container work. Missing or ambiguous container records are omitted; container collection failures preserve host output. Loading requires the container probes; a load or attachment failure disables this collector. Container recreation starts a new container total without resetting the host total. BPF reload resets both.
Host-wide memcg reclaim count
| Metric |
Description |
Unit |
Target |
Source |
Labels |
| memory_reclaim_directstall |
Cumulative host-wide memcg limit reclaim events |
count |
Host |
eBPF |
host, region |
This Gauge counts host-wide memcg reclaim events, excluding kswapd; it is not a global reclaim count or duration. Host totals include container activity and must not be added to container counts. BPF reload resets the total.
Network
TCP Memory
Reports TCP memory usage and its proportion of the limit.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
tcp_memory_limit_pages |
Total allowed TCP memory |
Pages |
Host |
— |
tcp_memory_usage_bytes |
TCP memory in use |
Bytes |
Host |
— |
tcp_memory_usage_pages |
TCP memory in use |
Pages |
Host |
— |
tcp_memory_usage_percent |
TCP memory usage as a percentage of the total TCP memory limit |
% |
Host |
— |
Connection Tracking
Host nf_conntrack table usage and capacity come from /proc/sys/net/netfilter/nf_conntrack_count and /proc/sys/net/netfilter/nf_conntrack_max. The repository configuration disables net_conntrack through BlackList by default.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
net_conntrack_entry_count |
Current nf_conntrack table entries |
Entries |
Host |
— |
net_conntrack_entry_max |
Maximum nf_conntrack table entries |
Entries |
Host |
— |
ARP Neighbors
Counts ARP neighbor entries in host and container network namespaces.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
arp_entries |
ARP entries in the host network namespace |
Count |
Host namespace |
— |
arp_total |
Total ARP entries across all network namespaces on the host |
Count |
Host |
— |
arp_container_entries |
ARP entries in the container network namespace |
Count |
Container |
— |
Transmit Queues
Qdisc metrics describe backlog, transmitted traffic, drops, and requeues, not queueing latency directly. Only root Qdiscs of matching devices are collected; noqueue is skipped. The repository configuration disables netdev_qdisc through BlackList by default.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
netdev_qdisc_backlog |
Bytes queued for transmission |
Bytes |
Host |
device, kind |
netdev_qdisc_current_queue_length |
Current queued packets |
Count |
Host |
device, kind |
netdev_qdisc_overlimits_total |
Overlimit events |
Count |
Host |
device, kind |
netdev_qdisc_requeues_total |
Requeues because the NIC/driver temporarily cannot transmit |
Count |
Host |
device, kind |
netdev_qdisc_drops_total |
Packets dropped due to full queues, rate-limit policies, or similar causes |
Count |
Host |
device, kind |
netdev_qdisc_bytes_total |
Cumulative transmitted bytes |
Bytes |
Host |
device, kind |
netdev_qdisc_packets_total |
Transmitted packets |
Count |
Host |
device, kind |
Hardware Drops
Counts receive-side hardware drops for supported NIC drivers. It prefers rx_missed_errors; otherwise it attempts to subtract eBPF software-drop counts from rx_dropped. The repository configuration disables netdev_hw through BlackList by default.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
netdev_hw_rx_dropped_total |
Cumulative receive-side hardware drops |
Count |
Host |
sysfs, eBPF |
device, driver |
RDMA Port Statistics
netdev_rdma_link_<counter> exposes per-port kernel counters; available names depend on the driver. Additional labels are device, nodeguid, index, num_ports, and port.
The new port label creates new time series, including on single-port devices. Keep it for port-level queries. For a selected counter, use sum by (region, host, device) (<metric>) for device totals, or sum by (region, host, device) (rate(<metric>[5m])) for device rates; replace <metric> with the full metric name. Grouping only by device mixes identically named devices across hosts.
NIC Statistics
Collects NIC statistics through proc or netlink. Common metrics follow Linux /proc/net/dev semantics:
receive_dropped:rx_dropped + rx_missed_errors。
receive_frame_errors:rx_length_errors + rx_over_errors + rx_crc_errors + rx_frame_errors。
transmit_carrier_errors:tx_carrier_errors + tx_aborted_errors + tx_window_errors + tx_heartbeat_errors。
Netlink also provides detailed error metrics and receive_nohandler. Detailed errors may already be included in the aggregates above and must not be added again. Tables show host names; container names insert container_ after netdev_.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
netdev_receive_bytes_total |
Total bytes successfully received |
Bytes |
Host, container |
device |
netdev_receive_packets_total |
Total packets successfully received |
Count |
Host, container |
device |
netdev_receive_multicast_total |
Received multicast packets |
Count |
Host, container |
device |
netdev_receive_compressed_total |
Received compressed packets |
Count |
Host, container |
device |
netdev_receive_frame_errors_total |
Total receive length, overflow, CRC, and frame-alignment errors |
Count |
Host, container |
device |
netdev_receive_errors_total |
Total receive errors |
Count |
Host, container |
device |
netdev_receive_dropped_total |
Receive drops, including missed errors |
Count |
Host, container |
device |
netdev_receive_fifo_errors_total |
Receive FIFO/ring-buffer overflow errors |
Count |
Host, container |
device |
netdev_transmit_bytes_total |
Total bytes successfully transmitted |
Bytes |
Host, container |
device |
netdev_transmit_packets_total |
Total packets successfully transmitted |
Count |
Host, container |
device |
netdev_transmit_collisions_total |
Transmit collisions |
Count |
Host, container |
device |
netdev_transmit_errors_total |
Total transmit errors |
Count |
Host, container |
device |
netdev_transmit_dropped_total |
Packets dropped during transmission due to full queues, policies, or similar causes |
Count |
Host, container |
device |
netdev_transmit_fifo_errors_total |
Transmit FIFO/ring-buffer errors |
Count |
Host, container |
device |
netdev_transmit_carrier_errors_total |
Total transmit carrier, aborted, window, and heartbeat errors |
Count |
Host, container |
device |
netdev_transmit_compressed_total |
Transmitted compressed packets |
Count |
Host, container |
device |
TCP Statistics
Reads network-namespace /proc/<pid>/net/netstat and snmp, subject to MetricCollector.Netstat filters. Tables show host names; container names insert container_ after netstat_.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
netstat_TcpExt_ArpFilter |
Packets dropped by ARP filtering rules |
Count |
Host, container |
— |
netstat_TcpExt_BusyPollRxPackets |
Packets received through busy polling |
Count |
Host, container |
— |
netstat_TcpExt_DelayedACKLocked |
Delayed ACK timer expirations postponed because user space holds the socket lock |
Count |
Host, container |
— |
netstat_TcpExt_DelayedACKLost |
Already-acknowledged packets received, possibly due to ACK loss or duplicate network packets |
Count |
Host, container |
— |
netstat_TcpExt_DelayedACKs |
Delayed ACK timer expirations that sent an ACK |
Count |
Host, container |
— |
netstat_TcpExt_EmbryonicRsts |
Packets with RST/SYN flags received in SYN_RECV |
Count |
Host, container |
— |
netstat_TcpExt_ListenDrops |
Packets dropped by LISTEN sockets, including accept-queue overflow and memory allocation failures |
Count |
Host, container |
— |
netstat_TcpExt_ListenOverflows |
TCP accept-queue overflows |
Count |
Host, container |
— |
netstat_TcpExt_OfoPruned |
Out-of-order queue pruning due to memory shortage |
Count |
Host, container |
— |
netstat_TcpExt_OutOfWindowIcmps |
Received ICMP errors unrelated to the current TCP window |
Count |
Host, container |
— |
netstat_TcpExt_PruneCalled |
Buffer cleanup triggered by memory shortage |
Count |
Host, container |
— |
netstat_TcpExt_RcvPruned |
Receive queue pruning (packet drops) due to memory shortage |
Count |
Host, container |
— |
netstat_TcpExt_SyncookiesFailed |
SYN cookies that failed validation |
Count |
Host, container |
— |
netstat_TcpExt_SyncookiesRecv |
Received SYN cookies |
Count |
Host, container |
— |
netstat_TcpExt_SyncookiesSent |
Sent SYN cookies |
Count |
Host, container |
— |
netstat_TcpExt_TCPACKSkippedChallenge |
Other ACKs skipped while processing Challenge ACKs |
Count |
Host, container |
— |
netstat_TcpExt_TCPACKSkippedFinWait2 |
ACKs skipped in FIN-WAIT-2 |
Count |
Host, container |
— |
netstat_TcpExt_TCPACKSkippedPAWS |
ACKs skipped after PAWS check failures |
Count |
Host, container |
— |
netstat_TcpExt_TCPACKSkippedSeq |
ACKs skipped due to sequence checks |
Count |
Host, container |
— |
netstat_TcpExt_TCPACKSkippedTimeWait |
ACKs skipped in TIME-WAIT |
Count |
Host, container |
— |
netstat_TcpExt_TCPAbortOnClose |
Connections aborted when applications close with unread data |
Count |
Host, container |
— |
netstat_TcpExt_TCPAbortOnData |
Connections aborted with data in flight, sending RST |
Count |
Host, container |
— |
netstat_TcpExt_TCPAbortOnLinger |
Connections aborted after a LINGER timeout |
Count |
Host, container |
— |
netstat_TcpExt_TCPAbortOnMemory |
Connections closed due to memory problems |
Count |
Host, container |
— |
netstat_TcpExt_TCPAbortOnTimeout |
Connections closed after timer retransmission limits are exceeded |
Count |
Host, container |
— |
netstat_TcpExt_TCPLossFailures |
Failed recovery from packet loss |
Count |
Host, container |
— |
netstat_TcpExt_TCPLossProbeRecovery |
Packet losses detected and recovered through TLP |
Count |
Host, container |
— |
netstat_TcpExt_TCPLossProbes |
Tail Loss Probe (TLP) packets sent |
Count |
Host, container |
— |
netstat_TcpExt_TCPLossUndo |
Loss-state undo operations during recovery |
Count |
Host, container |
— |
netstat_TcpExt_TCPLostRetransmit |
Lost retransmissions |
Count |
Host, container |
— |
Only selected TcpExt fields are listed. See Linux kernel documentation for other fields and version differences.
References:
Socket Usage
Reads network-namespace /proc/<pid>/net/sockstat. Tables show host names; container names insert container_ after sockstat_. mem and mem_bytes are emitted only for the host.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
sockstat_sockets_used |
Sockets currently in use |
Count |
Host, container |
— |
sockstat_TCP_inuse |
TCP sockets in connection states such as ESTABLISHED and LISTEN, excluding TIME_WAIT |
Count |
Host, container |
— |
sockstat_TCP_orphan |
TCP sockets no longer associated with user-space file handles |
Count |
Host, container |
— |
sockstat_TCP_tw |
TCP sockets in TIME_WAIT |
Count |
Host, container |
— |
sockstat_TCP_alloc |
Total allocated TCP socket objects |
Count |
Host, container |
— |
sockstat_TCP_mem |
Kernel memory pages currently used by TCP sockets |
Pages |
Host |
— |
sockstat_UDP_inuse |
UDP sockets currently bound to local ports |
Count |
Host, container |
— |
I/O
Configuration
iotracing, iolatency, blk_throtl, iocost, and io_health are enabled
by default. Add a feature name to the global BlackList and restart Huatuo
to disable it. Disabling iotracing stops both its disk metrics and automatic
diagnosis. Disabling io_health stops health events, evidence collection,
and its metrics independently of iotracing.
The following metrics describe disk performance. They use the
huatuo_bamai_iotracing_ prefix and are interval Gauges with a disk label:
| Metric suffix |
Description |
read_bps, write_bps |
Read/write throughput in bytes per second |
read_iops, write_iops |
Read/write operations per second |
read_await_ms, write_await_ms |
Mean read/write completion time in milliseconds |
io_util_percent |
Percentage of time the disk is busy |
average_queue_size |
Average IO queue length |
Metrics cover whole disks and supported logical devices, excluding partitions
and pseudo devices such as loop, ram, zram, and fd.
Latency and IO size distributions
iolatency measures read/write IO latency and size distributions for SCSI/SAS,
NVMe, and virtio disks and containers. Only disks with iostats and
request-time accounting enabled at startup are included. Disabling these settings
during operation is unsupported.
If software blk-crypto fallback is initialized at startup, the entire
iolatency collector remains disabled.
SCSI issued sizes use the kernel’s 16-bit sector count and wrap at 32 MiB.
When requests merge different blkcgs, container issued-size attribution is
approximate; host accounting is unaffected.
Block device additions, removals, or recreation restart iolatency,
blk_throtl, and iocost collection. Data for all disks may be omitted during
the transition.
Bucket values count IOs in the collection interval at or below the le upper
bound; +Inf is the total. Latency bounds are in seconds and size bounds in
bytes. Metrics are interval Gauges.
# TYPE huatuo_bamai_iolatency_q2d_seconds_bucket gauge
huatuo_bamai_iolatency_q2d_seconds_bucket{disk="sda",operation="read",host="hostname",region="dev",le="0.001"} 3
huatuo_bamai_iolatency_q2d_seconds_bucket{disk="sda",operation="read",host="hostname",region="dev",le="+Inf"} 5
# TYPE huatuo_bamai_iolatency_d2c_seconds_bucket gauge
huatuo_bamai_iolatency_d2c_seconds_bucket{disk="sda",operation="read",host="hostname",region="dev",le="+Inf"} 5
# TYPE huatuo_bamai_iolatency_q2g_seconds_bucket gauge
huatuo_bamai_iolatency_q2g_seconds_bucket{disk="sda",operation="read",host="hostname",region="dev",le="+Inf"} 5
# TYPE huatuo_bamai_iolatency_container_q2g_seconds_bucket gauge
huatuo_bamai_iolatency_container_q2g_seconds_bucket{container_host="etcd-hostname",container_hostnamespace="kube-system",container_level="burstable",container_name="etcd",container_type="normal",disk="sda",operation="read",host="hostname",region="dev",le="+Inf"} 2
| Metric |
Description |
Unit |
Scope |
| iolatency_q2d_seconds_bucket |
Queue-to-last-issue latency distribution |
count |
Host |
| iolatency_d2c_seconds_bucket |
Last-issue-to-complete latency distribution |
count |
Host |
| iolatency_q2g_seconds_bucket |
Queue-to-request-start latency distribution |
count |
Host |
| iolatency_container_q2d_seconds_bucket |
Queue-to-last-issue latency distribution |
count |
Container |
| iolatency_container_d2c_seconds_bucket |
Last-issue-to-complete latency distribution |
count |
Container |
| iolatency_container_q2g_seconds_bucket |
Queue-to-request-start latency distribution |
count |
Container |
| iolatency_queued_io_size_bytes_bucket |
Queued bio size distribution |
count |
Host |
| iolatency_issued_io_size_bytes_bucket |
Request size; last dispatched size for SCSI, completion bytes for NVMe/virtio |
count |
Host |
| iolatency_container_queued_io_size_bytes_bucket |
Queued bio size distribution |
count |
Container |
| iolatency_container_issued_io_size_bytes_bucket |
Request size; last dispatched size for SCSI, completion bytes for NVMe/virtio |
count |
Container |
| iolatency_interval_start_timestamp_seconds |
Start of the interval |
Unix seconds |
Host |
| iolatency_interval_end_timestamp_seconds |
End of the interval |
Unix seconds |
Host |
The 17 latency bounds in seconds are 0.00005, 0.0001, 0.00025, 0.0005,
0.001, 0.002, 0.004, 0.008, 0.016, 0.032, 0.064, 0.128,
0.256, 0.512, 1, 2, and +Inf.
Grafana
The IO overview shows latency distributions and IO counts by collection
interval. Click a bar to view latency and size histograms for that window.
The panels use Business Charts (volkovlabs-echarts-panel).
Update custom dashboards and alerts after upgrading. The table omits the
huatuo_bamai_ prefix:
| Former metric |
Replacement |
iolatency_blkdisk_d2c |
iolatency_d2c_seconds_bucket |
iolatency_container_blkdisk_d2c |
iolatency_container_d2c_seconds_bucket |
iolatency_blkdisk_q2c, iolatency_container_blkdisk_q2c |
No direct equivalent; select Q2G, Q2D, or D2C for the required stage |
iolatency_blkdisk_freeze |
io_health_blkdisk_freeze, still a Counter |
disk now contains names such as sda instead of device numbers such as 8:0.
The new operation label distinguishes reads and writes. Former zone
numbers are replaced by cumulative le bounds in seconds, listed above;
they cannot be mapped by index. For a range (a, b], subtract the le=a
value from the le=b value.
Former latency metrics counted only IOs of at least 20 ms. New metrics cover
all read/write IO on supported disks, and D2C starts at the last dispatch.
Adjust alerts for the new stages and bounds rather than only renaming metrics.
Latency buckets change from cumulative Counters to interval Gauges. Do not
apply rate() or increase() to them. Query directly for one interval;
for example, sum read D2C samples for a disk over the last five minutes:
sum_over_time(huatuo_bamai_iolatency_d2c_seconds_bucket{disk="sda",operation="read",le="+Inf"}[5m])
Hardware
# HELP huatuo_bamai_io_health_blkdisk_freeze the disk freeze event count
# TYPE huatuo_bamai_io_health_blkdisk_freeze counter
huatuo_bamai_io_health_blkdisk_freeze{disk="sda",host="hostname",region="dev"} 0
| Metric |
Description |
Unit |
Scope |
Labels |
| io_health_blkdisk_freeze |
Host disk freeze count; resets on disk replacement |
count |
Host |
host, region, disk |
Select this metric under Overview → Selected Metric on the host dashboard.
blk-throttle waits
blk_throtl counts IOs delayed by blk-throttle and their mean queue wait.
Each IO is counted when it leaves the queue; its wait starts at its first
queue entry.
| Metric |
Description |
blk_throtl_delayed_io_count |
IOs that finished waiting in the collection interval |
blk_throtl_average_wait_ms |
Mean queue wait for those IOs, in milliseconds |
blk_throtl_container_delayed_io_count |
Container IOs that finished waiting in the collection interval |
blk_throtl_container_average_wait_ms |
Mean container queue wait, in milliseconds |
Metrics distinguish disk and operation (read or write). scope=host
is the host total; scope=other is its portion without container attribution.
Container series use container labels instead of scope. All four metrics
are interval Gauges.
Container discovery is optional; host collection does not require kubelet.
Failed lookups or invalid labels send the current data to other; recovered
associations do not replay past intervals. After temporary collection failure,
the first successful collection rebuilds the baseline and the next resumes
output, without filling the failed interval. Errors that stop collection
require troubleshooting and a Huatuo restart.
After cgroup release, uncollected tail wait deltas are included in Host and
Other without container attribution. Results can undercount if one series on
one CPU completes at least 67,108,864 waits, or accumulates about 2.749 million
seconds of waiting, between successful collections.
IOCOST waits
iocost measures waits caused by insufficient IOCOST budget. Waiting starts
when the IO enters the wait queue and ends at its final wakeup; the full wait
belongs to the collection interval in which it ends.
| Metric |
Description |
iocost_waitq_io_count |
Read/write IOs that finished waiting in the interval |
iocost_average_wait_ms |
Mean wait for those IOs, in milliseconds |
iocost_container_waitq_io_count |
Container read/write IOs that finished waiting in the interval |
iocost_container_average_wait_ms |
Mean container IO wait, in milliseconds |
These interval Gauges use disk (sda, nvme0n1, etc.) and operation (read or
write). scope=host includes all containers; scope=other is the portion
without container attribution.
Container discovery is optional; host collection does not require kubelet.
Failed lookups or invalid labels send the current data to other; recovered
associations do not replay past intervals. After temporary collection failure,
the first successful collection rebuilds the baseline and the next resumes
output, without filling the failed interval. Errors that stop collection
require troubleshooting and a Huatuo restart.
After cgroup release, uncollected tail wait deltas are included in Host and
Other without container attribution. Results can undercount if one series on
one CPU completes at least 67,108,864 waits, or accumulates about 2.749 million
seconds of waiting, between successful collections. For example, 10,240 waits
for one series, each lasting 270 seconds and settled on that CPU in the same
interval, exceed the wait-time capacity.
IOCOST requires a non-PREEMPT_RT Linux kernel with IOCOST functions,
BPF/BTF, and kprobes.
Device health
io_health records these events:
| Event type |
Trigger |
block_error |
A normal block request completes with an error |
nvme_timeout |
An NVMe request times out |
nvme_reset |
An NVMe reset request is accepted, not necessarily completed; event only, without evidence commands |
nvme_state_change |
An NVMe controller changes state |
scsi_timeout |
A SCSI command times out |
scsi_dispatch_error |
SCSI command dispatch fails |
md_sync_action |
An MD sync action changes |
md_degraded |
The number of unavailable MD members changes |
md_member_state |
An MD member changes state or disappears |
If an NVMe state name is unavailable, new_state is unknown and
new_state_raw retains the numeric state.
Block errors, NVMe timeouts, SCSI errors, and MD members entering faulty,
blocked, write_error, or removed trigger evidence collection. A uniquely
resolved NVMe target uses read-only nvme-cli commands; SCSI uses read-only
smartctl commands. Ambiguous targets retain the event without scanning other
devices. MD monitoring does not require mdadm.
Evidence commands use the resolved physical disk or NVMe controller; the
event’s device can retain an MD member’s partition name.
Evidence commands for the same device are suppressed while running and for
a 60-second cooldown; raw events remain independent.
The huatuo_bamai_io_health_ Counters track events since process startup:
| Metric suffix |
Labels |
Description |
block_errors_total |
disk, operation, status |
Block-layer errors |
nvme_timeouts_total |
disk |
NVMe timeouts |
nvme_resets_total |
disk |
Accepted NVMe reset requests |
scsi_timeouts_total |
disk |
SCSI timeouts |
scsi_dispatch_errors_total |
disk, status |
SCSI dispatch errors |
collection_errors_total |
disk, reason |
Evidence collection failures |
event_persistence_failures_total |
reason |
Event save errors |
MD and NVMe controller state changes are stored as events, without a current
state Gauge. Counters update before events are saved; save failures are
counted by event_persistence_failures_total{reason="save_error"}.
Accepted health events are stored as individual documents. Unavailable or
inapplicable optional fields are omitted:
| Field |
Description |
type |
Event type |
device |
Event device name; MD member events may retain a partition name |
array, member |
MD array and member names |
old_state, new_state |
MD state transition; NVMe provides only the new state |
new_state_raw |
Numeric NVMe controller state |
operation, io_error_status, sector |
Block operation, error, and starting sector |
collection_status |
ok, partial, unsupported, timeout, or error |
nvme, scsi |
Protocol health evidence collected after the event |
NVMe evidence includes critical_warning, media_errors_total, and up to
eight error-log entries with status code, NSID, and LBA. SCSI evidence includes
overall health, ASC/ASCQ, temperature, defect counts, read/write/verify error
counts, and pending-defect counts with up to eight sample LBAs.
Disk Statistics
diskio reads /proc/diskstats and /proc/stat for per-device request counts, throughput, cumulative durations, and host CPU iowait.
Its disk-name label changes from device to disk; update selectors and
legends in custom queries. Metric names and types are unchanged.
The repository configuration disables diskio through BlackList by default. Remove it and restart huatuo-bamai to enable it.
Request counts, bytes, and I/O durations are cumulative Counters. Use rate() to calculate IOPS, throughput, and duration growth rates. Mean request duration is the duration growth rate divided by request rate; exclude intervals with zero requests. io_in_progress and disk_iowait_percent are Gauges.
| Metric |
Description |
Unit |
Scope |
Additional Labels |
diskio_read_requests_total |
Cumulative completed read requests; use rate() for read IOPS |
Count |
Host |
disk |
diskio_write_requests_total |
Cumulative completed write requests; use rate() for write IOPS |
Count |
Host |
disk |
diskio_read_bytes_total |
Cumulative bytes read; use rate() for read throughput |
Bytes |
Host |
disk |
diskio_written_bytes_total |
Cumulative bytes written; use rate() for write throughput |
Bytes |
Host |
disk |
diskio_read_time_seconds_total |
Cumulative time spent on completed reads |
Seconds |
Host |
disk |
diskio_write_time_seconds_total |
Cumulative time spent on completed writes |
Seconds |
Host |
disk |
diskio_io_in_progress |
Current in-flight I/O requests (queue depth) |
Count |
Host |
disk |
diskio_disk_iowait_percent |
CPU time spent waiting for I/O as a share of the collection interval |
% |
Host |
— |
XFS
xfs collects per-device host statistics from sysfs with the additional label device. xfs_log_free_bytes is a Gauge; metrics ending in _total are cumulative Counters.
| Metric |
Description |
Unit |
xfs_log_free_bytes |
Free log space |
Bytes |
xfs_log_space_sleep_total |
Cumulative waits for log space |
Count |
xfs_alloc_blocks_total |
Cumulative allocated blocks |
Blocks |
xfs_alloc_extents_total |
Cumulative allocated extents |
Count |
xfs_inode_attempts_total |
Cumulative inode-cache requests |
Count |
xfs_inode_missed_total |
Cumulative inode-cache misses |
Count |
xfs_buf_busy_locked_total |
Cumulative busy-buffer lock events |
Count |
xfs_buf_locked_waited_total |
Cumulative buffer-lock waits |
Count |
xfs_log_free_bytes is omitted when free log space is unavailable. Restart huatuo-bamai after adding an XFS mount.
System Events
Soft Lockups
Records soft lockup events detected by the kernel.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
softlockup_total |
System soft lockup event count |
Count |
Host |
eBPF |
— |
Hung Tasks
Records hung-task events detected by the kernel.
| Metric |
Description |
Unit |
Scope |
Source |
Additional Labels |
hungtask_total |
System hung-task event count |
Count |
Host |
eBPF |
— |
attribute hungtask events and counts to containers
| Metric |
Description |
Unit |
Target |
Source |
Labels |
| hungtask_container_total |
Events attributed to blocked container tasks |
count |
Container |
BPF + CSS cache |
container_host, container_hostnamespace, container_level, container_name, container_type, host, region |
Container counts are included in the host Counter and are independent of trace backoff. Events with unresolved container attribution still contribute to the host count. Container exit removes its count; agent restart resets counts. Repeated reports of the same blocked task count as separate events.
GPU
The repository configuration disables metax_gpu through BlackList by default. Meet the device and SDK dependencies before enabling it.
| Metric |
Description |
Unit |
Additional Labels |
metax_gpu_sdk_info |
GPU SDK information |
— |
version |
metax_gpu_driver_info |
GPU driver information |
— |
version |
metax_gpu_info |
GPU identity and configuration |
— |
gpu, model, uuid, bios_version, bdf, mode, die_count |
metax_gpu_board_power_watts |
GPU board power |
W |
gpu |
metax_gpu_pcie_link_speed_gt_per_second |
Current GPU PCIe link speed |
GT/s |
gpu |
metax_gpu_pcie_link_width_lanes |
Current GPU PCIe link width |
Lanes |
gpu |
metax_gpu_pcie_receive_bytes_per_second |
GPU PCIe receive throughput |
B/s |
gpu |
metax_gpu_pcie_transmit_bytes_per_second |
GPU PCIe transmit throughput |
B/s |
gpu |
metax_gpu_metaxlink_link_speed_gt_per_second |
Current GPU MetaXLink speed |
GT/s |
gpu, metaxlink |
metax_gpu_metaxlink_link_width_lanes |
Current GPU MetaXLink width |
Lanes |
gpu, metaxlink |
metax_gpu_metaxlink_receive_bytes_per_second |
GPU MetaXLink receive throughput |
B/s |
gpu, metaxlink |
metax_gpu_metaxlink_transmit_bytes_per_second |
GPU MetaXLink transmit throughput |
B/s |
gpu, metaxlink |
metax_gpu_metaxlink_receive_bytes_total |
Total GPU MetaXLink bytes received |
Bytes |
gpu, metaxlink |
metax_gpu_metaxlink_transmit_bytes_total |
Total GPU MetaXLink bytes transmitted |
Bytes |
gpu, metaxlink |
metax_gpu_metaxlink_aer_errors_total |
GPU MetaXLink AER errors |
Count |
gpu, metaxlink, error_type |
metax_gpu_status |
GPU status |
— |
gpu, die |
metax_gpu_temperature_celsius |
GPU temperature |
°C |
gpu, die |
metax_gpu_utilization_percent |
GPU utilization (0–100) |
% |
gpu, die, ip |
metax_gpu_memory_total_bytes |
Total GPU memory |
Bytes |
gpu, die |
metax_gpu_memory_used_bytes |
Used GPU memory |
Bytes |
gpu, die |
metax_gpu_clock_mhz |
GPU clock frequency |
MHz |
gpu, die, ip |
metax_gpu_clocks_throttling |
GPU clock-throttling reasons |
— |
gpu, die, reason |
metax_gpu_dpm_performance_level |
GPU DPM performance level |
— |
gpu, die, ip |
metax_gpu_ecc_memory_errors_total |
GPU ECC memory errors |
Count |
gpu, die, memory_type, error_type |
metax_gpu_ecc_memory_retired_pages_total |
GPU ECC retired memory pages |
Count |
gpu, die |
MThreads
MThreads GPU collection requires the MTML management library. Startup searches for libmtml.so.2, then libmtml.so.
Remove mthreads_gpu from BlackList and restart huatuo-bamai to enable it. EnableHealth, EnablePCIe, and EnableMTLink in MetricCollector.Mthreads control the corresponding metric groups.
| Metric |
Description |
Unit |
Additional Labels |
mthreads_gpu_library_info |
MTML library information |
— |
version |
mthreads_gpu_device_info |
GPU information |
— |
gpu, name, brand, serial |
mthreads_gpu_device_pci_info |
GPU PCI information |
— |
gpu, sbdf |
mthreads_gpu_device_spec |
GPU specifications |
— |
gpu, cores |
mthreads_gpu_device_bios_version |
GPU BIOS version |
— |
gpu, bios |
mthreads_gpu_device_musa_capability |
GPU MUSA compute capability |
— |
gpu, musa_capability |
mthreads_gpu_memory_info |
GPU memory information |
— |
gpu, type, vendor, bus_width |
mthreads_gpu_pcie_link_max_speed_gt_per_sec |
Maximum GPU PCIe link speed (hardware capability) |
GT/s |
gpu |
mthreads_gpu_pcie_link_max_width_lanes |
Maximum GPU PCIe link width (hardware capability) |
Lanes |
gpu |
mthreads_gpu_device_power_watts |
GPU device power |
W |
gpu |
mthreads_gpu_gpu_temperature_celsius |
GPU temperature |
°C |
gpu |
mthreads_gpu_memory_temperature_celsius |
GPU memory temperature |
°C |
gpu |
mthreads_gpu_gpu_utilization_percent |
GPU utilization (0-100) |
% |
gpu |
mthreads_gpu_memory_utilization_percent |
GPU memory utilization (0-100) |
% |
gpu |
mthreads_gpu_memory_total_bytes |
Total GPU memory |
Bytes |
gpu |
mthreads_gpu_memory_used_bytes |
Used GPU memory |
Bytes |
gpu |
mthreads_gpu_gpu_clock_mhz |
GPU clock frequency |
MHz |
gpu |
mthreads_gpu_gpu_max_clock_mhz |
Maximum GPU clock frequency |
MHz |
gpu |
mthreads_gpu_memory_clock_mhz |
GPU memory clock frequency |
MHz |
gpu |
mthreads_gpu_memory_max_clock_mhz |
Maximum GPU memory clock frequency |
MHz |
gpu |
mthreads_gpu_gpu_voltage_volts |
GPU voltage |
V |
gpu |
mthreads_gpu_gpu_power_limit_watts |
Enforced GPU power limit |
W |
gpu |
mthreads_gpu_gpu_power_default_limit_watts |
Default GPU power-management limit |
W |
gpu |
mthreads_gpu_fan_rpm |
GPU fan speed |
RPM |
gpu, fan |
mthreads_gpu_fan_speed_percent |
GPU fan speed percentage |
% |
gpu, fan |
mthreads_gpu_gpu_pstate |
GPU performance state (0=P0) |
— |
gpu |
mthreads_gpu_vpu_utilization_percent |
GPU VPU utilization (0-100) |
% |
gpu |
mthreads_gpu_vpu_encoder_utilization_percent |
GPU VPU encoder utilization (0-100) |
% |
gpu |
mthreads_gpu_vpu_decoder_utilization_percent |
GPU VPU decoder utilization (0-100) |
% |
gpu |
mthreads_gpu_vpu_clock_mhz |
GPU VPU clock frequency |
MHz |
gpu |
mthreads_gpu_pcie_link_speed_gt_per_sec |
Current GPU PCIe link speed |
GT/s |
gpu |
mthreads_gpu_pcie_link_width_lanes |
Current GPU PCIe link width |
Lanes |
gpu |
mthreads_gpu_pcie_replay_total |
GPU PCIe replay counter |
Count |
gpu |
mthreads_gpu_mtlink_state |
GPU MtLink state (0=DOWN,1=UP,2=DOWNGRADE) |
— |
gpu, link |
mthreads_gpu_mtlink_link_bandwidth_gb_s |
Maximum GPU MtLink bandwidth per link (static specification, not live throughput) |
GB/s |
gpu |
mthreads_gpu_mtlink_link_count |
Maximum supported GPU MtLink links (static specification) |
Links |
gpu |
2 - AutoTracing Fields
This reference covers AutoTracing record fields, units, and examples. See AutoTracing for use cases and Node Configuration for settings. Thresholds below are built-in defaults that configuration files can override.
Results
Automatic tracing events are written to Elasticsearch or local files according to enabled storage settings. Filter by tracer_type=autotracing, tracer_name, host or container identifiers, and time range. The JSON examples illustrate field structure, not measured results.
CPU examples use perf. With profiler, events retain trigger metrics; profiles are stored separately in Elasticsearch with the same tracer_id. See Node Configuration for storage requirements and viewing instructions.
Common Fields
Records contain these common fields. Container fields are provided only when a container is associated.
| Field |
Description |
hostname |
Node hostname |
region |
Node region |
uploaded_timestamp |
Data upload time |
container_id |
Container ID |
container_hostname |
Container hostname |
container_host_namespace |
Container’s Kubernetes namespace |
container_type |
Container type |
container_qos |
Container QoS class |
tracer_name |
Event name, such as cpusys or memburst |
tracer_id |
ID of this trace |
started_timestamp |
Trace start time |
tracer_type |
Observation type; always autotracing for AutoTracing records |
tracer_data |
Event-specific data described below |
Host CPU
Tracer: cpusys. Select perf (default) or profiler with AutoTracing.CPUSys.Tool.
Periodically reads /proc/stat to detect host system, user (user + nice), and executing-total (user + nice + system + irq + softirq) CPU bursts, including container work. Any group triggers profiling when both utilization and its increase strictly exceed its thresholds. Default utilization/increase thresholds are system 45%/20 percentage points, user 75%/45 percentage points, and total 90%/55 percentage points.
All three groups share a capture and a default 30-minute cooldown. Thresholds are configured under CPUSys independently of CPUIdle; see the configuration reference. Records retain system fields and add matching user_percent* and total_percent* fields; zero-valued additional fields are omitted.
Example with some common fields omitted:
{
"tracer_name": "cpusys",
"tracer_data": {
"system_percent": 52,
"system_percent_threshold": 45,
"system_percent_delta": 25,
"system_percent_delta_threshold": 20,
"flamedata": [
{"level": 0, "value": 1000, "self": 0, "label": "all"},
{"level": 1, "value": 350, "self": 350, "label": "do_syscall_64"}
]
}
}
| Field |
Description |
system_percent |
Host system-mode CPU utilization at trigger time (%) |
system_percent_threshold |
System-mode utilization threshold (%) |
system_percent_delta |
Increase between consecutive samples (percentage points) |
system_percent_delta_threshold |
Increase threshold (percentage points) |
flamedata |
perf: flame graph frames, with fields listed below. profiler: null; query the separate profile using the event tracer_id |
flamedata.level |
Stack depth |
flamedata.value |
Sample count for the frame, including children |
flamedata.self |
Sample count for the frame alone, excluding children |
flamedata.label |
Function or process name |
Container CPU
Tracer: cpuidle. Select perf (default) or profiler with AutoTracing.CPUIdle.Tool.
Periodically reads container cgroup CPU statistics. Container-level CPU sampling starts when user, system, or total utilization exceeds both its utilization threshold and its increase threshold between consecutive samples.
The default cooldown is 30 minutes per container. AutoTracing.CPUIdle.Filter controls target scope. Built-in thresholds:
| Metric |
Utilization Threshold |
Increase Threshold |
| User |
75% |
45 percentage points |
| System |
45% |
20 percentage points |
| Total |
90% |
55 percentage points |
Example with some common fields omitted:
{
"tracer_name": "cpuidle",
"tracer_data": {
"user_percent": 80,
"user_percent_threshold": 75,
"user_percent_delta": 48,
"user_percent_delta_threshold": 45,
"system_percent": 12,
"system_percent_threshold": 45,
"system_percent_delta": 5,
"system_percent_delta_threshold": 20,
"total_percent": 92,
"total_percent_threshold": 90,
"total_percent_delta": 53,
"total_percent_delta_threshold": 55,
"flamedata": [
{"level": 0, "value": 1000, "self": 0, "label": "all"},
{"level": 1, "value": 800, "self": 800, "label": "java/com.example.App.main"}
]
}
}
| Field |
Description |
user_percent / user_percent_threshold |
Container user-mode CPU utilization at trigger time (%) and its threshold |
user_percent_delta / user_percent_delta_threshold |
User-mode utilization increase (percentage points) and its threshold |
system_percent / system_percent_threshold |
Container system-mode CPU utilization at trigger time (%) and its threshold |
system_percent_delta / system_percent_delta_threshold |
System-mode utilization increase (percentage points) and its threshold |
total_percent / total_percent_threshold |
Container total CPU utilization at trigger time (%) and its threshold |
total_percent_delta / total_percent_delta_threshold |
Total utilization increase (percentage points) and its threshold |
flamedata |
perf: container flame graph frames, with the same fields as cpusys. profiler: null; query the separate profile using the event tracer_id |
Container D-State Load
Tracer: dload.
Reads container process states through netlink and cgroups to calculate an exponential moving average (EMA) of uninterruptible (D-state) process load. It triggers when the EMA exceeds the threshold (default: 5), with a default 30-minute cooldown per container.
Results include kernel stacks of container and host D-state processes. AutoTracing.IssuesList labels known issues.
Example with some common fields omitted:
{
"tracer_name": "dload",
"tracer_data": {
"threshold": 5,
"nr_sleeping": 120,
"nr_running": 4,
"nr_stopped": 0,
"nr_uninterruptible": 8,
"nr_iowait": 3,
"load_avg": 7.23,
"dload_avg": 6.81,
"known_issue": "",
"stack": "task:java state:D stack: 0 pid: 12345 tgid: 12345 ...\n io_schedule+0x18/0x40\n ext4_file_write_iter+0x..."
}
}
| Field |
Description |
threshold |
D-state load EMA trigger threshold |
nr_sleeping |
Sleeping processes in the container |
nr_running |
Running processes in the container |
nr_stopped |
Stopped processes in the container |
nr_uninterruptible |
Uninterruptible (D-state) processes in the container |
nr_iowait |
Processes waiting for I/O in the container |
load_avg |
Container load average at trigger time |
dload_avg |
Container D-state load EMA at trigger time |
known_issue |
Matched known-issue description; empty if none matched |
stack |
Kernel stacks of D-state processes as multiline text |
Disk I/O
Tracer: iotracing.
Reads /proc/diskstats every 5 seconds. A trigger condition must hold for two consecutive intervals. Non-NVMe devices check utilization; NVMe devices require both utilization and either read or write throughput to exceed thresholds. Each device also checks mean read and write wait times independently. Results include process and file I/O rates and I/O scheduling wait stacks.
When running iotracing directly, --enable-pprof (disabled by default) serves profiles at http://127.0.0.1:6000/debug/pprof/; if the address is already in use, the command fails to start. These profiles describe only the iotracing process’s Go runtime, not huatuo-bamai or the application processes performing disk I/O. Automatic tracing does not enable this option.
Example with some common fields omitted:
{
"tracer_name": "iotracing",
"tracer_data": {
"reason_snapshot": {
"type": "ioutil",
"device": "sda",
"major_num": 8,
"minor_num": 0,
"iostatus": {
"read_bps": 125829120,
"read_iops": 450,
"read_await": 12,
"write_bps": 2202009600,
"write_iops": 890,
"write_await": 145,
"io_util": 95,
"queue_size": 32
}
},
"process_file_io_stats": [
{
"pid": 12345,
"comm": "java",
"container_hostname": "app-pod-xxx",
"total_fs_read_bps": 0,
"total_fs_write_bps": 52428800,
"total_disk_read_bps": 0,
"total_disk_write_bps": 49152000,
"total_files": [
{
"path": "/data/logs/app.log",
"dev_name": "sda",
"fs_write_bps": 52428800,
"disk_write_bps": 49152000
}
],
"total_file_count": 1
}
],
"io_schedule_timeout_stacks": [
{
"pid": 12345,
"tid": 12346,
"cpu": 2,
"comm": "java",
"container_hostname": "app-pod-xxx",
"schedule_latency_us": 250000,
"stack": [
"io_schedule+0x18/0x40",
"ext4_file_write_iter+0x2a0/0x4c0"
]
}
]
}
}
| Field |
Description |
reason_snapshot |
Trigger reason, device, and disk metrics at that time; type is ioutil, read_bps, write_bps, read_await, or write_await |
reason_snapshot.iostatus |
*_bps: bytes/s; *_iops: operations/s; *_await: milliseconds; io_util: percentage; queue_size: mean queue depth |
process_file_io_stats |
File I/O in the collection window grouped by process, including PID, process name, and container hostname |
total_fs_read_bps / total_fs_write_bps |
Filesystem read/write rates (bytes/s) |
total_disk_read_bps / total_disk_write_bps |
Disk read/write rates (bytes/s) |
total_files / total_file_count |
A subset of file details and the untruncated total file count for the window; *_bps in file details uses bytes/s, and *_us uses microseconds |
io_schedule_timeout_stacks |
I/O scheduling wait events with PID, TID, CPU, process name, and container hostname |
schedule_latency_us / stack |
I/O scheduling wait duration (microseconds) and kernel stack frames |
Host Anonymous Memory
Tracer: memburst.
By default, samples host anonymous memory every 10 seconds and evaluates after filling a 60-sample sliding window. It triggers when current anonymous memory reaches twice the oldest window value and at least 70% of total host memory. The default cooldown is 30 minutes.
Results list the top N processes by descending RSS (default: 10) and attempt runtime snapshots serially for the first min(N, 3) processes. Go, HotSpot, and CPython use their respective providers. Unsupported runtimes report unavailable and retain process memory counters when available. A failed capture does not mean zero memory usage.
Each process has a two-second capture budget. Each snapshot retains at most 10 memory object entries and 512 KiB of JSON. Timeouts are cooperative and cannot interrupt synchronous system calls, so capture may take longer than two seconds.
The complete tracer_data is limited to 2 MiB, with at most 1,000 persisted ranking entries. When limits are exceeded, the lowest-ranked snapshots are removed first, then ranking tails if needed, and snapshot_reason is set. Cancellation and fallback records follow the same limits.
Example (some common fields omitted):
{
"tracer_name": "memburst",
"tracer_data": {
"top_memory_usage": [
{
"PID": 3456,
"ProcessName": "go-service",
"MemSize": 268435456
}
],
"process_snapshots": [
{
"pid": 3456,
"process_name": "go-service",
"language": "go",
"snapshot": {
"runtime_version": "go1.24.0",
"status": "complete",
"duration_ms": 25,
"entries": [
{
"kind": "inuse_space_objects",
"name": "main.allocate",
"bytes": 1048576,
"objects": 16,
"stack": [
"main.allocate fixture.go:42"
]
}
]
},
"process_memory": {
"status": "complete",
"rss_bytes": 268435456,
"rss_anon_bytes": 260046848
}
}
]
}
}
| Field |
Description |
top_memory_usage |
Processes ranked by descending RSS |
top_memory_usage.PID |
Process PID |
top_memory_usage.ProcessName |
Process name |
top_memory_usage.MemSize |
Process RSS (bytes) |
process_snapshots |
Optional process snapshots in rank order; each contains pid, process_name, language, snapshot, and optional process_memory |
snapshot_reason |
Optional explanation of cancellation, a full queue, or whole-event truncation; per-process failures use snapshot.status_reason |
snapshot fields:
| Field |
Description |
runtime_version |
Optional target runtime version |
status / status_reason |
Status and optional explanation; status is complete, partial, unavailable, or failed |
duration_ms |
Capture duration (milliseconds) |
output_truncated |
Optional flag indicating truncated snapshot output |
entries |
Optional ranked memory object entries |
entries.kind / entries.name |
Entry type and name; their meaning depends on the runtime |
entries.bytes / entries.objects |
Entry memory size (bytes) and object count |
entries.average_bytes / entries.stack |
Optional average object size (bytes) and call stack |
process_memory contains language-independent process memory counters. Its status and optional status_reason describe availability. All counters below are optional; missing values mean unavailable, not zero:
| Field |
Meaning (bytes) |
virtual_bytes / rss_bytes |
Virtual memory / RSS |
rss_anon_bytes / rss_file_bytes / rss_shmem_bytes |
Anonymous / file-backed / shared memory in RSS |
swap_bytes / page_table_bytes |
Swap space / page table memory |
3 - Abnormal Event Fields
This reference covers abnormal event structures, fields, and limitations. See Abnormal Event Diagnosis for capabilities and Node Configuration for collection settings.
Event Records
Results are written to Elasticsearch or local files according to enabled storage settings. Filter by tracer_type=event, event name, host or container, and time range. The JSON examples illustrate structure and omit some common fields. Threshold descriptions use built-in defaults.
Container fields are provided only when a container is associated. Event-specific data is in tracer_data.
| Field |
Description |
hostname |
Node hostname |
region |
Node region |
uploaded_timestamp |
Data upload time |
container_id |
Container ID |
container_hostname |
Container hostname |
container_host_namespace |
Container’s Kubernetes namespace |
container_type |
Container type, such as normal or sidecar |
container_qos |
Container QoS class |
tracer_name |
Event name, such as sched_tick or memory_oom_kill |
tracer_id |
ID of this trace |
observed_timestamp |
User-space observation time |
tracer_type |
Observation type; always event for these records |
tracer_data |
Event-specific data described below |
CPU Scheduling
Scheduling Tick Intervals
Observer: sched_tick.
Measures the total interval between consecutive scheduling ticks. When the interval reaches the threshold, it records the current kernel stack and process information. This can reveal prolonged IRQ disabling, CPU stalls, or virtualization scheduling delays, but does not alone prove that softirqs were disabled. comm and pid identify the task interrupted by the reporting tick, not the task responsible for the delay.
Use cases
- Kernel or driver code disables local interrupts for a long time, or hardirq/NMI work occupies the CPU for too long.
- The host preempts a VM’s vCPU for an extended period, including high steal time and scheduling stalls.
- Low-level anomalies such as SMI, firmware stalls, or delayed or lost clockevent delivery.
Limitations
Normal tick suppression after successfully entering NO_HZ is filtered out. High CPU load or a softirq backlog alone does not imply tick delay.
Set the threshold above the machine’s normal tick interval. The event stack captures only the first tick after the delay ends; use IRQ, steal-time, and hardware metrics to investigate the cause.
Example with some common fields omitted:
{
"uploaded_timestamp": "2025-06-11T16:05:16.251152703+08:00",
"hostname": "***",
"tracer_data": {
"tick_interval_ns": 237328905,
"tick_interval_threshold_ns": 10000000,
"comm": "***-agent",
"pid": 688073,
"cpu": 1,
"stack": "scheduler_tick/..."
},
"observed_timestamp": "2025-06-11T16:05:16.251+08:00",
"tracer_type": "event",
"region": "***",
"tracer_name": "sched_tick"
}
| Field |
Description |
comm |
Process name of the task interrupted by the reporting tick |
stack |
Kernel stack captured at the first scheduling tick after the delay |
tick_interval_ns |
Total interval between consecutive scheduling ticks (nanoseconds) |
cpu |
CPU ID where the event occurred |
tick_interval_threshold_ns |
Tick interval threshold (nanoseconds); reaching it records an event |
pid |
Process ID of the task interrupted by the reporting tick |
Soft Lockups
Observer: softlockup.
Records the process, CPU, and NMI backtraces when the kernel reports a soft lockup. These details alone cannot identify the responsible process. Kernel watchdog settings determine trigger timing.
The reporting interval for repeated events increases from 10 minutes to at most 3 hours. Events are still counted during this interval.
Example with some common fields omitted:
{
"tracer_data": {
"cpu": 15,
"pid": 12345,
"comm": "kworker/15:0",
"cpus_stack": "2025-06-10 14:30:22 sysrq: Show backtrace of all active CPUs\nNMI backtrace for cpu 15\n..."
}
}
| Field |
Description |
cpu |
CPU ID where the soft lockup occurred |
pid |
Process PID when the soft lockup was reported |
comm |
Process name when the soft lockup was reported |
cpus_stack |
NMI backtraces from all CPUs as multiline text with timestamps and stacks |
Hung Tasks
Observer: hungtask.
Matched hungtask events carry a container ID; unresolved events retain host output. Stack snapshots remain system-wide. See container counts.
Detects system hung-task events and collects kernel stacks of D-state (uninterruptible sleep) processes and CPU backtraces. The repeat reporting interval increases from 10 minutes to at most 3 hours, while events continue to be counted. The observer is not registered if the kernel does not provide hung_task_timeout_secs. Setting that value to 0 disables kernel hung-task detection.
Example with some common fields omitted:
{
"tracer_data": {
"tid": 2567042,
"comm": "kworker/u48:2",
"cpus_stack": "2025-06-10 09:57:14 sysrq: Show backtrace of all active CPUs\nNMI backtrace for cpu 33\n...",
"blocked_processes_stack": "task:java state:D stack: 0 pid: 12345 ..."
}
}
| Field |
Description |
tid |
TID of the task that triggered hung-task detection |
comm |
Name of the task that triggered hung-task detection |
cpus_stack |
NMI backtraces from all CPUs as multiline text with timestamps and stacks |
blocked_processes_stack |
Kernel stacks of D-state processes |
hung_task_timeout_secs |
Kernel hung-task detection timeout in seconds |
Memory
OOM Kills
Observer: memory_oom_kill.
Records the process that triggered the OOM Killer (trigger), the killed process (victim), and available container, cgroup, and host memory information. The triggering process is not necessarily the main memory consumer; analyze usage and memory limits together.
Example with some fields omitted:
{
"tracer_name": "memory_oom_kill",
"tracer_data": {
"trigger": {
"memory_cgroup_css_addr": "0xff4b8d8be3818000",
"container_id": "example-container",
"container_hostname": "app-pod",
"pid": 3218804,
"comm": "java"
},
"victim": {
"memory_cgroup_css_addr": "0xff4b8d8be3818000",
"container_id": "example-container",
"container_hostname": "app-pod",
"pid": 3218745,
"comm": "java",
"cgroup": {
"path": "kubepods.slice/...",
"current": 2143289344,
"max": 2147483648,
"stat": {
"anon": 1509949440,
"file": 83886080
},
"events": {
"oom": 1,
"oom_kill": 1
}
}
},
"memory_snapshot": {
"host_meminfo": {
"MemAvailable": 3355443200,
"Cached": 1073741824,
"Slab": 268435456
}
}
}
}
| Field |
Description |
trigger / victim |
Triggering and killed processes, both using the process fields below |
pid / comm |
PID and process command name |
container_id / container_hostname |
Associated container ID and hostname; omitted without an association |
memory_cgroup_css_addr |
Hexadecimal memory cgroup pointer |
cgroup.path |
Container cgroup path |
cgroup.current / cgroup.max |
Memory usage and limit at snapshot time, in bytes |
cgroup.stat / cgroup.events |
Raw cgroup memory statistics and event counts; fields depend on the cgroup version |
memory_snapshot.host_meminfo |
Selected host /proc/meminfo fields, converted to bytes |
cgroup appears inside trigger or victim only when container attribution and snapshot reads succeed. The host snapshot may also be absent. These values are read in user space and are not strictly synchronized with the OOM event.
Direct Reclaim
Observer: memory_reclaim_events.
Records the duration of an individual direct memory reclaim by a thread. When try_to_free_pages returns after exceeding the threshold (default: 900 milliseconds), it reports process, thread, and container details. Events without a resolved container are retained in the host stream. Blacklists use the registration name memory_reclaim_events; stored records use tracer_name=memory_reclaim.
Example with some common fields omitted:
{
"tracer_name": "memory_reclaim",
"tracer_data": {
"pid": 1896137,
"tid": 1896138,
"comm": "java",
"reclaim_duration_ns": 1412702917
}
}
| Field |
Description |
comm |
Process name that triggered direct reclaim |
pid |
Triggering process PID |
tid |
Triggering thread TID |
reclaim_duration_ns |
Direct reclaim duration (nanoseconds) |
An empty container ID can mean a host task or unresolved container attribution. Resolved container events are unaffected and are not duplicated in the host stream.
Network
Protocol Stack Drops
Observer: dropwatch.
Detects packet drops in the kernel network stack and reports kernel stacks, network five-tuples, TCP state, and other details. An optional stack filter can suppress noise patterns verified on the local system. type is reserved for TCP drop-type compatibility and is currently unset.
Example with some common fields omitted:
{
"observed_timestamp": "2026-07-23T02:14:40.304775546Z",
"tracer_data": {
"drop_reason": "SKB_DROP_REASON_NOT_SPECIFIED",
"source": "events",
"comm": "kubelet",
"pid": 1687046,
"net_namespace_cookie": 123456789,
"net_namespace_inum": 402653184,
"netdev_queue_mapping": 3,
"netdev_linkstatus": ["linkStatusUp"],
"netdev_name": "eth0",
"netdev_ifindex": 2,
"packet_eth_proto": "0x0800",
"packet_len_bytes": 1460,
"layers": {
"label": "IPv4/TCP",
"ipv4": {
"saddr": "10.79.68.62",
"daddr": "10.134.72.4",
"protocol": "TCP"
},
"tcp": {
"sport": 8080,
"dport": 49000,
"seq": 1009085774,
"ack_seq": 689410995,
"sk_state": "ESTABLISHED"
}
},
"stack": "kfree_skb/..."
}
}
| Field |
Description |
type |
Reserved drop type, currently unset and absent from JSON. Reserved codes: 1 general drop, 2 SYN flood, 3 SYN backlog overflow, 4 accept queue overflow |
drop_reason |
Kernel packet-drop reason |
source |
tools for standalone dropwatch, events when started by huatuo-bamai |
comm |
Process name at the drop |
pid |
Process ID |
net_namespace_cookie / net_namespace_inum |
Network namespace values for container attribution |
netdev_queue_mapping |
NIC queue index |
netdev_linkstatus |
NIC link-state flags |
netdev_name |
NIC device name |
netdev_ifindex |
NIC interface index |
packet_len_bytes |
Packet length (bytes) |
packet_eth_proto |
Ethernet protocol type in hexadecimal |
layers.ipv4.saddr / layers.ipv4.daddr |
Source and destination IP addresses |
layers.tcp.sport / layers.tcp.dport |
Source and destination ports |
layers.tcp.seq / layers.tcp.ack_seq |
TCP sequence and acknowledgment numbers |
layers.tcp.sk_state |
TCP connection state at the drop |
stack |
Kernel stack at the drop |
Receive Latency
Observer: net_rx_latency.
Records TCP packet latency from the driver receive point to __netif_receive_skb, tcp_v4_rcv, and the user-copy point. All three durations start at the driver, not at the preceding observation point. Default thresholds are 5, 10, and 115 milliseconds, respectively. Reaching a threshold records endpoints, TCP state, sequence numbers, and latency.
The host network namespace is excluded by default; only container networking is observed.
Example with some common fields omitted:
{
"observed_timestamp": "2025-06-11T00:00:00Z",
"tracer_data": {
"comm": "nginx",
"pid": 2921092,
"latency_stage": "RX_STAGE_USERCOPY",
"latency_ms": 95973,
"latency_threshold_ms": 115,
"tcp_state": "ESTABLISHED",
"tcp_saddr": "10.156.248.76",
"tcp_daddr": "10.134.72.4",
"tcp_sport": 9213,
"tcp_dport": 49000,
"tcp_seq": 1009085774,
"tcp_ack_seq": 689410995,
"net_namespace_cookie": 123456789,
"net_namespace_inum": 402653184,
"packet_len_bytes": 26064
}
}
| Field |
Description |
comm |
Process name at the event |
pid |
Process ID at the event |
latency_stage |
Stage: RX_STAGE_NETIF (NIC to kernel), RX_STAGE_TCPV4 (driver to TCP), or RX_STAGE_USERCOPY (driver to user copy) |
latency_ms |
Measured latency (milliseconds) |
latency_threshold_ms |
Trigger threshold (milliseconds) |
tcp_state |
TCP connection state; all states are supported, including ESTABLISHED, SYN_SENT, FIN_WAIT, and TIME_WAIT |
tcp_saddr / tcp_daddr |
Source/destination IP addresses |
tcp_sport / tcp_dport |
Source/destination ports |
tcp_seq / tcp_ack_seq |
TCP sequence/acknowledgment numbers |
net_namespace_cookie |
Network namespace cookie, available on kernels >= 5.14 for efficient container association |
net_namespace_inum |
Network namespace inum |
packet_len_bytes |
Packet length (bytes) |
NIC State
Observer: netdev_events.
Subscribes to kernel netlink RTM_NEWLINK messages to detect NIC link-flag changes such as AdminDown or CarrierDown. It reports interface name, link state, MAC address, and driver details. At startup, it scans devices in EventTracing.Netdev.DeviceList to establish a baseline, then reports only state changes.
Example with some common fields omitted:
{
"tracer_data": {
"ifname": "eth1",
"index": 3,
"linkstatus": "linkStatusAdminDown, linkStatusCarrierDown",
"mac": "5c:6f:69:34:dc:72",
"start": false,
"driver": "ixgbe",
"driver_version": "5.1.0-k",
"firmware_version": "3.25 0x80000421 1.2163.0"
}
}
| Field |
Description |
ifname |
Network interface name, such as eth1 |
index |
Interface index |
linkstatus |
Link-state change description, possibly containing multiple states |
mac |
NIC MAC address |
start |
Startup-scan flag; currently false because only live changes are saved |
driver |
NIC driver name |
driver_version |
NIC driver version |
firmware_version |
NIC firmware version |
LACP State
Observer: netdev_bonding_lacp.
Enabled only when the system has an IEEE 802.3ad bonding interface. On LACP (Link Aggregation Control Protocol) state changes, it reads and records all bonding interfaces under /proc/net/bonding/, including mode, MII state, Actor/Partner negotiation parameters, and slave link states.
Stored records use tracer_name=lacp; configuration blacklists use the registration name netdev_bonding_lacp.
Example with some common fields omitted:
{
"tracer_name": "lacp",
"tracer_data": {
"content": "/proc/net/bonding/bond0\nEthernet Channel Bonding Driver: v4.18.0...\nBonding Mode: IEEE 802.3ad Dynamic link aggregation\nMII Status: down\n..."
}
}
| Field |
Description |
content |
Complete bonding interface status as multiline text, including all slaves’ LACP negotiation details; equivalent to /proc/net/bonding/bondX contents |
Transmit Queue Timeouts
Observer: netdev_txqueue_timeout.
Detects NIC TX queue timeouts and records the affected queue index, device name, and driver name to investigate transmit-side device, driver, or link anomalies.
Example with some common fields omitted:
{
"tracer_data": {
"queue_index": 3,
"device_name": "eth0",
"driver_name": "ixgbe"
}
}
| Field |
Description |
queue_index |
Transmit queue index that timed out |
device_name |
NIC device name |
driver_name |
NIC driver name |
Compatibility
OOM Name Migration
The OOM kill tracer is now memory_oom_kill, previously memory_oom and earlier oom. Update blacklists, event filters, and alert queries together.
The metric prefix is now huatuo_bamai_memory_oom_kill_, replacing huatuo_bamai_memory_oom_ and the earlier huatuo_bamai_oom_. Update metric dashboards and recording rules accordingly.
Historical events retain their original names. Cross-version queries must match all three; the built-in event dashboard already covers them.
5 - Profiling API
This reference covers profiling task requests, responses, and states. For a first collection, see the Profiling Guide.
huatuo-apiserver creates, supervises, and stops profiling tasks through /v1/profiling. Each HTTP creation request is an independent execution. Profiling tasks are persisted as Jobs in huatuo-apiserver; the node keeps only in-memory operations and profiler processes.
Task control does not depend on Elasticsearch. Raw-result queries and dashboard links require it. huatuo-bamai and huatuo-apiserver must use the same index.
Request Conventions
huatuo-apiserver listens on :12740 by default. These examples set the address and Bearer token through environment variables:
API_BASE="http://127.0.0.1:12740"
API_TOKEN="REPLACE_WITH_RANDOM_HEX"
Every request must supply the configured Bearer token in Authorization:
Authorization: Bearer REPLACE_WITH_RANDOM_HEX
Non-admin users need permissions for /v1/profiling and /v1/profiling/**. Permissions may include an HTTP method prefix, such as GET /v1/profiling/**. Successful responses contain only data:
Error responses contain a stable error code and a readable message:
{
"error": {
"code": "result_unavailable",
"message": "Job state does not provide a complete Profiling result"
}
}
Clients should branch on error.code, not parse error.message.
Query Capabilities
Before creating a task, query supported profiling types, languages, CPU and memory modes, and runtime parameters:
curl -sS \
-H "Authorization: Bearer ${API_TOKEN}" \
"${API_BASE}/v1/profiling/capabilities"
data.items is a static capability table shipped with each version. Entries contain:
| Field |
Description |
type |
Profiling type: cpu or memory |
language |
Target language |
modes |
Allowed mode values for this type/language combination |
supports_binary_match |
Whether binary_match_path is allowed |
supported_scopes |
Allowed scope values |
CPU profiling for c, c++, and go supports oncpu and offcpu; java and python support only oncpu. Memory profiling supports:
| Language |
mode |
Description |
c, c++, go |
virtual_alloc |
Virtual address space allocations |
c, c++, go |
physical_alloc |
Physical-page allocations |
c, c++, go |
physical_usage |
Live bytes of physical pages tracked in this collection |
java |
object_alloc |
JVM object allocations |
java |
object_usage |
JVM live objects |
Create a Task
JSON parameters for POST /v1/profiling:
| Parameter |
Required |
Description |
type |
Yes |
Profiling type: cpu or memory |
language |
Yes |
Target process language; must match the profiling type |
mode |
Yes |
Mode declared by the capability table for the type and language |
duration_seconds |
Yes |
Collection duration in seconds |
hostname |
Yes |
Hostname of the node running the target process, used for scheduling |
scope |
Yes |
host or container, as allowed by the capability table |
container_id |
For container scope |
Target container ID |
binary_match_path |
No |
Executable-path match, when allowed by the capability table |
Every request creates a new task, even with identical content. Exceeding per-node or process-wide active task quotas returns HTTP 429.
Create a host Go CPU profiling task:
curl -sS -i \
-X POST \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"type": "cpu",
"language": "go",
"mode": "oncpu",
"scope": "host",
"duration_seconds": 60,
"hostname": "node-01"
}' \
"${API_BASE}/v1/profiling"
Create a Java live-object profiling task in a container:
curl -sS -i \
-X POST \
-H "Authorization: Bearer ${API_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"type": "memory",
"language": "java",
"mode": "object_usage",
"scope": "container",
"duration_seconds": 60,
"container_id": "9f4c2f1a8b7d",
"hostname": "node-01"
}' \
"${API_BASE}/v1/profiling"
Success returns 201 Created, a Location header pointing to the new task, and the task ID needed for later queries:
{
"data": {
"request_id": "<profile-job-id>",
"hostname": "node-01",
"duration_seconds": 60,
"scope": "host",
"type": "cpu",
"language": "go",
"mode": "oncpu",
"status": "pending",
"created_at": "2026-08-24T10:00:00Z",
"updated_at": "2026-08-24T10:00:00Z"
}
}
JOB_ID="<profile-job-id>"
Query Tasks
Task list
GET /v1/profiling supports these query parameters:
| Parameter |
Default |
Description |
limit |
100 |
Page size from 1 to 1000 |
offset |
0 |
Starting offset, at least 0 |
Query the 20 most recent profiling tasks:
curl -sS -G \
-H "Authorization: Bearer ${API_TOKEN}" \
--data-urlencode "limit=20" \
--data-urlencode "offset=0" \
"${API_BASE}/v1/profiling"
The server returns only profiling tasks, ordered by created_at descending. data.items is the task array; data.limit and data.offset are the effective pagination parameters; data.has_more indicates another page. Non-admin users see only their own tasks.
Task details
GET /v1/profiling/:request_id returns one task:
curl -sS \
-H "Authorization: Bearer ${API_TOKEN}" \
"${API_BASE}/v1/profiling/${JOB_ID}"
Task information is in data:
| Field |
Description |
request_id |
Profiling task ID used in all subsequent requests |
container_id |
Target container ID; omitted for host tasks |
hostname |
Target node hostname |
duration_seconds |
Requested profiling duration in seconds |
scope |
host or container |
type |
cpu or memory |
language |
Target process language |
mode |
Profiling mode selected from the capability table |
binary_match_path |
Executable match path; omitted when unused |
status |
Current task status |
terminal |
Terminal details {outcome, reason, message}; omitted before termination |
created_at |
Task creation time |
updated_at |
Last task status update time |
started_at |
Actual start time; omitted until execution is observed |
ended_at |
Time of entering a terminal state; omitted while running |
result_url |
Dashboard link returned by the single-task detail endpoint when complete results are available |
Task states:
| State |
Description |
pending |
Created and waiting for agent execution |
running |
Agent is collecting profile data |
stopping |
Stop intent is persisted and being processed asynchronously |
terminal |
Task ended; see terminal.outcome |
terminal.outcome is completed, failed, stopped, or unknown. For failed, inspect terminal.reason and terminal.message. stopped means an explicit stop and possibly incomplete results. unknown means huatuo-apiserver cannot confirm the final operation state, although durably published results may still be available.
operation_lost and execution_timed_out are terminal.reason codes, not task states. Other reasons include startup or stop timeouts, unavailable nodes, execution-capacity limits, startup or runtime failure, invalid_node_request for an invalid node request constructed by huatuo-apiserver, and protocol errors.
Get Results
GET /v1/profiling/:request_id/raw returns raw windows for tasks with terminal.outcome of completed or unknown only while the durable publication marker exists. A missing or expired marker returns result_not_found. Active states return result_not_ready; failed and stopped return result_unavailable.
Responses may be large; save them directly to a file:
curl -sS \
-H "Authorization: Bearer ${API_TOKEN}" \
-o profile-raw.json \
"${API_BASE}/v1/profiling/${JOB_ID}/raw?limit=100&offset=0"
Windows are in data.items; data.limit, data.offset, and data.has_more describe pagination. Each record includes uploaded_timestamp, started_timestamp, profile_type, and pprof-compatible profile data. A durably published empty result succeeds with an empty items array. Explicit limit=0 is invalid; only omission uses the default. limit defaults to 20 and is capped at 100. Encoded Profile data above 64 MiB returns 413 result_too_large; reduce limit and retry.
Flame graphs read and merge batches of 100 windows, with a total limit of 100000 per request. At one window per second for an hour, all 3600 windows participate. Exceeding 100000 returns an error asking for a narrower time range or filters. Query or merge failures never return partial flame graphs. Raw Profile lists remain scoped to a task; their page limit does not cap aggregation for a complete flame graph.
Stop a Task
Stopping is an asynchronous intent accepted for tasks in pending, running, or stopping:
curl -sS \
-X POST \
-H "Authorization: Bearer ${API_TOKEN}" \
"${API_BASE}/v1/profiling/${JOB_ID}/stop"
Success returns 200 OK with the current task snapshot. Terminal tasks return 409 Conflict. Because results may be incomplete, stopped tasks do not support result queries.
Unified flame graph queries
Grafana uses the Pyroscope-compatible Protobuf endpoints under /v1/profiling/flamegraph/.
SelectMergeStacktraces selectors require scope="host" or scope="container".
region is the Agent’s configured region; hostname is only the collection node.
Container queries require container_id or one task id. Host queries cannot include container filters.
For example: {region="example",hostname="node-01",scope="container",container_id="…",id="…"}.
Each label accepts one equality condition. On this endpoint the wildcard values *, all,
and the empty string only drop the restriction for that label, so
{scope="host",hostname="*",id="job-1"} still selects one task; scope is still required.
Repeating a label with the same value is accepted, while contradictory duplicates such as
{hostname="host-a",hostname="host-b"} are rejected with 400 and the error reports both
values, because one query cannot select two hosts. A matcher that uses any operator other
than = is rejected as well, including hostname!="*".
The shared dashboard UID is continuous-profiling; variables are ordered as Region, node,
scope, container, profile type, and task. The timeline and flame graph use the same task filter.
With All containers selected, the task still identifies one target. Physical usage always
requires one task and selects only the latest snapshot.
The task summary uses the Infinity data source in pyroscope.yaml, with the same API token
as the Pyroscope data source. result_url includes the stored windows’ Region and actual
profile type. Results without windows do not provide a dashboard link.