Skip to content

Commit

Permalink
doc: add power_consumption metrics
Browse files Browse the repository at this point in the history
- also expose power_cost_monthly metrics but still testing
  • Loading branch information
timtorChen committed Nov 10, 2024
1 parent 4c01076 commit 1e3f866
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
[![Pod-Count](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.timtor.dev%2Fquery%3Fformat%3Dendpoint%26metric%3Dpod_count%26label%3D&style=flat-square&color=green&label=Pod)](https://github.com/kashalls/kromgo/)  
[![CPU-Usage](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.timtor.dev%2Fquery%3Fformat%3Dendpoint%26metric%3Dcpu_usage%26label%3D&style=flat-square&label=CPU)](https://github.com/kashalls/kromgo/)  
[![Memory-Usage](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.timtor.dev%2Fquery%3Fformat%3Dendpoint%26metric%3Dmemory_usage%26label%3D&style=flat-square&label=Memory)](https://github.com/kashalls/kromgo/)  
[![Power-Consumption](https://img.shields.io/endpoint?url=https%3A%2F%2Fkromgo.timtor.dev%2Fquery%3Fformat%3Dendpoint%26metric%3Dpower_consumption%26label%3D&style=flat-square&label=Power)](https://github.com/kashalls/kromgo/)  

</div>

Expand Down
32 changes: 31 additions & 1 deletion kubernetes/kromgo/app/kromgo-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: kromgo
name: kromgo-config
data:
config.yaml: |
config.yaml: | #yaml
debug: false
metrics:
- name: kubernetes_version
Expand Down Expand Up @@ -47,3 +47,33 @@ data:
- color: "red"
min: 75
max: 100
- name: power_consumption
query: round(unpoller_device_outlet_ac_power_consumption, 0.1)
suffix: "W"
colors:
- color: "green"
max: 100
- color: "orange"
min: 100
max: 150
- color: "red"
min: 150
max: 250
- name: power_cost_monthly
query: |
round(
sum_over_time(
(unpoller_device_outlet_ac_power_consumption + ignoring(month) group_right
count_values without() (
"month",
month(timestamp(unpoller_device_outlet_ac_power_consumption) + 8*3600)
))[1d:1h]
)
*
count_values without() (
"month",
month(timestamp(unpoller_device_outlet_ac_power_consumption) + 8*3600)
)
/1000 *3.5 # average cost per kWh in NTD
, 0.1)
suffix: "NTD"

0 comments on commit 1e3f866

Please sign in to comment.