-
Notifications
You must be signed in to change notification settings - Fork 569
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
LabelNames API with matchers #3
Conversation
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.
Could you open a preliminary PR to upgrade Prometheus, Alertmanager and Prometheus common (+ their deps)? It's fine if doesn't include your change yet, but will reduce the review surface, splitting the review effort into smaller subpieces.
@pracucci sure, I was just exploring the changes needed here to adopt my change. I actually find other changes (in alert manager and tsdb constructor) more |
7e4015b
to
fc1b460
Compare
6b2ec46
to
f056488
Compare
@pracucci the only thing pending here is prometheus/prometheus#9083 to be merged, however I don't expect any significant changes there so I would appreciate a first review on this to see if there's something important I'm missing. No rush, obviously, because it's blocked until next week anyway. |
prometheus/prometheus#9083 is merged, once we merge #16 I'll rebase this. |
Merged! Could you rebase, please? |
ae707d5
to
a149798
Compare
Updated Prometheus to latest commit that includes changes in the LabelQuerier.LabelNames method signature: prometheus/prometheus#9083 Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
And fix missing matchers in the call to Distributor Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
a149798
to
f9f5518
Compare
And rebased again since there were new conflicting changes in |
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.
Impeccable job! It's uncommon seeing such good PRs. Well done on tests too. I left few comments I would be glad if you could address: a part from this, LGTM!
pkg/distributor/distributor_test.go
Outdated
expectedResult: []string{labels.MetricName, "status"}, | ||
expectedIngesters: numIngesters, | ||
}, | ||
"should return all matching metrics even if their FastFingerprint collide": { |
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.
This test case comes from TestDistributor_MetricsForLabelMatchers
but actually doesn't test that a fingerprint collision doesn't hide away label names (cause the two series have the same label names). Not sure it's worth spending time to write a better test case for the fingerprint collision, we could probably just get rid of the fingerprint collision test case of LabelNames()
.
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.
Removed the testcase until I find two labels with different names but same fingerprint
Signed-off-by: Oleg Zaytsev <[email protected]>
If multiple matchers didn't work, we wouldn't realize as the result set was the same as for a single matcher. Now the multiple matcher doesn't match the series with status=500 which has a reason=broken label Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
All the StoreGateways (actually, one) are already supporting matchers in the call so we don't need to use a feature flag on this. Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]> Co-authored-by: Marco Pracucci <[email protected]>
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.
Still LGTM with a couple of final nits.
Signed-off-by: Oleg Zaytsev <[email protected]>
Signed-off-by: Oleg Zaytsev <[email protected]>
At least until we find a collision between two different label names. Signed-off-by: Oleg Zaytsev <[email protected]>
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! 🚀
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.
Great work!
I have a question about whether implementation in tenant-federation code is correct though. Please take a look.
Signed-off-by: Oleg Zaytsev <[email protected]>
Since there are three options, IMO, a switch is clearer than if/continue/if/elseif structure. Signed-off-by: Oleg Zaytsev <[email protected]>
0ee4c74
to
8f51e15
Compare
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 for great work and addressing my feedback.
That's a typo, right? Should say |
Oh yes, @bboreham definitely. Will edit the description. |
Signed-off-by: Peter Štibraný <[email protected]> Former-commit-id: 06bbda1
Signed-off-by: Peter Štibraný <[email protected]>
# This is the 1st commit message: Add MaxTotalQueryLength and fill it from MaxQueryLength if 0 Add the ability to define a higher total query length limit on the frontend , compared to the current shared limit between querier and query-frontend. Ref: grafana/mimir-squad#889 Signed-off-by: György Krajcsovits <[email protected]> # Conflicts: # CHANGELOG.md # This is the commit message #2: Update runbook # This is the commit message #3: Update pkg/util/validation/limits.go Co-authored-by: Nick Pillitteri <[email protected]> # This is the commit message #4: Rename store.max-total-query-length to query-frontend... Signed-off-by: György Krajcsovits <[email protected]>
check presence of recording rule data for query window
What this PR does: Implements support for matchers in
LabelQuerier.LabelNames()
as in prometheus/prometheus#9083Which issue(s) this PR fixes:
Fixes cortexproject/cortex#3658
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]