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 upremote_read - read_recent does not work as expected #3599
Comments
brian-brazil
added
component/remote storage
kind/bug
labels
Dec 19, 2017
This comment has been minimized.
This comment has been minimized.
|
I looked into this and found the
I have to admit I'm not sure I understand the reason for the current implementation.
|
This comment has been minimized.
This comment has been minimized.
|
I think I found out the problem. My prometheus is started with the following parameter Setting this value so low triggers a bug in the way the block size is calculated. If i go to to the Forcing the max/min block size with the following options makes the bug disappear and the reads are processed correctly by prometheus:
The problem relies on the way prometheus calculates the defaults for
So, accordingly:
IMHO this bug can be fixed calculating min-block-duration as ... let's say... 5% of retention time? Maybe @fabxc has some recommendations? Specifying |
This comment has been minimized.
This comment has been minimized.
|
Actually... I just found out that whenever |
brian-brazil
removed
the
kind/bug
label
Dec 21, 2017
This comment has been minimized.
This comment has been minimized.
|
With those settings, we basically have to query LTS on every query as there's insufficient local state. Why do you wish to set the retention so low? |
This comment has been minimized.
This comment has been minimized.
|
Why do you think that there is insufficient storage state? I had the feeling that for every query that is less than 2h in the past I would use the local storage (example, memory usage over the past hour) |
This comment has been minimized.
This comment has been minimized.
|
cc: @Thib17, whowork on some of this code. |
This comment has been minimized.
This comment has been minimized.
Retention is only 2 hours, it takes more than that for read_recent to start to work. This is all working as expected. |
This comment has been minimized.
This comment has been minimized.
Is this statement correct? That's the behavior I recall
Is this documented somewhere? I can't find anything relevant |
This comment has been minimized.
This comment has been minimized.
sathappan
commented
Feb 1, 2018
|
I'm facing the same issue as @AndreaGiardini . Except in my case the retention is the default 15d, min-block-duration is 2h and max-block-duration is 36h. All defaults. I have Prometheus 2.1.0 and use InfluxDB for the LTS. |
This comment has been minimized.
This comment has been minimized.
That's not right. read_recent is an optimisation, it shouldn't have any semantic effect. |
This comment has been minimized.
This comment has been minimized.
sathappan
commented
Feb 1, 2018
|
When I changed the min-block-duration to 119m instead of the default 120m, all my irate queries started working correctly and the calls were not sent to the LTS. Can somebody explain this behavior? @brian-brazil @fabxc |
This comment has been minimized.
This comment has been minimized.
sathappan
commented
Feb 1, 2018
•
|
That is what I thought. But like I mentioned in my last comment, whenever I left the min block duration to 2h, my graphs clearly said No datapoints. When I ran the query that Prometheus fired in Influx, I was able to see the samples there. So, it's only the query processing that's ignoring the samples may be? This happened only for irate though. |
This comment has been minimized.
This comment has been minimized.
|
That does not sound like the issue being reported here, can you file a new bug? |
This comment has been minimized.
This comment has been minimized.
sathappan
commented
Feb 1, 2018
•
|
@brian-brazil Okay. It started working now. Silly me! So, I missed giving an information earlier. After I integrated the LTS, I wiped my data directory. Once I did that, all my reads were being sent to the LTS. That's why when I gave lower min-block-duration values earlier, it worked by getting data from local storage and for higher ones like 2h or more, it was sending my queries to LTS. Didn't know that read_recent was dependent on min-block-duration. I guess it makes sense to document this behavior. |
This comment has been minimized.
This comment has been minimized.
|
It's an implementation detail that I don't believe should be exposed to users as it'll lead to confusion (i.e. they'll start messing around with block durations). In any case, this is all working as designed. |
brian-brazil
closed this
Feb 1, 2018
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. |
AndreaGiardini commentedDec 19, 2017
What did you do?
I tried to configure prometheus with a remote_read endpoint
What did you expect to see?
I expected prometheus to query the remote endpoint only if the metrics are not available in the local storage.
What did you see instead? Under which circumstances?
Prometheus always queries the remote endpoint, no matter its configuration.
Environment
System information:
k8s 1.7.8
Prometheus version:
both v2 and master
Prometheus configuration file:
I believe the default for read_recent should be set to
falsehere: https://github.com/prometheus/prometheus/blob/master/config/config.go#L200From the logs of influxdb I can see that, no matter what, prometheus always queries the remote endpoint. Help is appreciated