Skip to content

Commit

Permalink
fix: add kromgo metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Fornaro <20387402+xUnholy@users.noreply.github.com>
  • Loading branch information
xunholy committed Jan 8, 2025
1 parent 6e993a6 commit 843e08a
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 58 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,21 @@ _... managed with Flux, Renovate and GitHub Actions_

<div align="center">

[![Discord](https://img.shields.io/discord/673534664354430999?style=for-the-badge&label=discord&logo=discord&logoColor=white&color=blue)](https://discord.gg/k8s-at-home)
[![Kubernetes](https://img.shields.io/badge/Kubernetes-v1.32.0-blue?style=for-the-badge&logo=kubernetes&logoColor=white)](https://kubernetes.io/)
[![Linux](https://img.shields.io/badge/Talos-v1.9.1-blue?style=for-the-badge&logo=linux&logoColor=white)](https://kubernetes.io/)
[![Discord](https://img.shields.io/discord/673534664354430999?style=for-the-badge&label=discord&logo=discord&logoColor=white&color=blue)](https://discord.gg/home-operations)&nbsp;&nbsp;
[![Kubernetes](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fkubernetes_version&style=for-the-badge&logo=kubernetes&logoColor=white&color=blue)](https://kubernetes.io/)&nbsp;&nbsp;
[![Talos](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Ftalos_version&style=for-the-badge&logo=talos&logoColor=white&color=blue&label=%20)](https://talos.dev)&nbsp;&nbsp;

</div>

<div align="center">

[![Age-Days](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_age_days&style=flat-square&label=Age)](https://github.com/kashalls/kromgo)&nbsp;&nbsp;
[![Uptime-Days](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_uptime_days&style=flat-square&label=Uptime)](https://github.com/kashalls/kromgo)&nbsp;&nbsp;
[![Node-Count](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_node_count&style=flat-square&label=Nodes)](https://github.com/kashalls/kromgo)&nbsp;&nbsp;
[![Pod-Count](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_pod_count&style=flat-square&label=Pods)](https://github.com/kashalls/kromgo)&nbsp;&nbsp;
[![CPU-Usage](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_cpu_usage&style=flat-square&label=CPU)](https://github.com/kashalls/kromgo)&nbsp;&nbsp;
[![Memory-Usage](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_memory_usage&style=flat-square&label=Memory)](https://github.com/kashalls/kromgo)&nbsp;&nbsp;
[![Power-Usage](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.raspbernetes.com%2Fcluster_power_usage&style=flat-square&label=Power)](https://github.com/kashalls/kromgo)

</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
values:
controllers:
kromgo:
replicas: 2
replicas: 1
strategy: RollingUpdate
containers:
app:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,69 +5,69 @@ badge:
size: 12

metrics:
# - name: talos_version
# query: node_os_info{name="Talos"}
# label: version_id
# title: Talos
- name: talos_version
query: node_os_info{name="Talos"}
label: version_id
title: Talos

- name: kubernetes_version
query: kubernetes_build_info{service="kubernetes"}
label: git_version
title: Kubernetes

# - name: cluster_node_count
# query: count(count by (node) (kube_node_status_condition{condition="Ready"}))
# colors:
# - { color: "green", min: 0, max: 9999 }
# title: Nodes
- name: cluster_node_count
query: count(count by (node) (kube_node_status_condition{condition="Ready"}))
colors:
- { color: "green", min: 0, max: 9999 }
title: Nodes

# - name: cluster_pod_count
# query: sum(kube_pod_status_phase{phase="Running"})
# colors:
# - { color: "green", min: 0, max: 9999 }
# title: Pods
- name: cluster_pod_count
query: sum(kube_pod_status_phase{phase="Running"})
colors:
- { color: "green", min: 0, max: 9999 }
title: Pods

# - name: cluster_cpu_usage
# query: round(avg(instance:node_cpu_utilisation:rate5m{kubernetes_node!=""}) * 100, 0.1)
# suffix: "%"
# colors:
# - { color: "green", min: 0, max: 35 }
# - { color: "orange", min: 36, max: 75 }
# - { color: "red", min: 76, max: 9999 }
# title: CPU
- name: cluster_cpu_usage
query: round(avg(instance:node_cpu_utilisation:rate5m{kubernetes_node!=""}) * 100, 0.1)
suffix: "%"
colors:
- { color: "green", min: 0, max: 35 }
- { color: "orange", min: 36, max: 75 }
- { color: "red", min: 76, max: 9999 }
title: CPU

# - name: cluster_memory_usage
# query: round(sum(node_memory_MemTotal_bytes{kubernetes_node!=""} - node_memory_MemAvailable_bytes{kubernetes_node!=""}) / sum(node_memory_MemTotal_bytes{kubernetes_node!=""}) * 100, 0.1)
# suffix: "%"
# colors:
# - { color: green, min: 0, max: 35 }
# - { color: orange, min: 36, max: 75 }
# - { color: red, min: 76, max: 9999 }
# title: Memory
- name: cluster_memory_usage
query: round(sum(node_memory_MemTotal_bytes{kubernetes_node!=""} - node_memory_MemAvailable_bytes{kubernetes_node!=""}) / sum(node_memory_MemTotal_bytes{kubernetes_node!=""}) * 100, 0.1)
suffix: "%"
colors:
- { color: green, min: 0, max: 35 }
- { color: orange, min: 36, max: 75 }
- { color: red, min: 76, max: 9999 }
title: Memory

# - name: cluster_power_usage
# query: round(upsHighPrecOutputLoad, 0.1)
# suffix: "w"
# colors:
# - { color: "green", min: 0, max: 400 }
# - { color: "orange", min: 401, max: 750 }
# - { color: "red", min: 751, max: 9999 }
# title: Power
- name: cluster_power_usage
query: round(upsHighPrecOutputLoad, 0.1)
suffix: "w"
colors:
- { color: "green", min: 0, max: 400 }
- { color: "orange", min: 401, max: 750 }
- { color: "red", min: 751, max: 9999 }
title: Power

# - name: cluster_age_days
# query: round((time() - min(kube_node_created) ) / 86400)
# suffix: "d"
# colors:
# - { color: "green", min: 0, max: 180 }
# - { color: "orange", min: 181, max: 360 }
# - { color: "red", min: 361, max: 9999 }
# title: Age
- name: cluster_age_days
query: round((time() - min(kube_node_created) ) / 86400)
suffix: "d"
colors:
- { color: "green", min: 0, max: 180 }
- { color: "orange", min: 181, max: 360 }
- { color: "red", min: 361, max: 9999 }
title: Age

# - name: cluster_uptime_days
# query: round(avg(node_time_seconds{kubernetes_node!=""} - node_boot_time_seconds{kubernetes_node!=""}) / 86400)
# suffix: "d"
# colors:
# - { color: "green", min: 0, max: 180 }
# - { color: "orange", min: 181, max: 360 }
# - { color: "red", min: 361, max: 9999 }
# title: Uptime
- name: cluster_uptime_days
query: round(avg(node_time_seconds{kubernetes_node!=""} - node_boot_time_seconds{kubernetes_node!=""}) / 86400)
suffix: "d"
colors:
- { color: "green", min: 0, max: 180 }
- { color: "orange", min: 181, max: 360 }
- { color: "red", min: 361, max: 9999 }
title: Uptime

0 comments on commit 843e08a

Please sign in to comment.