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

Change in selector behaviour for != #3575

Closed
tcolgate opened this issue Dec 11, 2017 · 3 comments
Closed

Change in selector behaviour for != #3575

tcolgate opened this issue Dec 11, 2017 · 3 comments

Comments

@tcolgate
Copy link
Contributor

What did you do?
query:
metrics{label != "thing"}
where label is not set.

What did you expect to see?
In prometheus 1.6.3 this will return all the items where label != "thing", including items where label is not set at all.

What did you see instead? Under which circumstances?
In prometheus 2.0 items without label set are not returned.

@gouthamve
Copy link
Member

Yep, this is confirmed and doesn't look like a trivial change. Will work on this whenever I get time, but cannot commit to anything.

So, essentially this here is not selecting stuff which doesn't have a label set: https://github.com/prometheus/tsdb/blob/master/querier.go#L257-L306

One of the proposals is that we could materialise a view which has the postings for all series where l != v and then use that. But that also means that the matcher interface we have doesn't cut it anymore.

We could also not bleed this into tsdb and rather make Prometheus make 2 queries, one with "absent" matcher, one with "!=" and then merge the results of the two.

/cc @krasi-georgiev

@brian-brazil
Copy link
Contributor

We could also not bleed this into tsdb and rather make Prometheus make 2 queries, one with "absent" matcher, one with "!=" and then merge the results of the two.

I don't think this should leak, and there could be multiple such selectors.

gouthamve added a commit to gouthamve/prometheus that referenced this issue Dec 13, 2017
Fixes prometheus#3575

Comes with a slight performance penalty which is better off
addressed in tsdb

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
gouthamve added a commit to gouthamve/tsdb that referenced this issue Dec 17, 2017
Fixes prometheus/prometheus#3575

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
gouthamve added a commit to gouthamve/tsdb that referenced this issue Dec 19, 2017
Fixes prometheus/prometheus#3575

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
brian-brazil added a commit that referenced this issue Dec 23, 2017
krasi-georgiev pushed a commit to krasi-georgiev/prometheus that referenced this issue Jan 10, 2018
gouthamve pushed a commit to gouthamve/promql that referenced this issue Mar 28, 2018
@lock
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.
Projects
None yet
Development

No branches or pull requests

3 participants