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

Queue on different labels of the same metric fails #1515

Closed
hryamzik opened this Issue Mar 31, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@hryamzik
Copy link

hryamzik commented Mar 31, 2016

Here're my metrics:

# TYPE node_cpu_facts gauge
node_cpu_facts { fact="cores" } 8
node_cpu_facts { fact="count" } 2
node_cpu_facts { fact="threads_per_core" } 2

And I can do some maths on it with a single label:

node_cpu_facts { fact="cores" } + node_cpu_facts

This looks wired but the result is actually node_cpu_facts { fact="cores" } * 2.

And this queue simply fails:

node_cpu_facts{fact="cores"} * node_cpu_facts{fact="count"} * node_cpu_facts{fact="threads_per_core"}

I didn't find any special queue syntax for this case. The only workaround seem to be using 3 metrics instead of one labeled.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 31, 2016

Your labels don't match, you'd have to use on clauses here. As I indicated in #1514 you should be using 3 metrics for this as a label doesn't make sense here and makes things like this harder.

@hryamzik

This comment has been minimized.

Copy link
Author

hryamzik commented Mar 31, 2016

Can I ask you to show me the correct syntax if queuing in this case? I did switch to separate metrics but still a bit frustrated about this behaviour.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Mar 31, 2016

In this case it's probably node_cpu_facts{fact="cores"} * on (instance) node_cpu_facts{fact="count"}

You could also expose the number of threads directly.

@hryamzik

This comment has been minimized.

Copy link
Author

hryamzik commented Apr 1, 2016

Thanks! Closing.

@hryamzik hryamzik closed this Apr 1, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 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 24, 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.