Kepler (Kubernetes-based Efficient Power Level Exporter) uses eBPF to probe performance counters and other system stats, use ML models to estimate workload energy consumption based on these stats, and exports them as Prometheus metrics
I have successfully deployed Kepler for energy monitoring in my Kubernetes cluster, but I am encountering an issue with Prometheus integration. While I can collect metrics locally from Kepler, these metrics are not being reported to Prometheus. I suspect the issue might be related to the service discovery configuration in Prometheus.
Deployed Kepler using the following commands:
git clone --depth 1 git@github.com:sustainable-computing-io/kepler.git
cd ./kepler
make build-manifest OPTS="PROMETHEUS_DEPLOY"
kubectl apply -f _output/generated-manifest/deployment.yaml
Deployed Prometheus using:
kubectl apply --server-side -f manifests/setup -n kepler
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
kubectl apply -f manifests/
kubectl apply --server-side -f manifests/setup -n kepler
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
kubectl apply -f manifests/
Anything else we need to know?
No response
Kepler image tag
Last
Kubernetes version
```console
$ kubectl version
```Client Version: v1.28.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.28.3
Cloud provider or bare metal
BM
OS version
```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```
Install tools
Kepler deployment config
For on kubernetes:
```console
$ KEPLER_NAMESPACE=kepler
# provide kepler configmap
$ kubectl get configmap kepler-cfm -n ${KEPLER_NAMESPACE}
# paste output here
# provide kepler deployment description
$ kubectl describe deployment kepler-exporter -n ${KEPLER_NAMESPACE}
```
For standalone:
# put your Kepler command argument here
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
What happened?
I have successfully deployed Kepler for energy monitoring in my Kubernetes cluster, but I am encountering an issue with Prometheus integration. While I can collect metrics locally from Kepler, these metrics are not being reported to Prometheus. I suspect the issue might be related to the service discovery configuration in Prometheus.
Deployed Kepler using the following commands:
Deployed Prometheus using:
Able to fetch metrics locally using:
kubectl exec -ti -n kepler daemonset/kepler-exporter -- bash -c "curl localhost:9102/metrics > /tmp/k.log; grep kepler_container_joules /tmp/k.log | sort -k 2 -g"
PrometheusRule:
ServiceMonitor:
Service details:
What did you expect to happen?
Prometheus discovers the Kepler service and reports metrics.
How can we reproduce it (as minimally and precisely as possible)?
Deployed Kepler using the following commands:
Deployed Prometheus using:
Anything else we need to know?
No response
Kepler image tag
Kubernetes version
Cloud provider or bare metal
OS version
Install tools
Kepler deployment config
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)