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

Access to the hashmap returned by a query #2404

Closed
JeromeVi opened this Issue Feb 7, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@JeromeVi
Copy link

JeromeVi commented Feb 7, 2017

Hi, I know it's not an issue but maybe you could think about your doc with my question (I don't criticize it !)

What did you do?
I made a query container_last_seen[10s] that returns me a list of JSON containing a lot of informations about "container". And I want to take only the name but I don't know how to make my query because I can't found example in the documentation, I mean I did container_last_seen{name="oneOfTheNames"}[10s] but it only returns me the one with this name so it's right despite it's not what I want to do.

container_last_seen{container_label_com_docker_compose_config_hash="505d1197fc3598a3243d441d7952d2dff037f28b2dc9fe08be748d386a3f593b",container_label_com_docker_compose_container_number="1",container_label_com_docker_compose_oneoff="False",container_label_com_docker_compose_project="mgmtdockergui",container_label_com_docker_compose_service="app",container_label_com_docker_compose_version="1.10.0",id="/docker/1cee714ccaa50710460ea6b546558c6743687fc7d159ff7eed6dc037ad290c24",image="jeromevi/mgmt-docker-ui",instance="cadvisor:8080",job="cadvisor",name="mgmtdockergui_app_1"}

What did you expect to see?

The expected result is something like `container_last_seen{name="mgmtdockergui_app_1"}

So someone could help me to make a the query ? Or maybe give me hints and tips about querying ?

@agaoglu

This comment has been minimized.

Copy link
Contributor

agaoglu commented Feb 24, 2017

You can try something like sum(container_last_seen) by(name). But that would mean you'll get the sum of the series with same name but different id's for example. See here.

@JeromeVi JeromeVi closed this Mar 8, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

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