Skip to main content

Monitor

VEF includes a monitor service and a built-in resource for runtime inspection.

Module Outputs

The monitor module provides:

OutputMeaning
monitor.Serviceruntime monitoring service
sys/monitorbuilt-in RPC resource

The service is initialized and closed through lifecycle hooks when needed.

monitor.Service Interface

The public monitoring service exposes:

MethodReturn typePurpose
Overview(ctx)*monitor.SystemOverviewcombined overview snapshot
CPU(ctx)*monitor.CPUInfoCPU detail and usage
Memory(ctx)*monitor.MemoryInfovirtual and swap memory detail
Disk(ctx)*monitor.DiskInfopartitions and disk I/O detail
Network(ctx)*monitor.NetworkInfointerfaces and network I/O detail
Host(ctx)*monitor.HostInfostatic host metadata
Process(ctx)*monitor.ProcessInfocurrent process detail
Load(ctx)*monitor.LoadInfoload averages
BuildInfo()*monitor.BuildInfobuild metadata

Built-In Resource

The monitor module registers:

Resource
sys/monitor

Current actions:

ActionInput paramsOutput typeNotes
get_overviewnonemonitor.SystemOverviewoverview can contain partial data when some probes are unavailable
get_cpunonemonitor.CPUInforeturns monitor not ready when CPU sample cache is not ready
get_memorynonemonitor.MemoryInfoincludes virtual memory and swap
get_disknonemonitor.DiskInfoincludes partitions and I/O counters
get_networknonemonitor.NetworkInfoincludes interfaces and I/O counters
get_hostnonemonitor.HostInfostatic host metadata
get_processnonemonitor.ProcessInforeturns monitor not ready when process sample cache is not ready
get_loadnonemonitor.LoadInfoload averages
get_build_infononemonitor.BuildInfobuild metadata only

Implementation details visible in source:

  • each action currently sets a per-operation rate-limit max of 60
  • get_cpu and get_process use a specific monitor-not-ready business error when samples are not ready

Default Sampling Configuration

When no explicit monitor config is supplied, the module uses:

SettingDefault
sample interval10s
sample duration2s

These defaults primarily affect CPU and process sampling behavior.

Build Info Behavior

The monitor module decorates build info so that vefVersion is always present, even when the application does not provide a complete build metadata object.

Fallback behavior:

FieldFallback value when app does not supply build info
appVersionv0.0.0
buildTime2022-08-08 01:00:00
gitCommit-
vefVersioncurrent framework version

Data Shapes

monitor.SystemOverview

FieldTypeMeaning
host*monitor.HostSummarycondensed host information
cpu*monitor.CPUSummarycondensed CPU information
memory*monitor.MemorySummarycondensed memory usage
disk*monitor.DiskSummarycondensed disk usage
network*monitor.NetworkSummarycondensed network activity
process*monitor.ProcessSummarycondensed current process metrics
load*monitor.LoadInfoload averages
build*monitor.BuildInfobuild metadata

monitor.HostSummary

FieldTypeMeaning
hostnamestringhost name
osstringoperating system
platformstringplatform name
platformVersionstringplatform version
kernelVersionstringkernel version
kernelArchstringkernel architecture
uptimeuint64uptime in seconds

monitor.HostInfo

FieldTypeMeaning
hostnamestringhost name
uptimeuint64uptime in seconds
bootTimeuint64boot timestamp
processesuint64number of processes
osstringoperating system
platformstringplatform name
platformFamilystringplatform family
platformVersionstringplatform version
kernelVersionstringkernel version
kernelArchstringkernel architecture
virtualizationSystemstringvirtualization system
virtualizationRolestringvirtualization role
hostIdstringhost identifier

monitor.CPUSummary

FieldTypeMeaning
physicalCoresintnumber of physical cores
logicalCoresintnumber of logical cores
usagePercentfloat64aggregated CPU usage percent

monitor.CPUInfo

FieldTypeMeaning
physicalCoresintnumber of physical cores
logicalCoresintnumber of logical cores
modelNamestringCPU model name
mhzfloat64clock frequency
cacheSizeint32cache size
usagePercent[]float64per-core usage percentages
totalPercentfloat64total usage percent
vendorIdstringvendor identifier
familystringCPU family
modelstringCPU model
steppingint32CPU stepping
microcodestringmicrocode version

monitor.MemorySummary

FieldTypeMeaning
totaluint64total memory
useduint64used memory
usedPercentfloat64memory usage percentage

monitor.MemoryInfo

FieldTypeMeaning
virtual*monitor.VirtualMemoryphysical or virtual memory detail
swap*monitor.SwapMemoryswap detail

monitor.VirtualMemory

FieldTypeMeaning
totaluint64total virtual memory
availableuint64available memory
useduint64used memory
usedPercentfloat64used percentage
freeuint64free memory
activeuint64active memory
inactiveuint64inactive memory
wireduint64wired memory
laundryuint64laundry pages
buffersuint64buffer memory
cacheduint64cached memory
writeBackuint64write-back pages
dirtyuint64dirty pages
writeBackTmpuint64temporary write-back pages
shareduint64shared memory
slabuint64slab memory
slabReclaimableuint64reclaimable slab
slabUnreclaimableuint64unreclaimable slab
pageTablesuint64page table usage
swapCacheduint64cached swap
commitLimituint64commit limit
committedAsuint64committed memory
highTotaluint64high memory total
highFreeuint64high memory free
lowTotaluint64low memory total
lowFreeuint64low memory free
swapTotaluint64swap total
swapFreeuint64swap free
mappeduint64mapped memory
vmAllocTotaluint64VM allocated total
vmAllocUseduint64VM allocated used
vmAllocChunkuint64VM allocation chunk
hugePagesTotaluint64huge pages total
hugePagesFreeuint64huge pages free
hugePagesReserveduint64huge pages reserved
hugePagesSurplusuint64huge pages surplus
hugePageSizeuint64huge page size
anonHugePagesuint64anonymous huge pages

monitor.SwapMemory

FieldTypeMeaning
totaluint64total swap
useduint64used swap
freeuint64free swap
usedPercentfloat64swap usage percentage
swapInuint64swap-in count
swapOutuint64swap-out count
pageInuint64page-in count
pageOutuint64page-out count
pageFaultuint64page faults
pageMajorFaultuint64major page faults

monitor.DiskSummary

FieldTypeMeaning
totaluint64total disk size across counted partitions
useduint64used disk size
usedPercentfloat64disk usage percentage
partitionsintpartition count

monitor.DiskInfo

FieldTypeMeaning
partitions[]*monitor.PartitionInfopartition details
ioCountersmap[string]*monitor.IOCounterper-device I/O counters

monitor.PartitionInfo

FieldTypeMeaning
devicestringdevice name
mountPointstringmount path
fsTypestringfilesystem type
options[]stringmount options
totaluint64total size
freeuint64free size
useduint64used size
usedPercentfloat64usage percentage
iNodesTotaluint64total inodes
iNodesUseduint64used inodes
iNodesFreeuint64free inodes
iNodesUsedPercentfloat64inode usage percentage

monitor.IOCounter

FieldTypeMeaning
readCountuint64read operation count
mergedReadCountuint64merged read operation count
writeCountuint64write operation count
mergedWriteCountuint64merged write operation count
readBytesuint64bytes read
writeBytesuint64bytes written
readTimeuint64read time
writeTimeuint64write time
iopsInProgressuint64I/O operations in progress
ioTimeuint64total I/O time
weightedIouint64weighted I/O time
namestringdevice name
serialNumberstringdevice serial number
labelstringdevice label

monitor.NetworkSummary

FieldTypeMeaning
interfacesintinterface count
bytesSentuint64total bytes sent
bytesRecvuint64total bytes received
packetsSentuint64total packets sent
packetsRecvuint64total packets received

monitor.NetworkInfo

FieldTypeMeaning
interfaces[]*monitor.InterfaceInfointerface metadata
ioCountersmap[string]*monitor.NetIOCounterper-interface counters

monitor.InterfaceInfo

FieldTypeMeaning
indexintinterface index
mtuintMTU
namestringinterface name
hardwareAddrstringMAC address
flags[]stringinterface flags
addrs[]stringbound addresses

monitor.NetIOCounter

FieldTypeMeaning
namestringinterface name
bytesSentuint64bytes sent
bytesRecvuint64bytes received
packetsSentuint64packets sent
packetsRecvuint64packets received
errorsInuint64inbound errors
errorsOutuint64outbound errors
droppedInuint64inbound drops
droppedOutuint64outbound drops
fifoInuint64inbound FIFO count
fifoOutuint64outbound FIFO count

monitor.ProcessSummary

FieldTypeMeaning
pidint32process ID
namestringprocess name
cpuPercentfloat64CPU usage percent
memoryPercentfloat32memory usage percent

monitor.ProcessInfo

FieldTypeMeaning
pidint32process ID
parentPidint32parent process ID
namestringprocess name
exestringexecutable path
commandLinestringfull command line
cwdstringworking directory
statusstringprocess status
usernamestringowner username
createTimeint64creation timestamp
numThreadsint32thread count
numFdsint32open file-descriptor count
cpuPercentfloat64CPU usage percent
memoryPercentfloat32memory usage percent
memoryRssuint64RSS memory
memoryVmsuint64virtual memory size
memorySwapuint64swap usage

monitor.LoadInfo

FieldTypeMeaning
load1float641-minute load average
load5float645-minute load average
load15float6415-minute load average

monitor.BuildInfo

FieldTypeMeaning
vefVersionstringframework version
appVersionstringapplication version
buildTimestringbuild time
gitCommitstringgit commit

Minimal Request Example

{
"resource": "sys/monitor",
"action": "get_overview",
"version": "v1"
}

Practical Use

  • admin or ops dashboards
  • health and diagnostics surfaces
  • internal tooling
  • build metadata exposure

Next Step

Read CLI Tools if you want generate-build-info to populate richer build metadata.