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 upPromQL bug with query_range and metrics name change #4562
Comments
brian-brazil
added
kind/bug
priority/P1
component/promql
labels
Aug 29, 2018
roidelapluie
changed the title
PromQL bug with query_range and staleness
PromQL bug with query_range and metrics name change
Aug 29, 2018
This comment has been minimized.
This comment has been minimized.
|
For anyone looking at this later, note that this type of query is non-advised due to a) using a regex on name rather than specifying names directly which is inefficient and indicates data model issues (use However an instant query and a range query step should always return the same result for a given timestamp, so this is a bug. |
This comment has been minimized.
This comment has been minimized.
|
The issue here is the duplicate timestamp that happens when the The best course of action here is likely to forbid such expressions, that is to make it so that a given instant/range vector cannot contain two metrics with the same labelset and to return an error to the user. This will likely break some users doing inadvisable things (like the above query), but I don't see any other way that's semantically sane. |
This comment has been minimized.
This comment has been minimized.
|
So https://user-images.githubusercontent.com/291750/44791137-3f024d80-aba1-11e8-9e08-f138cd6755e9.png would render an error? I can imagine that this is something that is between the bug fix and the breaking change. |
This comment has been minimized.
This comment has been minimized.
|
Yes, that should render an error. There may be users depending on this, which is why it's potentially breaking, however it is not a sane query as it's semantics are undefined. Using regexes on metric names is very strongly discouraged, outside of debugging Prometheus performance issues. |
This comment has been minimized.
This comment has been minimized.
|
Strangely enough I have not seen that in the doc:
Maybe we should add a warning? In our case the metric names change of the exporter were converted by name=~"old|new" on every dashboard. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil |
This comment has been minimized.
This comment has been minimized.
|
There's three places: range vector functions, range Eval, and the unary minus. We may also be able to remove the existing check from label_replace. |
sipian
referenced this issue
Sep 9, 2018
Merged
Add duplicate-labelset check for range/instant vectors #4589
brian-brazil
closed this
in
#4589
Sep 18, 2018
roidelapluie
referenced this issue
Dec 25, 2018
Open
500 Internal Server Error when query metrics using label __name__ #5038
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
roidelapluie commentedAug 29, 2018
•
edited by brian-brazil
Bug Report
What did you do?
sum(rate({__name__=~'node_network_receive_drop_total|node_network_receive_drop',env='prod',instance="nip-beprd51"}[5m]) > 0) by(instance,cluster)What did you expect to see?
a constant result
What did you see instead? Under which circumstances?
when the query range overlaps the metric name change, I git no result when we switch to the new metric
Environment
prometheus, version 2.3.2 (branch: HEAD, revision: 71af5e2)
build user: root@5258e0bd9cc1
build date: 20180712-14:02:52
go version: go1.10.3
Raw data
Query range queries with sum() that cross 1535541430-1535541431 are stopped in the middle