prometheus/prometheus

Add LookbackDelta to ReadHints

Offen

#12.789 geöffnet am 04.09.2023

 (10 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (10.408 Forks)batch import
component/remote storagehelp wanted

Repository-Metriken

Stars
 (64.042 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Proposal

Related to #4192 & #4122.

Hey, my goal is to implement the Remote Read protocol on top of my own storage and I'm trying to reduce the number of outgoing samples to shrink a response size. Basically, I'd like to push down the downsampling operation to my storage, and apply the logic of vanilla query_range to filter out samples that will be excluded by caller itself.

But, both start_timestamp_ms in Query and start_ms in ReadHint contain the same value. And this value is affected by lookbackDelta configured on caller side, so if the original query is in the range [t0, t1], remote read query will be in the range [t0-lookbackDelta, t1].

Unfortunately, since lookbackDelta is a configurable parameter, I have no idea how to calculate the original t0 here. And without original t0 it's impossible to reproduce a grid of the original query_range and align samples in the same way.

So, the proposal is to pass lookbackDelta explicitly on each Remote Read request.

Contributor Guide