Update prometheus for subqueries support in ruler.#1790
Merged
Conversation
f32ea62 to
3315216
Compare
…f0fee9fc0) for subqueries support in ruler. Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
3315216 to
3ec04d7
Compare
squat
approved these changes
Nov 26, 2019
Member
squat
left a comment
There was a problem hiding this comment.
Looks good! I have some questions, but maybe it’s nothing
|
|
||
| case storepb.LabelMatcher_RE: | ||
| return labels.NewRegexpMatcher(m.Name, "^(?:"+m.Value+")$") | ||
| return labels.NewMatcher(labels.MatchRegexp, m.Name, m.Value) |
Member
There was a problem hiding this comment.
We don’t need the regular expression here anymore?
Member
Author
There was a problem hiding this comment.
We do not need as this is done already in NewMatcher:
// NewMatcher returns a matcher object.
func NewMatcher(t MatchType, n, v string) (*Matcher, error) {
m := &Matcher{
Type: t,
Name: n,
Value: v,
}
if t == MatchRegexp || t == MatchNotRegexp {
re, err := regexp.Compile("^(?:" + v + ")$")
if err != nil {
return nil, err
}
m.re = re
}
return m, nil
}(:
| return nil, err | ||
| } | ||
| return labels.Not(m), nil | ||
| return labels.NewMatcher(labels.MatchNotRegexp, m.Name, m.Value) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1779
cc @bjakubski @simonpasquier