This section describes the types of metrics displayed on the Host Details and Service Details screens.
System metrics
System metrics are a set of metrics that are automatically posted to the host when mackerel-agent is installed.
Linux
There are six types of graphs which will be displayed: loadavg, cpu, memory, disk, interface, and filesystem. The following are the metric values which will be graphed by each.
- loadavg (line graph)
loadavg1loadavg5loadavg15
- cpu (stacked graph)
cpu.user.percentagecpu.iowait.percentagecpu.system.percentagecpu.idle.percentagecpu.nice.percentagecpu.irq.percentagecpu.softirq.percentagecpu.steal.percentagecpu.guest.percentage
- memory (stacked graph. However,
total,swap_total,swap_used, andswap_cachedare line graphs)- Kernel 3.14 or later for Linux
memory.used(Value calculated by total - available)memory.availablememory.totalmemory.swap_usedmemory.swap_cachedmemory.swap_total
- Other Linux
memory.freememory.buffersmemory.cachedmemory.used(Value calculated by total - free - buffers - cached)memory.totalmemory.swap_usedmemory.swap_cachedmemory.swap_total
- Kernel 3.14 or later for Linux
- disk (line graph)
disk.*.reads.deltadisk.*.writes.delta
- interface (line graph)
interface.*.rxBytes.delta(Number of bytes received)interface.*.txBytes.delta(Number of bytes sent)
- filesystem (line graph)
filesystem.*.sizefilesystem.*.used
The sources for each of the above metrics when using mackerel-agent are as follows. The source code of mackerel-agent is available here.
- loadavg
- Obtained by parsing the contents of
/proc/loadavg
- Obtained by parsing the contents of
- cpu
- Obtained by parsing the contents of
/proc/stat
- Obtained by parsing the contents of
- memory
- Obtained by parsing the contents of
/proc/meminfo
- Obtained by parsing the contents of
- disk
- Obtained by parsing the contents of
/proc/diskstats
- Obtained by parsing the contents of
- interface
- Obtained by parsing the contents of
/proc/net/dev
- Obtained by parsing the contents of
- filesystem
- Obtained by parsing the execution results of the
dfcommand
- Obtained by parsing the execution results of the
Windows
There are six types of graphs which will be displayed: processor queue length, cpu, memory, disk, interface, and filesystem. The following are the metric values which will be graphed by each.
- processor queue length (line graph)
processor_queue_length
- cpu (stacked graph)
cpu.user.percentagecpu.system.percentagecpu.idle.percentage
- memory (stacked graph. However,
total,pagefile_free, andpagefile_totalare line graphs)memory.freememory.usedmemory.totalmemory.pagefile_freememory.pagefile_total
- disk(line graph)
disk.*.reads.deltadisk.*.writes.delta
- interface(line graph)
interface.*.rxBytes.delta(Number of bytes received)interface.*.txBytes.delta(Number of bytes sent)
- filesystem(line graph)
filesystem.*.sizefilesystem.*.used
The sources for each of the above metrics when using mackerel-agent are as follows. The source code of mackerel-agent is available here.
- processor queue length
- Information is obtained with the Windows Performance Data Helper API
- cpu
- Information is obtained with the Windows Performance Data Helper API
- memory
- Obtained from the results of the Win32 API
GlobalMemoryStatusEx
- Obtained from the results of the Win32 API
- disk
- Information is obtained from the
Win32_PerfFormattedData_PerfDisk_LogicalDiskclass using WMI
- Information is obtained from the
- interface
- Information is obtained with the Windows Performance Data Helper API
- filesystem
- Obtained and calculated from the results of the following Win32 API functions
GetLogicalDriveStringsWQueryDosDeviceWGetVolumeInformationWGetDiskFreeSpaceExW
- Obtained and calculated from the results of the following Win32 API functions
Custom metrics
Custom metrics are non-system metrics that users can arbitrarily submit to the host via plugins or the Mackerel API.
- For example,
custom.foo,custom.foo.bar- Metrics that have up to the last dot in the metric name in common are posted to a single graph.
- Metric names must be prefixed; custom metrics submitted by mackerel-agent will automatically be prefixed with
custom.. (mackerel-agent version 0.6.1 or later) - For detailed specifications of custom metric names, see here.
See below for instructions on how to submit custom metrics.
- Using the official plugin pack to visualize middleware metrics
- Posting user-defined custom metrics
- Post user-defined custom metrics using the Mackerel API
Service metrics
A service metric is a metric that is tied to a service rather than a specific host. Response time, which is visualized when External URL Monitoring is tied to a service, is also posted as a service metric. Graphs of service metrics can be viewed on the detail screen for each service.
See Posting Service Metrics in the Mackerel API Documents for information on how to Post Service Metrics.