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 upstorage.Querier doesn't handle offsets efficiently #4224
Comments
This comment has been minimized.
This comment has been minimized.
|
We are also seeing symptoms from #3450 which may be related (since alerting rules somewhat regularly include offsets as well). |
This comment has been minimized.
This comment has been minimized.
|
Passing the information as a hint sounds fine to me. There's no performance impact to Prometheus with the current implementation. |
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Jun 5, 2018
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Jun 6, 2018
brian-brazil
added
kind/enhancement
component/remote storage
labels
Jun 13, 2018
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Jun 14, 2018
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Jun 25, 2018
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Jun 25, 2018
brian-brazil
closed this
in
#4226
Jul 18, 2018
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Aug 14, 2018
jacksontj
added a commit
to jacksontj/prometheus
that referenced
this issue
Aug 14, 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. |
lock
bot
locked and limited conversation to collaborators
Mar 22, 2019
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
jacksontj commentedJun 5, 2018
•
edited
Bug Report
I have an implementation of the storage.Querier interface for my storage, with promql on top. In this setup if a user sends a query for a metric at a single point with an offset of 4w the querier created by promql spans 4w. This makes it difficult (to say the least) to create an efficient querier implementation. presumably similar issues exist inside prom itself (since it would potentially load significantly more data than necessary). I currently have 2 fixes for the issue, either of which I'd be glad to merge upstream-- I'm looking for some input on what fix you'd prefer.
Option 1: multiple queriers
If we don't want to change the querier interface at all we can simply make promql/engine.go create a querier for each offset. This does potentially mean more connections etc. depending on what the querier does under the hood, but does avoid the gross over-scanning of data.
Code: jacksontj@4475e2a
Option 2: add offset to selectParams
If we are okay adding a field to selectParams we can simply pass in the offset there on each actual
Select. This mechanism allows for the querier to be re-used, and then makes it optional for the querier to actually look at the offset. This method would require Queriers to make code changes to pick it up, but it is backwards compatible (meaning if they don't look at the selectParam field, then they just fall back to current behavior).Given the interface etc. I think this is the one we should do.
Code: jacksontj@cb72269
Environment
2.2 (same issue exists in master)