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

Support binary operators on different labels #393

Closed
brian-brazil opened this Issue Jun 5, 2014 · 5 comments

Comments

Projects
None yet
3 participants
@brian-brazil
Copy link
Member

brian-brazil commented Jun 5, 2014

I have some cpu variables:
instance_mode:node_cpu:rate5m{mode="idle"} 8
instance_mode:node_cpu:rate5m{mode="user"} 10

and I'd like to divide them by:
instance:node_num_cpus:sum 2

and get as output:
{mode="idle"} 4
{mode="user"} 5

This currently won't work, I'd like to be able to do something like:

instance_mode:node_cpu:rate5m
/ MODIFIER by (instance, mode)
instance:node_num_cpus:sum

We need a modifier to tell us which operand is which for this behaviour. I'm thinking maybe pivot_left/pivot_right or group_left/group_right as modifier names, whatever we choose it must be obvious which is which.

@brian-brazil

This comment has been minimized.

Copy link
Member Author

brian-brazil commented Feb 20, 2015

@fabxc pointed out that this syntax isn't quite right, and following discussion something more like MODIFIER(mode) by (instance) is what you'd want.

@fabxc

This comment has been minimized.

Copy link
Member

fabxc commented Feb 24, 2015

Example: group_left(type) by (handler)

From which side should the type label be taken, assuming it is available on both and has different values on matching samples?
Trying either side and throwing an error if it is present on both would be an option. The latter because this is likely a mistake and it should be group_left by (handler, type). Or using the the label/value from the left side and default to the right (thus dropping the right side if both are present.)

@brian-brazil

This comment has been minimized.

Copy link
Member Author

brian-brazil commented Feb 24, 2015

That's incorrect usage as we're expecting type to only be on one side, so an error of some form would seem appropriate.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Mar 3, 2015

Done by @fabxc in #554.

@juliusv juliusv closed this Mar 3, 2015

simonpasquier pushed a commit to simonpasquier/prometheus that referenced this issue Oct 12, 2017

Merge pull request prometheus#393 from brian-brazil/dead-link
Remove dead link to Boxever website.
@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.