Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upNo way to convert or make use of <no data> queries #3264
Comments
This comment has been minimized.
This comment has been minimized.
|
See https://www.robustperception.io/existential-issues-with-metrics/ This is expected behaviour, if there's no data the answer is nothing. |
This comment has been minimized.
This comment has been minimized.
|
The expected behaviour is quite fine, and I don't mean to suggest it should be changed. The inability to convert "nothing" to "0", for when that is meaningful, is what's missing. When counting occurrences of something, the conceptual nothing is the same as the countable 0. Being able to express that in PromQL should be possible without a fallback hack as mentioned in that article. |
This comment has been minimized.
This comment has been minimized.
|
The blog post details how to handle this. It makes more sense to ask questions like this on the prometheus-users mailing list rather than in a GitHub issue. On the mailing list, more people are available to potentially respond to your question, and the whole community can benefit from the answers provided. |
brian-brazil
closed this
Oct 9, 2017
This comment has been minimized.
This comment has been minimized.
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. |
swarminglogic commentedOct 9, 2017
•
edited
I've encountered a situation where I need to make queries for counters, where some labels are determined ahead of time, and some, not.
The query: "Please tell me how many times A=x, B=y has occurred in the last N time" returns unless that metric is registered for those labels. For gauges, histograms, summaries, etc, this makes sense. If you don't have that particular measurement, there isn't much meaning to any value.
However, "how many times has x,y,z occurred" is an obvious "0" even when you haven't registered a single occurrence of it. Having to register these ahead of time is not only silly, but unfeasible in some use cases.
Returning in the case of counters is also fine, and reasonable. No having a way to use the absence of such a metric, is highly limiting, and I'm using all the imagination to find a case where it could be problematic.
What did you do?
Tried to ask "How many times has x-y-z occurred?", and have a way to make no observations be evaluated as 0, or something I can use in arithmetic operations.
What did you expect to see?
A method or conditional operation that lets me convert the absence of data, as something of my choice.
What did you see instead? Under which circumstances?
A limitation of the PromQL that boggles my mind.