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

Summary power consumption of multiple clusters #15

Open
eumel8 opened this issue Feb 9, 2024 · 0 comments
Open

Summary power consumption of multiple clusters #15

eumel8 opened this issue Feb 9, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@eumel8
Copy link
Member

eumel8 commented Feb 9, 2024

As a requirement we need to know, how much power consumption has our platform in general, that means multiple cluster on multiple environments. If we have no multi-cluster monitoring in place, we can collect the information from each cluster:

  1. The current power consumption of container workload in Joule. 1 Joule = 1 Wattsekunde = 1 VAs. This can be a very large number:
kubectl curl -n cattle-monitoring-system  "http://prometheus-rancher-monitoring-prometheus-0:9090/api/v1/query?query=sum(kepler_container_package_joules_total)" | jq -r '.data.result[]|.value[-1]'
128948308.37400006

ask the same and convert to more readable, let's say MegaJoule

kubectl curl -n cattle-monitoring-system  "http://prometheus-rancher-monitoring-prometheus-0:9090/api/v1/query?query=sum(kepler_container_package_joules_total)%2F1000%2F1000" | jq -r '.data.result[]|.value[-1]'
128.96780355300004
  1. The daily power consumption, collected in the common metric kWh:
kubectl curl -n cattle-monitoring-system  "http://prometheus-rancher-monitoring-prometheus-0:9090/api/v1/query?query=sum(increase(kepler_container_package_joules_total%5B24h%3A1m%5D))%20*%200.00000027777777777" | jq -r '.data.result[]|.value[-1]'
10.91925820424631

This query is copied from the Kepler Grafana dashboard with the converting "watt_per_second_to_kWh", which is factor 0.0000002777777777 (1W*s = 1J and 1J = (1/3600000)kWh)

The same query for one hour

kubectl curl -n cattle-monitoring-system  "http://prometheus-rancher-monitoring-prometheus-0:9090/api/v1/query?query=sum(increase(kepler_container_package_joules_total%5B1h%3A1m%5D))%20*%200.00000027777777777" | jq -r '.data.result[]|.value[-1]'
0.4499151308907774

Which is a better visualization for a status page or status dashboard? Joule is in real time (in the second), but not very common.

Cc: @y-eight

hint: data collected via kubectl, curl plugin to ask Prometheus API on Prometheus Pod.

@eumel8 eumel8 added the enhancement New feature or request label Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant