diff --git a/METRICS.md b/METRICS.md index 1d0d56c..44fcdd3 100644 --- a/METRICS.md +++ b/METRICS.md @@ -128,4 +128,13 @@ Both memeory statistics from TrueNAS are exported on the onside the physical mem |`zfs_prefetch_data_hits_rate`|`op` hit or miss type|`events/s`|Number of hits for the type of cache hit.| |`zfs_hash_elements`|`op` current, max|`elements`|Number of hash elements present and maximum.| |`zfs_hash_chains`|`op` current, max|`chains`|Number of hash chains present and maximum.| -|`zfs_pool`||`boolean`|Shows the states of the pool with boolean indicating if they are active.| \ No newline at end of file +|`zfs_pool`||`boolean`|Shows the states of the pool with boolean indicating if they are active.| + +## k3s + +|Metric name|Labels|Unit|Description| +|-----------|------|----|-----------| +|`k3s_pod_cpu`|`pod` the pod name|`unknown`|A number that represents the cpu usage of the pod. (no documentation)| +|`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.| + diff --git a/graphite_mapping.conf b/graphite_mapping.conf index aac17ca..34f0cae 100644 --- a/graphite_mapping.conf +++ b/graphite_mapping.conf @@ -488,3 +488,32 @@ mappings: job: "truenas" instance: "${1}" op: "${2}" + +################################################ +# k3s mappings +################################################ + +- match: 'truenas\.(.*)\.k3s_stats\.k3s_pod_stats\.(.*)\.cpu' + match_type: "regex" + name: "k3s_pod_cpu" + labels: + job: "truenas" + instance: "${1}" + pod: "${2}" + +- match: 'truenas\.(.*)\.k3s_stats\.k3s_pod_stats\.(.*)\.mem' + match_type: "regex" + name: "k3s_pod_mem" + labels: + job: "truenas" + instance: "${1}" + pod: "${2}" + +- match: 'truenas\.(.*)\.k3s_stats\.k3s_pod_stats\.(.*)\.net\.(.*)' + match_type: "regex" + name: "k3s_pod_net" + labels: + job: "truenas" + instance: "${1}" + pod: "${2}" + direction: "${3}"