-
Notifications
You must be signed in to change notification settings - Fork 820
Update Prometheus; add matchers parameter to LabelValues on ingester #3806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
22e082c
to
fab788f
Compare
I would suggest to keep |
That sounds better indeed, I'll do that, thx |
2e29442
to
e2c88e7
Compare
@pstibrany i updated it, thanks for the suggestion |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is unfortunate that NewAPI takes Storage
, which requires us to implement extra methods. I've sent PR prometheus/prometheus#8488 to Prometheus to be able to pass queryable and appendable separately. If it is merged quickly, then I'm fine with taking shortcuts in this PR and just implement bare-minimum (as it is now). However, if prometheus/prometheus#8488 isn't merged, then we should implement "errAppender" to return errors, as current implementation of readOnlyStorage.Appender()
returning nil
may cause panics. It's also not clear what we should be returning in StartTime
, although API
doesn't use this method currently.
Apart from that, this PR looks good.
I will merge it on the other side :) |
Since Prometheus PR 8488 is now merged, let's update Prometheus in this PR. |
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
ee9091f
to
c8e814f
Compare
Thx for that Prometheus change @pstibrany . I have update Prometheus in this branch again, and I also rebased onto the latest master. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
@@ -870,7 +871,8 @@ func createLabelNamesRequest(minT, maxT int64, blockIDs []ulid.ULID) (*storepb.L | |||
return req, nil | |||
} | |||
|
|||
func createLabelValuesRequest(minT, maxT int64, label string, blockIDs []ulid.ULID) (*storepb.LabelValuesRequest, error) { | |||
func createLabelValuesRequest(minT, maxT int64, label string, blockIDs []ulid.ULID, matchers ...*labels.Matcher) (*storepb.LabelValuesRequest, error) { | |||
// TODO(replay): add matchers to LabelValuesRequest once it has that property |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, considering the store-gateway doesn't support it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job, thank you!
Co-authored-by: Marco Pracucci <marco@pracucci.com> Signed-off-by: Mauro Stettler <mauro.stettler@gmail.com>
8508261
to
d560d33
Compare
This PR updates the Prometheus version vendored in Cortex to the latest version.
With the new Prometheus version the
LabelValues()
call on theQuerier
interface now has an additionalmatchers
parameter (introduced here).Unfortunately we won't be able to directly take advantage of this new parameter here, because in order to use it this struct which gets imported from Thanos will also need to be updated:
cortex/vendor/github.com/thanos-io/thanos/pkg/store/storepb/rpc.pb.go
Line 503 in d385f47
We also can't update the Prometheus version in Thanos first, because Thanos imports Querier implementations from Cortex, so if we'd update Prometheus in Thanos before updating it in Cortex then the imported Querier implementations wouldn't match the interface defined in Prometheus anymore.
My plan to solve this is to first update the Prometheus version in Cortex, without taking advantage of that new parameter in the
LabelValues()
call. Then update the Prometheus and the Cortex versions in Thanos. Then make another PR to Cortex which takes advantage of that new parameter.The main thing I'm uncertain about here is how to deal with the fact that
v1.NewAPI
(here) now requires the second argument to be astorage.Storage
, previously it was astorage.SampleAndChunkQueryable
. Since the last argument that we pass intov1.NewAPI()
(here) is now hard-coded tofalse
I think it is acceptable to simply add the required methods toerrorTranslateQueryable
without implementing them, knowing that they will never be called, but I'd definitely be open to suggestions about how to do that in a better way.