-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
missing kubernetes pods metric labels #347
Comments
Hi, So this is looking for something starting with /kubepods while the cgroups of my container processes I have seen that look like this: So it is not able to get the container id and thus not able to resolve the pod name. I think this naming difference of the cgroup hierarchy might be related with Kind. Any idea if this is the case? and if so, is Kind going to be supported in the future? Also I have seen that cgroups v2 has been introduced in newer versions of linux distros, is that something that could potentially affect the proper functioning of scaphandre? if so, is it going to be supported in the future aswell? Also I would like to ask again for your recommended kubernetes cluster requirements in order to test all of scaphandre features properly. Kind regards and thanks for your awesome project |
Hello, Scaphandre seems to use /proc/{PID}/cgroup file to figure out per process extra informations to provide to prometheus exporter as labels. Documentation :
In my case, the cgroup was something like that : For Scaphandre to be able to grab the ID from this content according to this line : (Seems to only take the last value of a "/" split before going in next steps). For us, the issue was --containers not using /proc/{PID}/cgroups reliably enough to match in all good cases. In short, we recompiled Scaphandre with this modification on the Regex :
and it worked, because ignoring the leading 0:: where the actual version doesn't Maybe you could check your own /proc/{PID}/cgroups to check if you got your cgroup file content formatted the same. |
Hi! I am testing scaphandre deploying it in a kubernetes cluster with the --containers flag and the metrics provided are not showing any of the extra labels for kubernetes pods mentioned in the docs (kubernetes_node_name, kubernetes_pod_name...etc)
example of the metrics I am getting:
scaph_process_power_consumption_microwatts{cmdline="nginx: worker process",pid="2152",exe="nginx"} 0
scaph_process_power_consumption_microwatts{cmdline="nginx: worker process",pid="2151",exe="nginx"} 0
scaph_process_power_consumption_microwatts{pid="2150",exe="nginx",cmdline="nginx: worker process"} 0
scaph_process_power_consumption_microwatts{pid="2149",exe="nginx",cmdline="nginx: worker process"} 0
scaph_process_power_consumption_microwatts{exe="nginx",pid="2148",cmdline="nginx: worker process"} 0
I am running scaphandre inside a Kind multinode cluster deployed with the following configfile:
Note I am mounting the hosts docker.sock as a volume in order for scaphandre to have access to it.
Then I install scaphandre using the helm chart:
$ helm install scaphandre helm/scaphandre
Scaphandre logs:
Scaphandre prometheus exporter
Sending ⚡ metrics
scaphandre::exporters::prometheus: 2023-09-14T13:22:37: Starting Prometheus exporter
Press CTRL-C to stop scaphandre
scaphandre::exporters::prometheus: 2023-09-14T13:23:42: Refresh topology
scaphandre::sensors: Before refresh procs init.
scaphandre::exporters::prometheus: 2023-09-14T13:23:42: Refresh data
scaphandre::exporters: 2023-09-14T13:23:42: Get self metrics
scaphandre::exporters: 2023-09-14T13:23:42: Get host metrics
scaphandre::exporters: 2023-09-14T13:23:42: Get socket metrics
scaphandre::exporters: 2023-09-14T13:23:42: Get system metrics
scaphandre::exporters: 2023-09-14T13:23:42: Get process metrics
scaphandre::exporters: First check done on pods.
scaphandre::exporters::prometheus: 2023-09-14T13:23:53: Refresh topology
scaphandre::sensors: Before refresh procs init.
scaphandre::exporters::prometheus: 2023-09-14T13:23:53: Refresh data
scaphandre::exporters: 2023-09-14T13:23:53: Get self metrics
scaphandre::exporters: 2023-09-14T13:23:53: Get host metrics
scaphandre::exporters: 2023-09-14T13:23:53: Get socket metrics
scaphandre::exporters: 2023-09-14T13:23:53: Get system metrics
scaphandre::exporters: 2023-09-14T13:23:53: Get process metrics
scaphandre::exporters::prometheus: 2023-09-14T13:24:35: Refresh topology
scaphandre::sensors: Before refresh procs init.
scaphandre::exporters::prometheus: 2023-09-14T13:24:35: Refresh data
scaphandre::exporters: 2023-09-14T13:24:35: Get self metrics
scaphandre::exporters: 2023-09-14T13:24:35: Get host metrics
scaphandre::exporters: 2023-09-14T13:24:35: Get socket metrics
scaphandre::exporters: 2023-09-14T13:24:35: Get system metrics
scaphandre::exporters: 2023-09-14T13:24:35: Get process metrics
scaphandre::exporters: Just refreshed pod list ! last: 1694697822 now: 1694697875, diff: 53
I would like to know if this feature is working as of today and in such case what are the kubernetes deployment requirements for it to work, or the recommended environment, meaning:
The text was updated successfully, but these errors were encountered: