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 up`storage.Querier` interface not fitting for remote implementations #3220
Comments
juliusv
added
component/local storage
dev-2.0
labels
Sep 25, 2017
This comment has been minimized.
This comment has been minimized.
brian-brazil
added
the
priority/Pmaybe
label
Sep 28, 2017
This comment has been minimized.
This comment has been minimized.
|
I think it's the right interface for the domain problem it is trying to solve. It can obviously be unfitting in the case you are describing though. Just extending/mutating the core interface seems wrong. I would push this out into the instantiation of the What would need to be adapted then is the API package so that it doesn't take a full storage as a dependency but just the most basic methods to retrieve the relevant data. The amount of fan-in of entire components into the web handler is way to much anyway. |
This comment has been minimized.
This comment has been minimized.
|
Sounds good as well. Even better, So I'll take that approach. Thanks! |
juliusv
closed this
Oct 2, 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. |
juliusv commentedSep 25, 2017
The
storage.Querierdefinition at:https://github.com/prometheus/prometheus/blob/dev-2.0/storage/interface.go#L43-L53
...is not great for remote querier implementations. Remote querier implementations will want to eager-load all series data upon
Select(), but some uses ofSelect()are only interested in the series metadata (such as/api/v1/series). In that case, eager-loading all the sample data would be very wasteful. Those users would need a way to tell the querier their future intentions or have a separate interface method that only provides metadata.The concrete use case where this is hitting me right now is porting Cortex to Prometheus 2.0 packages. We reuse the Prometheus
api/v1package there to give us the Prometheus web API, but the API cannot tell the querier that we pass in whether it will only want to load series metadata or full sample data.Would adding a separate method to
storage.Querierfor explicit metadata-only selection make sense? Or some other form of parametrization inSelect()?