From 6ce555d8ef83db08a4bfaff1fe98754b86de7c34 Mon Sep 17 00:00:00 2001 From: Jacob Baungard Hansen Date: Fri, 19 Jul 2024 12:01:38 +0200 Subject: [PATCH] api/rules: Add filtering on rule name/group/file This commits adds the option of filtering rules by rule name, rule group, or file. This brings the rule API closer in-line with the current Prometheus api. Signed-off-by: Jacob Baungard Hansen --- CHANGELOG.md | 2 + pkg/api/query/v1.go | 6 + pkg/rules/rules.go | 57 ++++++- pkg/rules/rules_test.go | 310 +++++++++++++++++++++++++++++++++++- pkg/rules/rulespb/rpc.pb.go | 282 ++++++++++++++++++++++++-------- pkg/rules/rulespb/rpc.proto | 3 + 6 files changed, 585 insertions(+), 75 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47d1b02056..67d8e8714b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re ### Added +- [#7560](https://github.com/thanos-io/thanos/pull/7560) Query: Added the possibility of filtering rules by rule_name, rule_group or file to HTTP api. + ### Changed - [#7494](https://github.com/thanos-io/thanos/pull/7494) Ruler: remove trailing period from SRV records returned by discovery `dnsnosrva` lookups diff --git a/pkg/api/query/v1.go b/pkg/api/query/v1.go index d8f9366055..b049193a10 100644 --- a/pkg/api/query/v1.go +++ b/pkg/api/query/v1.go @@ -82,6 +82,9 @@ const ( LookbackDeltaParam = "lookback_delta" EngineParam = "engine" QueryAnalyzeParam = "analyze" + RuleNameParam = "rule_name[]" + RuleGroupParam = "rule_group[]" + FileParam = "file[]" ) type PromqlEngineType string @@ -1397,6 +1400,9 @@ func NewRulesHandler(client rules.UnaryClient, enablePartialResponse bool) func( Type: rulespb.RulesRequest_Type(typ), PartialResponseStrategy: ps, MatcherString: r.Form[MatcherParam], + RuleName: r.Form[RuleNameParam], + RuleGroup: r.Form[RuleGroupParam], + File: r.Form[FileParam], } tracing.DoInSpan(ctx, "retrieve_rules", func(ctx context.Context) { groups, warnings, err = client.Rules(ctx, req) diff --git a/pkg/rules/rules.go b/pkg/rules/rules.go index 1777a45181..f0ca699707 100644 --- a/pkg/rules/rules.go +++ b/pkg/rules/rules.go @@ -70,7 +70,9 @@ func (rr *GRPCClient) Rules(ctx context.Context, req *rulespb.RulesRequest) (*ru } } - resp.groups = filterRules(resp.groups, matcherSets) + resp.groups = filterRulesByMatchers(resp.groups, matcherSets) + resp.groups = filterRulesByNamesAndFile(resp.groups, req.RuleName, req.RuleGroup, req.File) + // TODO(bwplotka): Move to SortInterface with equal method and heap. resp.groups = dedupGroups(resp.groups) for _, g := range resp.groups { @@ -80,8 +82,57 @@ func (rr *GRPCClient) Rules(ctx context.Context, req *rulespb.RulesRequest) (*ru return &rulespb.RuleGroups{Groups: resp.groups}, resp.warnings, nil } -// filterRules filters rules in a group according to given matcherSets. -func filterRules(ruleGroups []*rulespb.RuleGroup, matcherSets [][]*labels.Matcher) []*rulespb.RuleGroup { +// filters rules by group name, rule name or file. +func filterRulesByNamesAndFile(ruleGroups []*rulespb.RuleGroup, ruleName []string, ruleGroup []string, file []string) []*rulespb.RuleGroup { + if len(ruleName) == 0 && len(ruleGroup) == 0 && len(file) == 0 { + return ruleGroups + } + + queryFormToSet := func(values []string) map[string]struct{} { + set := make(map[string]struct{}, len(values)) + for _, v := range values { + set[v] = struct{}{} + } + return set + } + + rnSet := queryFormToSet(ruleName) + rgSet := queryFormToSet(ruleGroup) + fSet := queryFormToSet(file) + + rgs := make([]*rulespb.RuleGroup, 0, len(ruleGroups)) + for _, grp := range ruleGroups { + if len(rgSet) > 0 { + if _, ok := rgSet[grp.Name]; !ok { + continue + } + } + + if len(fSet) > 0 { + if _, ok := fSet[grp.File]; !ok { + continue + } + } + + if len(rnSet) > 0 { + ruleCount := 0 + for _, r := range grp.Rules { + if _, ok := rnSet[r.GetName()]; ok { + grp.Rules[ruleCount] = r + ruleCount++ + } + } + grp.Rules = grp.Rules[:ruleCount] + } + if len(grp.Rules) > 0 { + rgs = append(rgs, grp) + } + } + return rgs +} + +// filterRulesbyMatchers filters rules in a group according to given matcherSets. +func filterRulesByMatchers(ruleGroups []*rulespb.RuleGroup, matcherSets [][]*labels.Matcher) []*rulespb.RuleGroup { if len(matcherSets) == 0 { return ruleGroups } diff --git a/pkg/rules/rules_test.go b/pkg/rules/rules_test.go index 921d4b7cc5..e62566a8a7 100644 --- a/pkg/rules/rules_test.go +++ b/pkg/rules/rules_test.go @@ -958,9 +958,12 @@ func TestDedupGroups(t *testing.T) { func TestFilterRules(t *testing.T) { for _, tc := range []struct { - name string - matcherSets [][]*labels.Matcher - groups, want []*rulespb.RuleGroup + name string + ruleNameFilter []string + ruleGroupFilter []string + fileFilter []string + matcherSets [][]*labels.Matcher + groups, want []*rulespb.RuleGroup }{ { name: "no groups", @@ -1383,9 +1386,308 @@ func TestFilterRules(t *testing.T) { }, }, }, + { + name: "single group with rule name filter", + ruleNameFilter: []string{"a1"}, + groups: []*rulespb.RuleGroup{ + { + Name: "a", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "replica", Value: "1"}, + {Name: "label", Value: "foo"}, + }}, + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "label", Value: "foo"}, + }}, + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "otherlabel", Value: "bar"}, + }}, + }), + }, + }, + }, + want: []*rulespb.RuleGroup{ + { + Name: "a", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "replica", Value: "1"}, + {Name: "label", Value: "foo"}, + }}, + }), + }, + }, + }, + }, + { + name: "two groups with group name filter", + ruleGroupFilter: []string{"group1"}, + groups: []*rulespb.RuleGroup{ + { + Name: "group1", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + { + Name: "group2", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + want: []*rulespb.RuleGroup{ + { + Name: "group1", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + }, + }, + { + name: "two groups with group file filter", + fileFilter: []string{"group2.yml"}, + groups: []*rulespb.RuleGroup{ + { + Name: "group1", + File: "group1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + { + Name: "group2", + File: "group2.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + want: []*rulespb.RuleGroup{ + { + Name: "group2", + File: "group2.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + }, + { + name: "one group match multiple rules", + ruleNameFilter: []string{"r1", "r2"}, + groups: []*rulespb.RuleGroup{ + { + Name: "group1", + File: "group1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + { + Name: "group2", + File: "group2.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + want: []*rulespb.RuleGroup{ + { + Name: "group1", + File: "group1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + }, + }, + { + name: "two groups with group file filter (no match)", + fileFilter: []string{"nomatch.yml"}, + groups: []*rulespb.RuleGroup{ + { + Name: "group1", + File: "group1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + { + Name: "group2", + File: "group2.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + want: []*rulespb.RuleGroup{}, + }, + { + name: "two groups with filter on group name, file and rulename", + ruleNameFilter: []string{"a1"}, + ruleGroupFilter: []string{"group1"}, + fileFilter: []string{"file1.yml"}, + groups: []*rulespb.RuleGroup{ + { + Name: "group1", + File: "file1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", + }), + }, + }, + { + Name: "group2", + File: "file1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + { + Name: "group3", + File: "file2.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + want: []*rulespb.RuleGroup{ + { + Name: "group1", + File: "file1.yml", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + }), + }, + }, + }, + }, + { + name: "single group with labeled rules, matcher and rule name filter", + matcherSets: [][]*labels.Matcher{{&labels.Matcher{Name: "label", Value: "foo", Type: labels.MatchEqual}}}, + ruleNameFilter: []string{"a1"}, + groups: []*rulespb.RuleGroup{ + { + Name: "a", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "replica", Value: "1"}, + {Name: "label", Value: "foo"}, + }}, + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r1", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "label", Value: "foo"}, + }}, + }), + rulespb.NewRecordingRule(&rulespb.RecordingRule{ + Name: "r2", Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "otherlabel", Value: "bar"}, + }}, + }), + }, + }, + }, + want: []*rulespb.RuleGroup{ + { + Name: "a", + Rules: []*rulespb.Rule{ + rulespb.NewAlertingRule(&rulespb.Alert{ + Name: "a1", + Labels: labelpb.ZLabelSet{Labels: []labelpb.ZLabel{ + {Name: "replica", Value: "1"}, + {Name: "label", Value: "foo"}, + }}, + }), + }, + }, + }, + }, } { t.Run(tc.name, func(t *testing.T) { - testutil.Equals(t, tc.want, filterRules(tc.groups, tc.matcherSets)) + groups := filterRulesByMatchers(tc.groups, tc.matcherSets) + groups = filterRulesByNamesAndFile(groups, tc.ruleNameFilter, tc.ruleGroupFilter, tc.fileFilter) + testutil.Equals(t, tc.want, groups) }) } } diff --git a/pkg/rules/rulespb/rpc.pb.go b/pkg/rules/rulespb/rpc.pb.go index 941014a06a..298ce03063 100644 --- a/pkg/rules/rulespb/rpc.pb.go +++ b/pkg/rules/rulespb/rpc.pb.go @@ -109,6 +109,9 @@ type RulesRequest struct { Type RulesRequest_Type `protobuf:"varint,1,opt,name=type,proto3,enum=thanos.RulesRequest_Type" json:"type,omitempty"` PartialResponseStrategy storepb.PartialResponseStrategy `protobuf:"varint,2,opt,name=partial_response_strategy,json=partialResponseStrategy,proto3,enum=thanos.PartialResponseStrategy" json:"partial_response_strategy,omitempty"` MatcherString []string `protobuf:"bytes,3,rep,name=matcher_string,json=matcherString,proto3" json:"matcher_string,omitempty"` + RuleName []string `protobuf:"bytes,4,rep,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` + RuleGroup []string `protobuf:"bytes,5,rep,name=rule_group,json=ruleGroup,proto3" json:"rule_group,omitempty"` + File []string `protobuf:"bytes,6,rep,name=file,proto3" json:"file,omitempty"` } func (m *RulesRequest) Reset() { *m = RulesRequest{} } @@ -554,74 +557,76 @@ func init() { func init() { proto.RegisterFile("rules/rulespb/rpc.proto", fileDescriptor_91b1d28f30eb5efb) } var fileDescriptor_91b1d28f30eb5efb = []byte{ - // 1058 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x4e, 0x23, 0xc7, - 0x13, 0xf7, 0x60, 0xcf, 0xd8, 0x53, 0xc6, 0x2c, 0xdb, 0x0b, 0x62, 0x60, 0xff, 0xf2, 0x20, 0x4b, - 0xfc, 0x45, 0xa2, 0xac, 0x1d, 0x81, 0x76, 0xa3, 0x3d, 0x45, 0x98, 0x8f, 0x05, 0x09, 0x91, 0x55, - 0x1b, 0xe5, 0xb0, 0x39, 0x38, 0x8d, 0x69, 0xcc, 0x28, 0xe3, 0x99, 0xd9, 0xee, 0x36, 0x11, 0x6f, - 0xb1, 0xe7, 0xbc, 0x48, 0x5e, 0x81, 0x5b, 0xf6, 0x98, 0x93, 0x93, 0xc0, 0x29, 0x3e, 0xe4, 0x19, - 0xa2, 0xae, 0x9e, 0xb1, 0x0d, 0x81, 0xb0, 0x9b, 0x90, 0xcb, 0x54, 0x77, 0xd5, 0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d4, 0x7d, 0x6e, 0x35, 0x57, - 0x2e, 0x7e, 0xab, 0xe6, 0x2e, 0x2e, 0xab, 0xd6, 0xfb, 0xcb, 0xaa, 0xf5, 0xeb, 0x65, 0xd5, 0x7a, - 0x77, 0x55, 0xcd, 0xbd, 0xbf, 0xaa, 0xe6, 0x7e, 0xbe, 0xaa, 0xe6, 0xde, 0x14, 0xd3, 0x1f, 0xe7, - 0x23, 0x07, 0x93, 0x5b, 0xff, 0x33, 0x00, 0x00, 0xff, 0xff, 0xeb, 0xed, 0x6d, 0x27, 0x50, 0x0b, - 0x00, 0x00, + // 1096 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x4e, 0x23, 0x47, + 0x10, 0xf6, 0xd8, 0x9e, 0xb1, 0xa7, 0x8c, 0x59, 0xb6, 0x17, 0xc4, 0x00, 0x89, 0x07, 0x59, 0x22, + 0x22, 0x51, 0xd6, 0x8e, 0x40, 0xbb, 0xd1, 0x9e, 0x22, 0xcc, 0xcf, 0x82, 0x84, 0xc8, 0xaa, 0x8d, + 0x72, 0xd8, 0x1c, 0x9c, 0xc6, 0x34, 0x66, 0x94, 0xf1, 0xcc, 0x6c, 0x4f, 0x9b, 0x88, 0xb7, 0xd8, + 0x73, 0x5e, 0x24, 0xca, 0x1b, 0x70, 0xcb, 0x1e, 0x73, 0x72, 0x12, 0xb8, 0xf9, 0x90, 0x67, 0x88, + 0xba, 0x7a, 0xc6, 0x63, 0x08, 0x84, 0xdd, 0x84, 0x5c, 0xdc, 0xdd, 0x5f, 0x7d, 0xd5, 0x3f, 0x55, + 0x5f, 0x95, 0x07, 0xe6, 0xc5, 0xc0, 0xe7, 0x71, 0x13, 0x7f, 0xa3, 0xa3, 0xa6, 0x88, 0xba, 0x8d, + 0x48, 0x84, 0x32, 0x24, 0x96, 0x3c, 0x65, 0x41, 0x18, 0x2f, 0x2e, 0xc4,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 0x56, 0xf7, 0x85, 0xd1, 0x5a, 0xb9, 0xf8, 0xa3, 0x96, 0xbb, 0xb8, 0xac, 0x19, 0xef, 0x2e, 0x6b, + 0xc6, 0xef, 0x97, 0x35, 0xe3, 0xed, 0x55, 0x2d, 0xf7, 0xee, 0xaa, 0x96, 0xfb, 0xf5, 0xaa, 0x96, + 0x7b, 0x5d, 0x4a, 0x3e, 0xc4, 0x8f, 0x2c, 0x7c, 0xdc, 0xfa, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xa0, 0xc1, 0xf7, 0x10, 0xa0, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -755,6 +760,33 @@ func (m *RulesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.File) > 0 { + for iNdEx := len(m.File) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.File[iNdEx]) + copy(dAtA[i:], m.File[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.File[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.RuleGroup) > 0 { + for iNdEx := len(m.RuleGroup) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RuleGroup[iNdEx]) + copy(dAtA[i:], m.RuleGroup[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RuleGroup[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.RuleName) > 0 { + for iNdEx := len(m.RuleName) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RuleName[iNdEx]) + copy(dAtA[i:], m.RuleName[iNdEx]) + i = encodeVarintRpc(dAtA, i, uint64(len(m.RuleName[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } if len(m.MatcherString) > 0 { for iNdEx := len(m.MatcherString) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.MatcherString[iNdEx]) @@ -1326,6 +1358,24 @@ func (m *RulesRequest) Size() (n int) { n += 1 + l + sovRpc(uint64(l)) } } + if len(m.RuleName) > 0 { + for _, s := range m.RuleName { + l = len(s) + n += 1 + l + sovRpc(uint64(l)) + } + } + if len(m.RuleGroup) > 0 { + for _, s := range m.RuleGroup { + l = len(s) + n += 1 + l + sovRpc(uint64(l)) + } + } + if len(m.File) > 0 { + for _, s := range m.File { + l = len(s) + n += 1 + l + sovRpc(uint64(l)) + } + } return n } @@ -1664,6 +1714,102 @@ func (m *RulesRequest) Unmarshal(dAtA []byte) error { } m.MatcherString = append(m.MatcherString, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuleName = append(m.RuleName, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RuleGroup", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RuleGroup = append(m.RuleGroup, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field File", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRpc + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthRpc + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRpc + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.File = append(m.File, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRpc(dAtA[iNdEx:]) diff --git a/pkg/rules/rulespb/rpc.proto b/pkg/rules/rulespb/rpc.proto index 25d809ede9..f5fc8a038b 100644 --- a/pkg/rules/rulespb/rpc.proto +++ b/pkg/rules/rulespb/rpc.proto @@ -41,6 +41,9 @@ message RulesRequest { Type type = 1; PartialResponseStrategy partial_response_strategy = 2; repeated string matcher_string = 3; + repeated string rule_name = 4; + repeated string rule_group = 5; + repeated string file = 6; } message RulesResponse {