From 1995928e8b3afb4d71f8850099db6c2874d22d5d Mon Sep 17 00:00:00 2001 From: fayzal-g Date: Thu, 5 Sep 2024 13:58:03 +0100 Subject: [PATCH 1/4] new proto --- .../mimir-read-write-mode/config/mimir.yaml | 1 + .../docker-compose.jsonnet | 6 +- .../mimir-read-write-mode/docker-compose.yml | 30 +-- pkg/ruler/ruler.pb.go | 196 +++++++++++++----- pkg/ruler/ruler.proto | 2 + 5 files changed, 146 insertions(+), 89 deletions(-) diff --git a/development/mimir-read-write-mode/config/mimir.yaml b/development/mimir-read-write-mode/config/mimir.yaml index 0e5e0b1a442..37c9b9d5b11 100644 --- a/development/mimir-read-write-mode/config/mimir.yaml +++ b/development/mimir-read-write-mode/config/mimir.yaml @@ -56,6 +56,7 @@ alertmanager: data_dir: /data/alertmanager fallback_config_file: ./config/alertmanager-fallback-config.yaml external_url: http://localhost:8006/alertmanager + grafana_alertmanager_compatibility_enabled: true alertmanager_storage: s3: diff --git a/development/mimir-read-write-mode/docker-compose.jsonnet b/development/mimir-read-write-mode/docker-compose.jsonnet index efe33445083..bfa34828139 100644 --- a/development/mimir-read-write-mode/docker-compose.jsonnet +++ b/development/mimir-read-write-mode/docker-compose.jsonnet @@ -6,10 +6,10 @@ std.manifestYamlDoc({ self.backend + self.nginx + self.minio + - self.grafana + - self.grafana_agent + + //self.grafana + + //self.grafana_agent + self.memcached + - self.prometheus + + //self.prometheus + {}, write:: { diff --git a/development/mimir-read-write-mode/docker-compose.yml b/development/mimir-read-write-mode/docker-compose.yml index 08d31a521ca..694b40bf2df 100644 --- a/development/mimir-read-write-mode/docker-compose.yml +++ b/development/mimir-read-write-mode/docker-compose.yml @@ -1,23 +1,4 @@ "services": - "grafana": - "environment": - - "GF_AUTH_ANONYMOUS_ENABLED=true" - - "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin" - "image": "grafana/grafana:10.4.3" - "ports": - - "3000:3000" - "volumes": - - "./config/datasource-mimir.yaml:/etc/grafana/provisioning/datasources/mimir.yaml" - "grafana-agent": - "command": - - "-config.file=/etc/agent-config/grafana-agent.yaml" - - "-metrics.wal-directory=/tmp" - - "-server.http.address=127.0.0.1:9091" - "image": "grafana/agent:v0.37.3" - "ports": - - "9091:9091" - "volumes": - - "./config:/etc/agent-config" "memcached": "image": "memcached:1.6.19-alpine" "mimir-backend-1": @@ -185,13 +166,4 @@ - "8080:8080" "volumes": - "../common/config:/etc/nginx/templates" - "prometheus": - "command": - - "--config.file=/etc/prometheus/prometheus.yaml" - - "--enable-feature=exemplar-storage" - - "--enable-feature=native-histograms" - "image": "prom/prometheus:v2.53.0" - "ports": - - "9090:9090" - "volumes": - - "./config:/etc/prometheus" +"version": "3.4" diff --git a/pkg/ruler/ruler.pb.go b/pkg/ruler/ruler.pb.go index a2bd34ada74..bac9a0bf829 100644 --- a/pkg/ruler/ruler.pb.go +++ b/pkg/ruler/ruler.pb.go @@ -68,6 +68,8 @@ type RulesRequest struct { RuleName []string `protobuf:"bytes,2,rep,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` RuleGroup []string `protobuf:"bytes,3,rep,name=rule_group,json=ruleGroup,proto3" json:"rule_group,omitempty"` File []string `protobuf:"bytes,4,rep,name=file,proto3" json:"file,omitempty"` + MaxGroups uint64 `protobuf:"varint,5,opt,name=max_groups,json=maxGroups,proto3" json:"max_groups,omitempty"` + NextToken uint64 `protobuf:"varint,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` } func (m *RulesRequest) Reset() { *m = RulesRequest{} } @@ -130,6 +132,20 @@ func (m *RulesRequest) GetFile() []string { return nil } +func (m *RulesRequest) GetMaxGroups() uint64 { + if m != nil { + return m.MaxGroups + } + return 0 +} + +func (m *RulesRequest) GetNextToken() uint64 { + if m != nil { + return m.NextToken + } + return 0 +} + type RulesResponse struct { Groups []*GroupStateDesc `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` } @@ -529,62 +545,64 @@ func init() { func init() { proto.RegisterFile("ruler.proto", fileDescriptor_9ecbec0a4cfddea6) } var fileDescriptor_9ecbec0a4cfddea6 = []byte{ - // 871 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xde, 0x71, 0xe2, 0x1f, 0xfb, 0x9c, 0xa6, 0xc9, 0x24, 0xc0, 0xd6, 0x94, 0x4d, 0x64, 0x2e, - 0x11, 0x52, 0xd6, 0x60, 0x22, 0x10, 0x12, 0x02, 0x1c, 0xb5, 0x45, 0x48, 0x08, 0x55, 0xeb, 0xc2, - 0xd5, 0x1a, 0xdb, 0xe3, 0xcd, 0xa8, 0xeb, 0xdd, 0x65, 0x66, 0xd6, 0x22, 0x27, 0xf8, 0x13, 0x7a, - 0xe4, 0xcc, 0x89, 0xbf, 0x83, 0x53, 0x8f, 0x11, 0xa7, 0x0a, 0xa1, 0x42, 0x9c, 0x0b, 0xc7, 0xfe, - 0x09, 0x68, 0xde, 0xec, 0xd6, 0x76, 0x1b, 0x10, 0x16, 0x70, 0x89, 0xe7, 0xcd, 0xfb, 0xbe, 0xef, - 0xcd, 0xfb, 0xe6, 0xed, 0x04, 0x9a, 0x32, 0x8f, 0xb9, 0x0c, 0x32, 0x99, 0xea, 0x94, 0x56, 0x31, - 0x68, 0x1d, 0x47, 0x42, 0x9f, 0xe5, 0xc3, 0x60, 0x94, 0x4e, 0x3b, 0x51, 0x1a, 0xa5, 0x1d, 0xcc, - 0x0e, 0xf3, 0x09, 0x46, 0x18, 0xe0, 0xca, 0xb2, 0x5a, 0x7e, 0x94, 0xa6, 0x51, 0xcc, 0x17, 0xa8, - 0x71, 0x2e, 0x99, 0x16, 0x69, 0x52, 0xe4, 0x0f, 0x5e, 0xcc, 0x6b, 0x31, 0xe5, 0x4a, 0xb3, 0x69, - 0x56, 0x00, 0xde, 0x5e, 0xae, 0x27, 0xd9, 0x84, 0x25, 0xac, 0x33, 0x15,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, 0xfb, 0x3c, 0xd1, 0xf6, - 0x38, 0x33, 0x16, 0x8b, 0xf1, 0x20, 0x4f, 0xb4, 0x88, 0x3d, 0x77, 0x1d, 0x19, 0x24, 0x7e, 0x69, - 0x78, 0xf4, 0x3e, 0xec, 0x3e, 0xe4, 0x3c, 0x1b, 0x4c, 0x84, 0x14, 0x49, 0x34, 0x50, 0x22, 0x19, - 0x71, 0x0f, 0xd6, 0x10, 0xbb, 0x69, 0xe8, 0xf7, 0x90, 0xdd, 0x37, 0xe4, 0xee, 0xb7, 0x50, 0x35, - 0x9f, 0xbf, 0xa4, 0x27, 0x76, 0xa1, 0xe8, 0xde, 0x35, 0xff, 0x92, 0x5a, 0xfb, 0xab, 0x9b, 0xc5, - 0x2b, 0xec, 0xd0, 0x4f, 0xc0, 0x7d, 0xfe, 0x38, 0xd3, 0xd7, 0x0a, 0xd0, 0x8b, 0xaf, 0x7b, 0xcb, - 0x7b, 0x39, 0x51, 0x2a, 0x9c, 0x9e, 0x5c, 0x5c, 0xfa, 0xce, 0x93, 0x4b, 0xdf, 0x79, 0x76, 0xe9, - 0x93, 0xef, 0xe6, 0x3e, 0xf9, 0x71, 0xee, 0x93, 0xc7, 0x73, 0x9f, 0x5c, 0xcc, 0x7d, 0xf2, 0xfb, - 0xdc, 0x27, 0x7f, 0xcc, 0x7d, 0xe7, 0xd9, 0xdc, 0x27, 0x8f, 0xae, 0x7c, 0xe7, 0xe2, 0xca, 0x77, - 0x9e, 0x5c, 0xf9, 0xce, 0xb0, 0x86, 0x5d, 0xbe, 0xfb, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3c, - 0xcd, 0xed, 0x61, 0x4f, 0x08, 0x00, 0x00, + // 901 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xdf, 0x75, 0xfc, 0x6f, 0x9f, 0x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f7, 0xa0, 0x99, 0x4b, 0x26, 0x86, 0x7c, 0x62, 0x44, 0x9c, 0xa0, 0xa1, + 0xed, 0xaf, 0x26, 0xb2, 0xbb, 0x09, 0x1b, 0x0b, 0x70, 0x73, 0x65, 0xf7, 0xe7, 0x0a, 0xac, 0x5d, + 0x97, 0x27, 0xef, 0x41, 0xcd, 0x34, 0x50, 0xcf, 0xa5, 0xb5, 0xb7, 0xe5, 0x9b, 0x31, 0x06, 0x65, + 0x1f, 0x31, 0x07, 0x03, 0x21, 0x1f, 0xc3, 0x2a, 0x1d, 0x2b, 0x7e, 0xc2, 0x86, 0x08, 0xc2, 0x89, + 0x94, 0x14, 0x33, 0xca, 0x79, 0xda, 0x2d, 0x83, 0xc4, 0xfb, 0xc9, 0x77, 0xb0, 0xc9, 0x4e, 0x68, + 0x94, 0xe3, 0xb6, 0x1e, 0x96, 0x5b, 0xe9, 0xae, 0xe0, 0x95, 0x6d, 0xdf, 0xec, 0xad, 0x5f, 0xee, + 0xad, 0xff, 0x02, 0x71, 0xd0, 0x7c, 0xf2, 0x6c, 0xdb, 0x3a, 0xff, 0x63, 0xdb, 0x0e, 0x6e, 0x12, + 0x20, 0x03, 0x20, 0x73, 0xf7, 0x83, 0xe2, 0x6b, 0x70, 0xab, 0x28, 0x7b, 0xef, 0x15, 0xd9, 0x12, + 0x60, 0x54, 0x7f, 0xd2, 0xaa, 0x37, 0xd0, 0xbb, 0xbf, 0x57, 0xcc, 0xa4, 0xe6, 0x3d, 0x7a, 0x17, + 0xaa, 0xba, 0xc4, 0xa2, 0x45, 0x77, 0x17, 0x5a, 0x84, 0xa5, 0x62, 0x90, 0x6c, 0x41, 0x4d, 0x6a, + 0x86, 0x5b, 0xe9, 0xd8, 0x3d, 0x27, 0x30, 0x06, 0x79, 0x13, 0xea, 0x47, 0x8c, 0x46, 0xea, 0x08, + 0x8b, 0x75, 0x82, 0xc2, 0x22, 0xf7, 0xc1, 0x89, 0xa8, 0x54, 0x0f, 0x85, 0x48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0x93, 0x61, 0x9e, 0x28, 0x1e, 0xb9, 0xce, 0x32, 0x32, 0x48, 0xfc, 0x56, 0xf3, 0xc8, + 0x63, 0xd8, 0x38, 0x66, 0x2c, 0x1b, 0x4e, 0xb9, 0xe0, 0x49, 0x38, 0x94, 0x3c, 0x19, 0x33, 0x17, + 0x96, 0x10, 0xbb, 0xab, 0xe9, 0x8f, 0x90, 0x3d, 0xd0, 0xe4, 0xbd, 0x1f, 0xa0, 0xa6, 0x3f, 0x7f, + 0x41, 0xf6, 0xcd, 0x41, 0x92, 0xcd, 0x1b, 0xfe, 0xa1, 0xb5, 0xb7, 0xae, 0x3b, 0x8b, 0x57, 0xd8, + 0x22, 0x5f, 0x80, 0xf3, 0xe2, 0x71, 0x26, 0x6f, 0x15, 0xa0, 0x97, 0x5f, 0xf7, 0xb6, 0xfb, 0x6a, + 0xa0, 0x54, 0x38, 0xd8, 0xbf, 0xb8, 0xf4, 0xac, 0xa7, 0x97, 0x9e, 0xf5, 0xfc, 0xd2, 0xb3, 0x7f, + 0x9c, 0x79, 0xf6, 0x2f, 0x33, 0xcf, 0x7e, 0x32, 0xf3, 0xec, 0x8b, 0x99, 0x67, 0xff, 0x39, 0xf3, + 0xec, 0xbf, 0x66, 0x9e, 0xf5, 0x7c, 0xe6, 0xd9, 0xe7, 0x57, 0x9e, 0x75, 0x71, 0xe5, 0x59, 0x4f, + 0xaf, 0x3c, 0x6b, 0x54, 0xc7, 0x2a, 0x3f, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x78, 0x6a, 0x0b, + 0x2c, 0x8d, 0x08, 0x00, 0x00, } func (x RulesRequest_RuleType) String() string { @@ -640,6 +658,12 @@ func (this *RulesRequest) Equal(that interface{}) bool { return false } } + if this.MaxGroups != that1.MaxGroups { + return false + } + if this.NextToken != that1.NextToken { + return false + } return true } func (this *RulesResponse) Equal(that interface{}) bool { @@ -871,12 +895,14 @@ func (this *RulesRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) + s := make([]string, 0, 10) s = append(s, "&ruler.RulesRequest{") s = append(s, "Filter: "+fmt.Sprintf("%#v", this.Filter)+",\n") s = append(s, "RuleName: "+fmt.Sprintf("%#v", this.RuleName)+",\n") s = append(s, "RuleGroup: "+fmt.Sprintf("%#v", this.RuleGroup)+",\n") s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n") + s = append(s, "MaxGroups: "+fmt.Sprintf("%#v", this.MaxGroups)+",\n") + s = append(s, "NextToken: "+fmt.Sprintf("%#v", this.NextToken)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -1116,6 +1142,16 @@ func (m *RulesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.NextToken != 0 { + i = encodeVarintRuler(dAtA, i, uint64(m.NextToken)) + i-- + dAtA[i] = 0x30 + } + if m.MaxGroups != 0 { + i = encodeVarintRuler(dAtA, i, uint64(m.MaxGroups)) + i-- + dAtA[i] = 0x28 + } if len(m.File) > 0 { for iNdEx := len(m.File) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.File[iNdEx]) @@ -1544,6 +1580,12 @@ func (m *RulesRequest) Size() (n int) { n += 1 + l + sovRuler(uint64(l)) } } + if m.MaxGroups != 0 { + n += 1 + sovRuler(uint64(m.MaxGroups)) + } + if m.NextToken != 0 { + n += 1 + sovRuler(uint64(m.NextToken)) + } return n } @@ -1699,6 +1741,8 @@ func (this *RulesRequest) String() string { `RuleName:` + fmt.Sprintf("%v", this.RuleName) + `,`, `RuleGroup:` + fmt.Sprintf("%v", this.RuleGroup) + `,`, `File:` + fmt.Sprintf("%v", this.File) + `,`, + `MaxGroups:` + fmt.Sprintf("%v", this.MaxGroups) + `,`, + `NextToken:` + fmt.Sprintf("%v", this.NextToken) + `,`, `}`, }, "") return s @@ -1947,6 +1991,44 @@ func (m *RulesRequest) Unmarshal(dAtA []byte) error { } m.File = append(m.File, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxGroups", wireType) + } + m.MaxGroups = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxGroups |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NextToken", wireType) + } + m.NextToken = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRuler + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NextToken |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipRuler(dAtA[iNdEx:]) diff --git a/pkg/ruler/ruler.proto b/pkg/ruler/ruler.proto index 15855e3d84c..0fb8dbb82a2 100644 --- a/pkg/ruler/ruler.proto +++ b/pkg/ruler/ruler.proto @@ -37,6 +37,8 @@ message RulesRequest { repeated string rule_name = 2; repeated string rule_group = 3; repeated string file = 4; + uint64 max_groups = 5; + uint64 next_token = 6; } message RulesResponse { From be05b32c828046a1b801ff04d37bbd5a80674a73 Mon Sep 17 00:00:00 2001 From: fayzal-g Date: Wed, 11 Sep 2024 17:07:04 +0100 Subject: [PATCH 2/4] Pagination on rule groups and tests --- pkg/ruler/api.go | 44 ++++++++-- pkg/ruler/api_test.go | 130 ++++++++++++++++++++++++++++ pkg/ruler/ruler.pb.go | 196 ++++++++++++------------------------------ pkg/ruler/ruler.proto | 2 - 4 files changed, 223 insertions(+), 149 deletions(-) diff --git a/pkg/ruler/api.go b/pkg/ruler/api.go index fa4a1677ff9..450b3036c29 100644 --- a/pkg/ruler/api.go +++ b/pkg/ruler/api.go @@ -6,16 +6,17 @@ package ruler import ( + "encoding/hex" "encoding/json" "fmt" "io" "net/http" "net/url" - "sort" "strconv" "strings" "time" + "github.com/cespare/xxhash/v2" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/gorilla/mux" @@ -64,6 +65,7 @@ type Alert struct { // RuleDiscovery has info for all rules type RuleDiscovery struct { RuleGroups []*RuleGroup `json:"groups"` + NextToken string `json:"nextToken,omitempty"` } // RuleGroup has info for rules which are part of a group @@ -166,6 +168,16 @@ func (a *API) PrometheusRules(w http.ResponseWriter, req *http.Request) { return } + nextToken := req.URL.Query().Get("next_token") + var maxGroups int + if maxGroupsVal := req.URL.Query().Get("max_groups"); maxGroupsVal != "" { + maxGroups, err = strconv.Atoi(maxGroupsVal) + if err != nil || maxGroups < 0 { + respondInvalidRequest(logger, w, "invalid max groups value") + return + } + } + rulesReq := RulesRequest{ Filter: AnyRule, RuleName: req.URL.Query()["rule_name"], @@ -195,8 +207,21 @@ func (a *API) PrometheusRules(w http.ResponseWriter, req *http.Request) { } groups := make([]*RuleGroup, 0, len(rgs)) - + var newToken string + foundToken := false for _, g := range rgs { + if nextToken != "" && !foundToken { + if nextToken != getRuleGroupNextToken(g.Group.Namespace, g.Group.Name) { + continue + } + foundToken = true + } + + if maxGroups > 0 && len(groups) == maxGroups { + newToken = getRuleGroupNextToken(g.Group.Namespace, g.Group.Name) + break + } + grp := RuleGroup{ Name: g.Group.Name, File: g.Group.Namespace, @@ -241,17 +266,13 @@ func (a *API) PrometheusRules(w http.ResponseWriter, req *http.Request) { } } } + groups = append(groups, &grp) } - // keep data.groups are in order - sort.Slice(groups, func(i, j int) bool { - return groups[i].File < groups[j].File - }) - b, err := json.Marshal(&response{ Status: "success", - Data: &RuleDiscovery{RuleGroups: groups}, + Data: &RuleDiscovery{RuleGroups: groups, NextToken: newToken}, }) if err != nil { level.Error(logger).Log("msg", "error marshaling json response", "err", err) @@ -265,6 +286,13 @@ func (a *API) PrometheusRules(w http.ResponseWriter, req *http.Request) { } } +func getRuleGroupNextToken(file, group string) string { + h := xxhash.New() + h.Write([]byte(file + ":" + group)) + + return hex.EncodeToString(h.Sum(nil)) +} + func (a *API) PrometheusAlerts(w http.ResponseWriter, req *http.Request) { logger, ctx := spanlogger.NewWithLogger(req.Context(), a.logger, "API.PrometheusAlerts") defer logger.Finish() diff --git a/pkg/ruler/api_test.go b/pkg/ruler/api_test.go index 10c63cbcf55..e04dd51beac 100644 --- a/pkg/ruler/api_test.go +++ b/pkg/ruler/api_test.go @@ -14,6 +14,7 @@ import ( "net/http" "net/http/httptest" "net/url" + "strconv" "strings" "testing" "time" @@ -905,6 +906,135 @@ func TestRuler_PrometheusRules(t *testing.T) { } } +func TestRuler_PrometheusRulesPagination(t *testing.T) { + const ( + userID = "user1" + interval = time.Minute + ) + + ruleGroups := rulespb.RuleGroupList{} + for ns := 0; ns < 3; ns++ { + for group := 0; group < 3; group++ { + g := &rulespb.RuleGroupDesc{ + Name: fmt.Sprintf("test-group-%d", group), + Namespace: fmt.Sprintf("test-namespace-%d", ns), + User: userID, + Rules: []*rulespb.RuleDesc{ + createAlertingRule("testalertingrule", "up < 1"), + }, + Interval: interval, + } + ruleGroups = append(ruleGroups, g) + } + } + + cfg := defaultRulerConfig(t) + cfg.TenantFederation.Enabled = true + + storageRules := map[string]rulespb.RuleGroupList{ + userID: ruleGroups, + } + + r := prepareRuler(t, cfg, newMockRuleStore(storageRules), withRulerAddrAutomaticMapping(), withLimits(validation.MockDefaultOverrides()), withStart()) + + // Rules will be synchronized asynchronously, so we wait until the expected number of rule groups + // has been synched. + test.Poll(t, 5*time.Second, len(ruleGroups), func() interface{} { + ctx := user.InjectOrgID(context.Background(), userID) + rls, _ := r.Rules(ctx, &RulesRequest{}) + return len(rls.Groups) + }) + + a := NewAPI(r, r.directStore, log.NewNopLogger()) + + getRulesResponse := func(groupSize int, nextToken string) response { + queryParams := "?" + url.Values{ + "max_groups": []string{strconv.Itoa(groupSize)}, + "next_token": []string{nextToken}, + }.Encode() + req := requestFor(t, http.MethodGet, "https://localhost:8080/prometheus/api/v1/rules"+queryParams, nil, userID) + w := httptest.NewRecorder() + a.PrometheusRules(w, req) + + resp := w.Result() + body, _ := io.ReadAll(resp.Body) + + r := response{} + err := json.Unmarshal(body, &r) + require.NoError(t, err) + + return r + } + + getRulesFromResponse := func(resp response) RuleDiscovery { + jsonRules, err := json.Marshal(resp.Data) + require.NoError(t, err) + returnedRules := RuleDiscovery{} + require.NoError(t, json.Unmarshal(jsonRules, &returnedRules)) + + return returnedRules + } + + // No page size limit + resp := getRulesResponse(0, "") + require.Equal(t, "success", resp.Status) + rd := getRulesFromResponse(resp) + require.Len(t, rd.RuleGroups, len(ruleGroups)) + require.Empty(t, rd.NextToken) + + // We have 9 groups, keep fetching rules with a group page size of 2. The final + // page should have size 1 and an empty nextToken. Also check the groups returned + // in order + var nextToken string + returnedRuleGroups := make([]*RuleGroup, 0, len(ruleGroups)) + for i := 0; i < 4; i++ { + resp := getRulesResponse(2, nextToken) + require.Equal(t, "success", resp.Status) + + rd := getRulesFromResponse(resp) + require.Len(t, rd.RuleGroups, 2) + require.NotEmpty(t, rd.NextToken) + + returnedRuleGroups = append(returnedRuleGroups, rd.RuleGroups[0], rd.RuleGroups[1]) + nextToken = rd.NextToken + } + resp = getRulesResponse(2, nextToken) + require.Equal(t, "success", resp.Status) + + rd = getRulesFromResponse(resp) + require.Len(t, rd.RuleGroups, 1) + require.Empty(t, rd.NextToken) + returnedRuleGroups = append(returnedRuleGroups, rd.RuleGroups[0]) + + // Check the returned rules match the rules written + require.Equal(t, len(ruleGroups), len(returnedRuleGroups)) + for i := 0; i < len(ruleGroups); i++ { + require.Equal(t, ruleGroups[i].Namespace, returnedRuleGroups[i].File) + require.Equal(t, ruleGroups[i].Name, returnedRuleGroups[i].Name) + require.Equal(t, len(ruleGroups[i].Rules), len(returnedRuleGroups[i].Rules)) + for j := 0; j < len(ruleGroups[i].Rules); j++ { + jsonRule, err := json.Marshal(returnedRuleGroups[i].Rules[j]) + require.NoError(t, err) + rule := alertingRule{} + require.NoError(t, json.Unmarshal(jsonRule, &rule)) + require.Equal(t, ruleGroups[i].Rules[j].Alert, rule.Name) + } + } + + // Invalid max groups value + resp = getRulesResponse(-1, "") + require.Equal(t, "error", resp.Status) + require.Equal(t, v1.ErrBadData, resp.ErrorType) + require.Equal(t, "invalid max groups value", resp.Error) + + // Bad token should return no groups + resp = getRulesResponse(0, "bad-token") + require.Equal(t, "success", resp.Status) + + rd = getRulesFromResponse(resp) + require.Len(t, rd.RuleGroups, 0) +} + func TestRuler_PrometheusAlerts(t *testing.T) { cfg := defaultRulerConfig(t) diff --git a/pkg/ruler/ruler.pb.go b/pkg/ruler/ruler.pb.go index bac9a0bf829..a2bd34ada74 100644 --- a/pkg/ruler/ruler.pb.go +++ b/pkg/ruler/ruler.pb.go @@ -68,8 +68,6 @@ type RulesRequest struct { RuleName []string `protobuf:"bytes,2,rep,name=rule_name,json=ruleName,proto3" json:"rule_name,omitempty"` RuleGroup []string `protobuf:"bytes,3,rep,name=rule_group,json=ruleGroup,proto3" json:"rule_group,omitempty"` File []string `protobuf:"bytes,4,rep,name=file,proto3" json:"file,omitempty"` - MaxGroups uint64 `protobuf:"varint,5,opt,name=max_groups,json=maxGroups,proto3" json:"max_groups,omitempty"` - NextToken uint64 `protobuf:"varint,6,opt,name=next_token,json=nextToken,proto3" json:"next_token,omitempty"` } func (m *RulesRequest) Reset() { *m = RulesRequest{} } @@ -132,20 +130,6 @@ func (m *RulesRequest) GetFile() []string { return nil } -func (m *RulesRequest) GetMaxGroups() uint64 { - if m != nil { - return m.MaxGroups - } - return 0 -} - -func (m *RulesRequest) GetNextToken() uint64 { - if m != nil { - return m.NextToken - } - return 0 -} - type RulesResponse struct { Groups []*GroupStateDesc `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"` } @@ -545,64 +529,62 @@ func init() { func init() { proto.RegisterFile("ruler.proto", fileDescriptor_9ecbec0a4cfddea6) } var fileDescriptor_9ecbec0a4cfddea6 = []byte{ - // 901 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0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 0x98, 0x1c, 0x07, 0x05, 0xa8, 0xbb, 0x03, 0xeb, 0x83, 0xb3, - 0x64, 0x7c, 0xad, 0xab, 0xf7, 0xa0, 0x99, 0x4b, 0x26, 0x86, 0x7c, 0x62, 0x44, 0x9c, 0xa0, 0xa1, - 0xed, 0xaf, 0x26, 0xb2, 0xbb, 0x09, 0x1b, 0x0b, 0x70, 0x73, 0x65, 0xf7, 0xe7, 0x0a, 0xac, 0x5d, - 0x97, 0x27, 0xef, 0x41, 0xcd, 0x34, 0x50, 0xcf, 0xa5, 0xb5, 0xb7, 0xe5, 0x9b, 0x31, 0x06, 0x65, - 0x1f, 0x31, 0x07, 0x03, 0x21, 0x1f, 0xc3, 0x2a, 0x1d, 0x2b, 0x7e, 0xc2, 0x86, 0x08, 0xc2, 0x89, - 0x94, 0x14, 0x33, 0xca, 0x79, 0xda, 0x2d, 0x83, 0xc4, 0xfb, 0xc9, 0x77, 0xb0, 0xc9, 0x4e, 0x68, - 0x94, 0xe3, 0xb6, 0x1e, 0x96, 0x5b, 0xe9, 0xae, 0xe0, 0x95, 0x6d, 0xdf, 0xec, 0xad, 0x5f, 0xee, - 0xad, 0xff, 0x02, 0x71, 0xd0, 0x7c, 0xf2, 0x6c, 0xdb, 0x3a, 0xff, 0x63, 0xdb, 0x0e, 0x6e, 0x12, - 0x20, 0x03, 0x20, 0x73, 0xf7, 0x83, 0xe2, 0x6b, 0x70, 0xab, 0x28, 0x7b, 0xef, 0x15, 0xd9, 0x12, - 0x60, 0x54, 0x7f, 0xd2, 0xaa, 0x37, 0xd0, 0xbb, 0xbf, 0x57, 0xcc, 0xa4, 0xe6, 0x3d, 0x7a, 0x17, - 0xaa, 0xba, 0xc4, 0xa2, 0x45, 0x77, 0x17, 0x5a, 0x84, 0xa5, 0x62, 0x90, 0x6c, 0x41, 0x4d, 0x6a, - 0x86, 0x5b, 0xe9, 0xd8, 0x3d, 0x27, 0x30, 0x06, 0x79, 0x13, 0xea, 0x47, 0x8c, 0x46, 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x5a, 0xa7, 0xb9, 0x8c, 0x8e, 0x66, 0x0e, 0x58, 0xa2, 0x4c, 0x3a, 0x27, - 0x34, 0xe2, 0x93, 0x61, 0x9e, 0x28, 0x1e, 0xb9, 0xce, 0x32, 0x32, 0x48, 0xfc, 0x56, 0xf3, 0xc8, - 0x63, 0xd8, 0x38, 0x66, 0x2c, 0x1b, 0x4e, 0xb9, 0xe0, 0x49, 0x38, 0x94, 0x3c, 0x19, 0x33, 0x17, - 0x96, 0x10, 0xbb, 0xab, 0xe9, 0x8f, 0x90, 0x3d, 0xd0, 0xe4, 0xbd, 0x1f, 0xa0, 0xa6, 0x3f, 0x7f, - 0x41, 0xf6, 0xcd, 0x41, 0x92, 0xcd, 0x1b, 0xfe, 0xa1, 0xb5, 0xb7, 0xae, 0x3b, 0x8b, 0x57, 0xd8, - 0x22, 0x5f, 0x80, 0xf3, 0xe2, 0x71, 0x26, 0x6f, 0x15, 0xa0, 0x97, 0x5f, 0xf7, 0xb6, 0xfb, 0x6a, - 0xa0, 0x54, 0x38, 0xd8, 0xbf, 0xb8, 0xf4, 0xac, 0xa7, 0x97, 0x9e, 0xf5, 0xfc, 0xd2, 0xb3, 0x7f, - 0x9c, 0x79, 0xf6, 0x2f, 0x33, 0xcf, 0x7e, 0x32, 0xf3, 0xec, 0x8b, 0x99, 0x67, 0xff, 0x39, 0xf3, - 0xec, 0xbf, 0x66, 0x9e, 0xf5, 0x7c, 0xe6, 0xd9, 0xe7, 0x57, 0x9e, 0x75, 0x71, 0xe5, 0x59, 0x4f, - 0xaf, 0x3c, 0x6b, 0x54, 0xc7, 0x2a, 0x3f, 0xfc, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x78, 0x6a, 0x0b, - 0x2c, 0x8d, 0x08, 0x00, 0x00, + // 871 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x6f, 0x1b, 0x45, + 0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1b, 0x4c, 0x84, 0x14, 0x49, 0x34, 0x50, 0x22, 0x19, + 0x71, 0x0f, 0xd6, 0x10, 0xbb, 0x69, 0xe8, 0xf7, 0x90, 0xdd, 0x37, 0xe4, 0xee, 0xb7, 0x50, 0x35, + 0x9f, 0xbf, 0xa4, 0x27, 0x76, 0xa1, 0xe8, 0xde, 0x35, 0xff, 0x92, 0x5a, 0xfb, 0xab, 0x9b, 0xc5, + 0x2b, 0xec, 0xd0, 0x4f, 0xc0, 0x7d, 0xfe, 0x38, 0xd3, 0xd7, 0x0a, 0xd0, 0x8b, 0xaf, 0x7b, 0xcb, + 0x7b, 0x39, 0x51, 0x2a, 0x9c, 0x9e, 0x5c, 0x5c, 0xfa, 0xce, 0x93, 0x4b, 0xdf, 0x79, 0x76, 0xe9, + 0x93, 0xef, 0xe6, 0x3e, 0xf9, 0x71, 0xee, 0x93, 0xc7, 0x73, 0x9f, 0x5c, 0xcc, 0x7d, 0xf2, 0xfb, + 0xdc, 0x27, 0x7f, 0xcc, 0x7d, 0xe7, 0xd9, 0xdc, 0x27, 0x8f, 0xae, 0x7c, 0xe7, 0xe2, 0xca, 0x77, + 0x9e, 0x5c, 0xf9, 0xce, 0xb0, 0x86, 0x5d, 0xbe, 0xfb, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3c, + 0xcd, 0xed, 0x61, 0x4f, 0x08, 0x00, 0x00, } func (x RulesRequest_RuleType) String() string { @@ -658,12 +640,6 @@ func (this *RulesRequest) Equal(that interface{}) bool { return false } } - if this.MaxGroups != that1.MaxGroups { - return false - } - if this.NextToken != that1.NextToken { - return false - } return true } func (this *RulesResponse) Equal(that interface{}) bool { @@ -895,14 +871,12 @@ func (this *RulesRequest) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 10) + s := make([]string, 0, 8) s = append(s, "&ruler.RulesRequest{") s = append(s, "Filter: "+fmt.Sprintf("%#v", this.Filter)+",\n") s = append(s, "RuleName: "+fmt.Sprintf("%#v", this.RuleName)+",\n") s = append(s, "RuleGroup: "+fmt.Sprintf("%#v", this.RuleGroup)+",\n") s = append(s, "File: "+fmt.Sprintf("%#v", this.File)+",\n") - s = append(s, "MaxGroups: "+fmt.Sprintf("%#v", this.MaxGroups)+",\n") - s = append(s, "NextToken: "+fmt.Sprintf("%#v", this.NextToken)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -1142,16 +1116,6 @@ func (m *RulesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.NextToken != 0 { - i = encodeVarintRuler(dAtA, i, uint64(m.NextToken)) - i-- - dAtA[i] = 0x30 - } - if m.MaxGroups != 0 { - i = encodeVarintRuler(dAtA, i, uint64(m.MaxGroups)) - i-- - dAtA[i] = 0x28 - } if len(m.File) > 0 { for iNdEx := len(m.File) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.File[iNdEx]) @@ -1580,12 +1544,6 @@ func (m *RulesRequest) Size() (n int) { n += 1 + l + sovRuler(uint64(l)) } } - if m.MaxGroups != 0 { - n += 1 + sovRuler(uint64(m.MaxGroups)) - } - if m.NextToken != 0 { - n += 1 + sovRuler(uint64(m.NextToken)) - } return n } @@ -1741,8 +1699,6 @@ func (this *RulesRequest) String() string { `RuleName:` + fmt.Sprintf("%v", this.RuleName) + `,`, `RuleGroup:` + fmt.Sprintf("%v", this.RuleGroup) + `,`, `File:` + fmt.Sprintf("%v", this.File) + `,`, - `MaxGroups:` + fmt.Sprintf("%v", this.MaxGroups) + `,`, - `NextToken:` + fmt.Sprintf("%v", this.NextToken) + `,`, `}`, }, "") return s @@ -1991,44 +1947,6 @@ func (m *RulesRequest) Unmarshal(dAtA []byte) error { } m.File = append(m.File, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxGroups", wireType) - } - m.MaxGroups = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxGroups |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field NextToken", wireType) - } - m.NextToken = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowRuler - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.NextToken |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } default: iNdEx = preIndex skippy, err := skipRuler(dAtA[iNdEx:]) diff --git a/pkg/ruler/ruler.proto b/pkg/ruler/ruler.proto index 0fb8dbb82a2..15855e3d84c 100644 --- a/pkg/ruler/ruler.proto +++ b/pkg/ruler/ruler.proto @@ -37,8 +37,6 @@ message RulesRequest { repeated string rule_name = 2; repeated string rule_group = 3; repeated string file = 4; - uint64 max_groups = 5; - uint64 next_token = 6; } message RulesResponse { From d106cf3f69c170d33069a20d8ced368ef1a180c5 Mon Sep 17 00:00:00 2001 From: fayzal-g Date: Wed, 11 Sep 2024 17:10:30 +0100 Subject: [PATCH 3/4] Undo changes --- .../mimir-read-write-mode/config/mimir.yaml | 1 - .../docker-compose.jsonnet | 6 ++-- .../mimir-read-write-mode/docker-compose.yml | 30 ++++++++++++++++++- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/development/mimir-read-write-mode/config/mimir.yaml b/development/mimir-read-write-mode/config/mimir.yaml index 37c9b9d5b11..0e5e0b1a442 100644 --- a/development/mimir-read-write-mode/config/mimir.yaml +++ b/development/mimir-read-write-mode/config/mimir.yaml @@ -56,7 +56,6 @@ alertmanager: data_dir: /data/alertmanager fallback_config_file: ./config/alertmanager-fallback-config.yaml external_url: http://localhost:8006/alertmanager - grafana_alertmanager_compatibility_enabled: true alertmanager_storage: s3: diff --git a/development/mimir-read-write-mode/docker-compose.jsonnet b/development/mimir-read-write-mode/docker-compose.jsonnet index bfa34828139..efe33445083 100644 --- a/development/mimir-read-write-mode/docker-compose.jsonnet +++ b/development/mimir-read-write-mode/docker-compose.jsonnet @@ -6,10 +6,10 @@ std.manifestYamlDoc({ self.backend + self.nginx + self.minio + - //self.grafana + - //self.grafana_agent + + self.grafana + + self.grafana_agent + self.memcached + - //self.prometheus + + self.prometheus + {}, write:: { diff --git a/development/mimir-read-write-mode/docker-compose.yml b/development/mimir-read-write-mode/docker-compose.yml index 694b40bf2df..08d31a521ca 100644 --- a/development/mimir-read-write-mode/docker-compose.yml +++ b/development/mimir-read-write-mode/docker-compose.yml @@ -1,4 +1,23 @@ "services": + "grafana": + "environment": + - "GF_AUTH_ANONYMOUS_ENABLED=true" + - "GF_AUTH_ANONYMOUS_ORG_ROLE=Admin" + "image": "grafana/grafana:10.4.3" + "ports": + - "3000:3000" + "volumes": + - "./config/datasource-mimir.yaml:/etc/grafana/provisioning/datasources/mimir.yaml" + "grafana-agent": + "command": + - "-config.file=/etc/agent-config/grafana-agent.yaml" + - "-metrics.wal-directory=/tmp" + - "-server.http.address=127.0.0.1:9091" + "image": "grafana/agent:v0.37.3" + "ports": + - "9091:9091" + "volumes": + - "./config:/etc/agent-config" "memcached": "image": "memcached:1.6.19-alpine" "mimir-backend-1": @@ -166,4 +185,13 @@ - "8080:8080" "volumes": - "../common/config:/etc/nginx/templates" -"version": "3.4" + "prometheus": + "command": + - "--config.file=/etc/prometheus/prometheus.yaml" + - "--enable-feature=exemplar-storage" + - "--enable-feature=native-histograms" + "image": "prom/prometheus:v2.53.0" + "ports": + - "9090:9090" + "volumes": + - "./config:/etc/prometheus" From 9c8a2fb3ce6c34aa66d2e38d84a080fd731a0d71 Mon Sep 17 00:00:00 2001 From: fayzal-g Date: Wed, 11 Sep 2024 17:34:42 +0100 Subject: [PATCH 4/4] Fix lint errors --- pkg/ruler/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ruler/api.go b/pkg/ruler/api.go index 450b3036c29..76bde5f61d5 100644 --- a/pkg/ruler/api.go +++ b/pkg/ruler/api.go @@ -288,7 +288,7 @@ func (a *API) PrometheusRules(w http.ResponseWriter, req *http.Request) { func getRuleGroupNextToken(file, group string) string { h := xxhash.New() - h.Write([]byte(file + ":" + group)) + _, _ = h.Write([]byte(file + ":" + group)) return hex.EncodeToString(h.Sum(nil)) }