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

recording rules omit without clause #3704

Closed
intenseFrog opened this Issue Jan 19, 2018 · 6 comments

Comments

Projects
None yet
4 participants
@intenseFrog
Copy link

intenseFrog commented Jan 19, 2018

What did you do?

We defined some recording rules to speed up our dashboard

What did you expect to see?

Rules should be reflected as defined

groups:
  - name: container
    rules:
    - record: container:mem:sum
      expr: container_memory_usage_bytes
  - name: pod
    rules:
    - record: pod:mem:sum
      expr: sum without()(container:mem:sum{pod_name=~".+"})

What did you see instead? Under which circumstances?

without clause in the second rule was omitted
in fact

Environment

  • System information:

    4.4.111-boot2docker

  • Prometheus version:

    prometheus, version 2.0.0 (branch: HEAD, revision: 0a74f98628a0463dddc90528220c94de5032d1a0) build user: root@615b82cb36b6 build date: 20171108-07:11:59 go version: go1.9.2

  • Prometheus configuration file:
    Will provide them if necessary.

  • Logs:
    Will provide them if necessary.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jan 19, 2018

had a quick look and it uses the promql parser so doesn't look like an easy fix without changes to the promql package.
will keep digging.

@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jan 19, 2018

@intenseFrog btw why do you need to have an empty without()?

sum without()(container:mem:sum{pod_name=~".+"})
isn't this the same as
container:mem:sum{pod_name=~".+"}

juliusv added a commit that referenced this issue Jan 21, 2018

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jan 21, 2018

Thanks! Fix was easy and is in #3719

juliusv added a commit that referenced this issue Jan 21, 2018

promql: Fix printing of empty without() (#3719)
* promql: Fix printing of empty without()

Fixes #3704

* Test cleanup fixup
@krasi-georgiev

This comment has been minimized.

Copy link
Member

krasi-georgiev commented Jan 22, 2018

@juliusv I was thinking about this fix as well but than the 'by()' is still not covered.

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jan 22, 2018

@krasi-georgiev Omitting an empty by() clause is equivalent to having that empty clause, so I think that's fine?

gouthamve pushed a commit to gouthamve/promql that referenced this issue Mar 28, 2018

promql: Fix printing of empty without() (#3719)
* promql: Fix printing of empty without()

Fixes prometheus/prometheus#3704

* Test cleanup fixup
@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.