-
Notifications
You must be signed in to change notification settings - Fork 454
Closed
headlamp-k8s/plugins
#184Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.prometheusRelating to prometheus and the prometheus pluginRelating to prometheus and the prometheus plugin
Description
Hallo,
I'm coming from Kubernetes Dashboard and I see a discrepancy in memory reported (double).
The time in the snapshot images is not aligned but I see roughly a double amount of memory reported by Headlamp versus Kubernetes Dashboard and Kubectl
Headlamp:
Kubernetes Dashboard:
Kubectl
kubectl top pod -n monitoring prometheus-kube-x-0NAME CPU(cores) MEMORY(bytes)
prometheus-kube-x-0 411m 345Mi
A pod can have multiple containers and the metrics container_memory_working_set_bytes reports them.
In the snapshot above, this is the prometheus pod.
- the main container starts itself a image
- the pod has 2 containers.
It reports:
- 1 line for the total it seems
- 1 line for the image started by prometheus
- and 2 lines for each container
The pod has a total of 346714112 (first line) and you can see that this is also seem to be equal roughly to the total of the containers.
The actual query does not filter out the containers memory, making it double?:
memoryQuery={`sum(container_memory_working_set_bytes{namespace='${resource.jsonData.metadata.namespace}',pod=~'${resource.jsonData.metadata.name}'}) by (pod,namespace)`}I propose to:
- filter the containers memory out with the
containerlabel. - delete the
sumas the name and namespace identifies the pod uniquely ?
container_memory_working_set_bytes{container!='', namespace='${resource.jsonData.metadata.namespace}',pod=~'${resource.jsonData.metadata.name}'})
This is already the case for the pod CPU query by the way.
cpuQuery={`sum(rate(container_cpu_usage_seconds_total{container!='',namespace='${resource.jsonData.metadata.namespace}',pod='${resource.jsonData.metadata.name}'}[1m])) by (pod,namespace)`}Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.prometheusRelating to prometheus and the prometheus pluginRelating to prometheus and the prometheus plugin
Type
Projects
Status
Queued