diff --git a/METRICS.md b/METRICS.md index c488ef8..b69aa06 100644 --- a/METRICS.md +++ b/METRICS.md @@ -138,3 +138,11 @@ Both memeory statistics from TrueNAS are exported on the onside the physical mem |`k3s_pod_mem`|`pod` the pod name|`bytes`|The number of bytes of memory this pod is using.| |`k3s_pod_net`||`bytes`|The number of bytes in/out of the pod over the network interface.| +## systemd services + +|Metric name|Labels|Unit|Description| +|-----------|------|----|-----------| +|`services_cpu`|`service` name of systemd service|`percent`|Percent of cpu usage per service. 100% = 1 core| +|`services_iops`||`ops/s`|Number of operations on I/O.| +|`services_io`||`kilobits/s`|I/O amount per service.| +|`services_mem`|`service` name of systemd service|`MiB`|Memory usage per service.| \ No newline at end of file diff --git a/graphite_mapping.conf b/graphite_mapping.conf index 34f0cae..1e3539f 100644 --- a/graphite_mapping.conf +++ b/graphite_mapping.conf @@ -28,6 +28,62 @@ mappings: instance: "${1}" kind: "${2}" +################################################ +# service mapping +################################################ + +- match: 'truenas\.(.*)\.services\.cpu\.(.*)' + match_type: "regex" + name: "services_cpu" + labels: + job: "truenas" + instance: "${1}" + service: "${2}" + +- match: 'truenas\.(.*)\.services\.io_ops_read\.(.*)' + match_type: "regex" + name: "services_iops" + labels: + job: "truenas" + instance: "${1}" + op: "read" + service: "${2}" + +- match: 'truenas\.(.*)\.services\.io_ops_write\.(.*)' + match_type: "regex" + name: "services_iops" + labels: + job: "truenas" + instance: "${1}" + op: "write" + service: "${2}" + +- match: 'truenas\.(.*)\.services\.io_read\.(.*)' + match_type: "regex" + name: "services_io" + labels: + job: "truenas" + instance: "${1}" + op: "read" + service: "${2}" + +- match: 'truenas\.(.*)\.services\.io_write\.(.*)' + match_type: "regex" + name: "services_io" + labels: + job: "truenas" + instance: "${1}" + op: "write" + service: "${2}" + +- match: 'truenas\.(.*)\.services\.mem_usage\.(.*)' + match_type: "regex" + name: "services_mem" + labels: + job: "truenas" + instance: "${1}" + service: "${2}" + ################################################ # disk smart metrics ################################################