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
kepler only captures cgroup of the sub-process which creates entry in the ProcessStats. It may not be a problem, because most cases CgroupID is being compared to 1, to know if the process belongs to kernel.
If the function func NewProcessStats(pid, cGroupID uint64, containerID, vmID, command string, bpfSupportedMetrics bpf.SupportedMetrics) creates entry for a process as in user space, the pid, cGroupID, command etc should be of the parent pid (tgid), or should we replace the field cGroupID with isKernelProcess?
How can we reproduce it (as minimally and precisely as possible)?
run kepler with VM, or any process which can have multiple cgroups
Anything else we need to know?
No response
Kepler image tag
Kubernetes version
```console
$ kubectl version
# paste output here
```
Cloud provider or bare metal
OS version
```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# 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)
What happened?
A user space process can be associated with multiple cgroups. e.g. a VM started with qemu, can have different cgroup for each vcpu
sub processes of VM process
associated cgroups
What did you expect to happen?
low priority bug
kepler only captures cgroup of the sub-process which creates entry in the ProcessStats. It may not be a problem, because most cases CgroupID is being compared to 1, to know if the process belongs to kernel.
If the function
func NewProcessStats(pid, cGroupID uint64, containerID, vmID, command string, bpfSupportedMetrics bpf.SupportedMetrics)
creates entry for a process as in user space, the pid, cGroupID, command etc should be of the parent pid (tgid), or should we replace the fieldcGroupID
withisKernelProcess
?How can we reproduce it (as minimally and precisely as possible)?
run kepler with VM, or any process which can have multiple cgroups
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)