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

which metric is the pod actual metric #5041

Closed
dengceltics opened this Issue Dec 26, 2018 · 4 comments

Comments

Projects
None yet
4 participants
@dengceltics
Copy link

dengceltics commented Dec 26, 2018

I get three metrics when i check container_memory_max_usage_bytes{pod_name="prometheus-core-6b5dc8dd4d-z4dvl"}.

image

Here is the details of the picture:

metric1:
container_memory_max_usage_bytes{beta_kubernetes_io_arch="amd64",beta_kubernetes_io_os="linux",cluster="prod-kubernetes",id="/kubepods/podff7725bf-08da-11e9-a53f-066788000017",instance="node-rwc3apul",job="kubernetes-cadvisor",kubernetes_io_hostname="node-rwc3apul",namespace="monitoring",pod_name="prometheus-core-6b5dc8dd4d-z4dvl"}

metric2:
container_memory_max_usage_bytes{beta_kubernetes_io_arch="amd64",beta_kubernetes_io_os="linux",cluster="prod-kubernetes",container_name="prometheus",id="/kubepods/podff7725bf-08da-11e9-a53f-066788000017/babf8a744fb4f9297dc1d095d89a6444fcce655753396dc66e770ec835241539",image="sha256:42e450d926a80488ea5166225a197da923fd085efed20b811c324842e8352ecc",instance="node-rwc3apul",job="kubernetes-cadvisor",kubernetes_io_hostname="node-rwc3apul",name="k8s_prometheus_prometheus-core-6b5dc8dd4d-z4dvl_monitoring_ff7725bf-08da-11e9-a53f-066788000017_0",namespace="monitoring",pod_name="prometheus-core-6b5dc8dd4d-z4dvl"}
metric3:
container_memory_max_usage_bytes{beta_kubernetes_io_arch="amd64",beta_kubernetes_io_os="linux",cluster="prod-kubernetes",container_name="POD",id="/kubepods/podff7725bf-08da-11e9-a53f-066788000017/17c3cafe254d195027db61143ddfb247c3b0a8a845efebf3bdb3973fa214db70",image="10.4.79.28:5000/gcr.io/google_containers/pause-amd64:3.1",instance="node-rwc3apul",job="kubernetes-cadvisor",kubernetes_io_hostname="node-rwc3apul",name="k8s_POD_prometheus-core-6b5dc8dd4d-z4dvl_monitoring_ff7725bf-08da-11e9-a53f-066788000017_0",namespace="monitoring",pod_name="prometheus-core-6b5dc8dd4d-z4dvl"}

So,which is the pod "prometheus-core-6b5dc8dd4d-z4dvl" "container_memory_max_usage_bytes" metric .

@dengceltics dengceltics reopened this Dec 26, 2018

@dengceltics dengceltics changed the title I get three metrics which have same name and different labels when i which metric is the pod actual metric Dec 26, 2018

@codesome

This comment has been minimized.

Copy link
Member

codesome commented Dec 26, 2018

@dengceltics container_memory_max_usage_bytes{pod_name="prometheus-core-6b5dc8dd4d-z4dvl"} would select all those metrics which have __name__="container_memory_max_usage_bytes" and pod_name="prometheus-core-6b5dc8dd4d-z4dvl". The other labels in the metrics should give you more insight (like id).

This question seems to be more on a usage side, I suggest you to use prometheus-users mailing list or #prometheus channel on IRC for that.
https://prometheus.io/community/

@dengceltics

This comment has been minimized.

Copy link
Author

dengceltics commented Dec 27, 2018

@dengceltics container_memory_max_usage_bytes{pod_name="prometheus-core-6b5dc8dd4d-z4dvl"} would select all those metrics which have __name__="container_memory_max_usage_bytes" and pod_name="prometheus-core-6b5dc8dd4d-z4dvl". The other labels in the metrics should give you more insight (like id).

This question seems to be more on a usage side, I suggest you to use prometheus-users mailing list or #prometheus channel on IRC for that.
https://prometheus.io/community/

Thanks. But the question confused me is that the pod named prometheus-core-6b5dc8dd4d-z4dvl must have just one metric named container_memory_max_usage_bytes .Such as one linux host's os is either 64-bit or 32-bit. So prometheus-core-6b5dc8dd4d-z4dvl container_memory_max_usage_bytes value is can't be three numeric valuse.

Sorry,i'll go #prometheus channel after i solve this problem.

@aixeshunter

This comment has been minimized.

Copy link
Contributor

aixeshunter commented Dec 28, 2018

Maybe sum by(instance, pod_name, namespace) (container_memory_max_usage_bytes{pod_name="prometheus-core-6b5dc8dd4d-z4dvl"}) / 2 is work?

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Jan 2, 2019

Closing it for now. As @codesome already wrote, it is a usage question, not an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.