Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added k3s metrics mappings for apps #57

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion METRICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`|<ul><li>`pool` name of the pool</li><li>`state`</li></ul>|`boolean`|Shows the states of the pool with boolean indicating if they are active.|
|`zfs_pool`|<ul><li>`pool` name of the pool</li><li>`state`</li></ul>|`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|`ms/ns`|A number that represents the cpu usage of the pod. (cpu time in ms or ns needs to be tested)|
|`k3s_pod_mem`|`pod` the pod name|`bytes`|The number of bytes of memory this pod is using.|
|`k3s_pod_net`|<ul><li>`pod` the pod name</li><li>`direction` the direction of network traffic</li></ul>|`bytes`|The number of bytes in/out of the pod over the network interface.|

29 changes: 29 additions & 0 deletions graphite_mapping.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"