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

Logical operation query return null when comes two empty vectors in prometheus 2.0 #3603

Closed
ZeeShen opened this Issue Dec 20, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@ZeeShen
Copy link

ZeeShen commented Dec 20, 2017

What did you do?
query

up{not_match="1"} or up{not_match="2"}

What did you expect to see?
return {"status":"success","data":{"resultType":"vector","result":[]}}

What did you see instead? Under which circumstances?
{"status":"success","data":{"resultType":"vector","result":null}}

prometheus graph js running into error Uncaught TypeError: Cannot read property 'length' of null

Environment

  • Prometheus version:
  build user:       root@615b82cb36b6
  build date:       20171108-07:11:59
  go version:       go1.9.2

Actually, my situation is: I had some old alerting rules that allow users to disable some alerts by setting a NoAlert label.

node_memory_usage{NoAlert!~".*mem.*",job="nodes"} > 0.95
node_cpu_usage{NoAlert!~".*cpu.*",job="nodes"} > 0.95

Because of #3575, prometheus 2.0 doesn't return metrics that NoAlert label is not set. So I tried and this null situation happened.

(node_memory_usage{NoAlert="",job="nodes"})
 or (node_memory_usage{NoAlert!~".*mem.*",job="nodes"})

I will put my NoAlert rules in alertmanager as it persists silences on disk now. But this null result maybe not a supposed return?

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Dec 20, 2017

Dupe of #3515, fix will be in the next release.

@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.