From 764c9f6d3d5b740e2abe6d0e8ca5f3f321067e30 Mon Sep 17 00:00:00 2001 From: francoposa Date: Thu, 2 Jan 2025 11:24:49 -0800 Subject: [PATCH] remove further custom type references for LabelAdapter --- pkg/frontend/querymiddleware/model.pb.go | 178 +++++++++++--------- pkg/frontend/querymiddleware/model.proto | 2 +- pkg/ruler/ruler.pb.go | 206 +++++++++++++---------- pkg/ruler/ruler.proto | 6 +- pkg/ruler/rulespb/rules.pb.go | 161 +++++++++++------- pkg/ruler/rulespb/rules.proto | 6 +- pkg/storegateway/storepb/types.pb.go | 152 +++++++++-------- pkg/storegateway/storepb/types.proto | 4 +- 8 files changed, 407 insertions(+), 308 deletions(-) diff --git a/pkg/frontend/querymiddleware/model.pb.go b/pkg/frontend/querymiddleware/model.pb.go index 671fbf1857c..7b9228660b1 100644 --- a/pkg/frontend/querymiddleware/model.pb.go +++ b/pkg/frontend/querymiddleware/model.pb.go @@ -12,8 +12,7 @@ import ( proto "github.com/gogo/protobuf/proto" types "github.com/gogo/protobuf/types" mimirpb "github.com/grafana/mimir/pkg/mimirpb" - _ "github.com/grafana/mimir/pkg/mimirpb_custom" - github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" + mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" io "io" math "math" math_bits "math/bits" @@ -226,9 +225,9 @@ func (m *PrometheusData) GetResult() []SampleStream { } type SampleStream struct { - Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"metric"` - Samples []mimirpb.Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` - Histograms []mimirpb.FloatHistogramPair `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"metric"` + Samples []mimirpb.Sample `protobuf:"bytes,2,rep,name=samples,proto3" json:"values"` + Histograms []mimirpb.FloatHistogramPair `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms"` } func (m *SampleStream) Reset() { *m = SampleStream{} } @@ -263,6 +262,13 @@ func (m *SampleStream) XXX_DiscardUnknown() { var xxx_messageInfo_SampleStream proto.InternalMessageInfo +func (m *SampleStream) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + func (m *SampleStream) GetSamples() []mimirpb.Sample { if m != nil { return m.Samples @@ -727,75 +733,74 @@ func init() { func init() { proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) } var fileDescriptor_4c16552f9fdb66d8 = []byte{ - // 1083 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xf7, 0xc6, 0xff, 0x9f, 0xd3, 0xc4, 0x9a, 0x46, 0xe0, 0x04, 0xba, 0x6b, 0xad, 0x38, 0x04, - 0x68, 0x1d, 0x14, 0xfe, 0x08, 0x21, 0x8a, 0xa8, 0x93, 0xa0, 0xa4, 0xb4, 0x10, 0xc6, 0x11, 0x48, - 0x5c, 0xac, 0xb1, 0x77, 0x62, 0x2f, 0xdd, 0xdd, 0x59, 0x66, 0xc6, 0x6d, 0x7d, 0x03, 0xae, 0x5c, - 0xf8, 0x04, 0x88, 0x23, 0x1f, 0xa5, 0xc7, 0x1c, 0xab, 0x1e, 0x56, 0xc4, 0x11, 0x12, 0xda, 0x53, - 0x3f, 0x00, 0x07, 0xb4, 0x33, 0xbb, 0xeb, 0x4d, 0x1b, 0x21, 0xb8, 0xd8, 0xf3, 0x7e, 0xef, 0xf7, - 0xde, 0xbc, 0xf7, 0xe6, 0xbd, 0xb7, 0xd0, 0xf2, 0x99, 0x43, 0xbd, 0x5e, 0xc8, 0x99, 0x64, 0x08, - 0xbe, 0x9f, 0x51, 0x3e, 0xe7, 0x24, 0x98, 0xd0, 0xad, 0x5b, 0x13, 0x57, 0x4e, 0x67, 0xa3, 0xde, - 0x98, 0xf9, 0x3b, 0x13, 0x36, 0x61, 0x3b, 0x8a, 0x32, 0x9a, 0x9d, 0x2a, 0x49, 0x09, 0xea, 0xa4, - 0x4d, 0xb7, 0xde, 0x29, 0xd2, 0x39, 0x39, 0x25, 0x01, 0xd9, 0xf1, 0x5d, 0xdf, 0xe5, 0x3b, 0xe1, - 0x83, 0x89, 0x3e, 0x85, 0x23, 0xfd, 0x9f, 0x5a, 0xec, 0xff, 0x17, 0x8b, 0xe1, 0x78, 0x26, 0x24, - 0xf3, 0xb5, 0x98, 0x0a, 0x43, 0x39, 0x0f, 0xa9, 0x48, 0xbd, 0x6c, 0x4e, 0x18, 0x9b, 0x78, 0x74, - 0x19, 0x1d, 0x09, 0xe6, 0x5a, 0x65, 0xdf, 0x83, 0xf6, 0x31, 0x67, 0x3e, 0x95, 0x53, 0x3a, 0x13, - 0x87, 0x94, 0x38, 0x94, 0xa3, 0x4d, 0xa8, 0x7c, 0x41, 0x7c, 0xda, 0x31, 0xba, 0xc6, 0x76, 0xb3, - 0x5f, 0x8d, 0x23, 0xcb, 0xb8, 0x85, 0x15, 0x84, 0x6e, 0x40, 0xed, 0x6b, 0xe2, 0xcd, 0xa8, 0xe8, - 0xac, 0x74, 0xcb, 0x4b, 0x65, 0x0a, 0xda, 0x7f, 0xaf, 0x00, 0x5a, 0xba, 0xc3, 0x54, 0x84, 0x2c, - 0x10, 0x14, 0xd9, 0x50, 0x1b, 0x48, 0x22, 0x67, 0x22, 0x75, 0x09, 0x71, 0x64, 0xd5, 0x84, 0x42, - 0x70, 0xaa, 0x41, 0x7d, 0xa8, 0xec, 0x13, 0x49, 0x3a, 0x2b, 0x5d, 0x63, 0xbb, 0xb5, 0xbb, 0xd5, - 0x5b, 0x56, 0xb9, 0xb7, 0xf4, 0x98, 0x30, 0xfa, 0x28, 0x8e, 0xac, 0x35, 0x87, 0x48, 0x72, 0x93, - 0xf9, 0xae, 0xa4, 0x7e, 0x28, 0xe7, 0x58, 0xd9, 0xa2, 0xf7, 0xa1, 0x79, 0xc0, 0x39, 0xe3, 0x27, - 0xf3, 0x90, 0x76, 0xca, 0xea, 0xaa, 0x57, 0xe3, 0xc8, 0xba, 0x4e, 0x33, 0xb0, 0x60, 0xb1, 0x64, - 0xa2, 0x37, 0xa1, 0xaa, 0x84, 0x4e, 0x45, 0x99, 0x5c, 0x8f, 0x23, 0x6b, 0x5d, 0x99, 0x14, 0xe8, - 0x9a, 0x81, 0x6e, 0x43, 0x5d, 0x17, 0x49, 0x74, 0xaa, 0xdd, 0xf2, 0x76, 0x6b, 0xf7, 0xf5, 0xab, - 0x03, 0xd5, 0xa4, 0xac, 0x3c, 0x99, 0x0d, 0xda, 0x85, 0xc6, 0x37, 0x84, 0x07, 0x6e, 0x30, 0x11, - 0x9d, 0x9a, 0x2a, 0xe0, 0x2b, 0x71, 0x64, 0xa1, 0x47, 0x29, 0x56, 0xb8, 0x2f, 0xe7, 0x25, 0xd1, - 0x1d, 0x05, 0xa7, 0x4c, 0x74, 0xea, 0xca, 0x40, 0x45, 0xe7, 0x26, 0x40, 0x31, 0x3a, 0xc5, 0xb0, - 0x7f, 0x32, 0x60, 0xed, 0x72, 0xb1, 0x50, 0x0f, 0x00, 0x53, 0x31, 0xf3, 0xa4, 0xaa, 0x89, 0x2e, - 0xff, 0x5a, 0x1c, 0x59, 0xc0, 0x73, 0x14, 0x17, 0x18, 0xe8, 0x53, 0xa8, 0x69, 0x49, 0x3d, 0x70, - 0x6b, 0xb7, 0x53, 0xcc, 0x6f, 0x40, 0xfc, 0xd0, 0xa3, 0x03, 0xc9, 0x29, 0xf1, 0xfb, 0x6b, 0x4f, - 0x22, 0xab, 0x94, 0x3c, 0xa4, 0xf6, 0x84, 0x53, 0x3b, 0xfb, 0xb7, 0x15, 0x58, 0x2d, 0x12, 0xd1, - 0x8f, 0x06, 0xd4, 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x4c, 0xe3, 0x8f, 0x85, 0x69, 0xfc, 0xb5, 0x30, 0x4b, 0xcf, 0x17, - 0xa6, 0xf1, 0xcb, 0x85, 0x59, 0x3a, 0xbb, 0x30, 0x4b, 0x4f, 0x2f, 0xcc, 0xd2, 0xb7, 0xeb, 0x2a, - 0x5a, 0xdf, 0x75, 0x1c, 0x8f, 0x3e, 0x22, 0x9c, 0x8e, 0x6a, 0xaa, 0x5d, 0xdf, 0xfd, 0x27, 0x00, - 0x00, 0xff, 0xff, 0x3c, 0x34, 0x8a, 0x03, 0x84, 0x08, 0x00, 0x00, + // 1064 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x55, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xc6, 0xff, 0x9f, 0xd3, 0xc4, 0x9a, 0x56, 0xe0, 0x16, 0xba, 0x6b, 0xad, 0x38, 0x04, + 0x68, 0x1d, 0x14, 0xfe, 0x1c, 0x10, 0x45, 0xd4, 0x89, 0x51, 0x02, 0x2d, 0x84, 0x71, 0x04, 0x12, + 0x17, 0x6b, 0xec, 0x9d, 0xd8, 0x4b, 0x77, 0x77, 0x96, 0x99, 0x71, 0x5b, 0xdf, 0x10, 0x57, 0x2e, + 0x7c, 0x02, 0xce, 0x7c, 0x94, 0x1e, 0x73, 0xac, 0x38, 0xac, 0x88, 0x23, 0x24, 0xb4, 0xa7, 0x7e, + 0x00, 0x0e, 0x68, 0x67, 0xf6, 0x5f, 0xda, 0x08, 0x71, 0xf1, 0xce, 0xfb, 0xbd, 0xdf, 0xef, 0xcd, + 0x9b, 0x37, 0x6f, 0x9e, 0xa1, 0xe3, 0x33, 0x87, 0x7a, 0x83, 0x90, 0x33, 0xc9, 0x10, 0xfc, 0xb8, + 0xa4, 0x7c, 0xc5, 0x49, 0x30, 0xa7, 0xb7, 0xee, 0xce, 0x5d, 0xb9, 0x58, 0x4e, 0x07,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x3e, 0xcd, 0x1b, 0x77, 0xf0, + 0x20, 0x71, 0xdf, 0x77, 0x48, 0x28, 0x29, 0x2f, 0xe2, 0xfa, 0x54, 0x72, 0x77, 0x86, 0x53, 0x31, + 0xfa, 0x18, 0x9a, 0x42, 0x85, 0x15, 0x69, 0x6a, 0xdd, 0x3c, 0x4e, 0x9a, 0x58, 0x21, 0x7d, 0xac, + 0xda, 0x11, 0x67, 0x02, 0x74, 0x0c, 0xb0, 0x70, 0x85, 0x64, 0x73, 0x4e, 0x7c, 0xd1, 0xab, 0xa6, + 0x37, 0x97, 0xcb, 0x3f, 0xf7, 0x18, 0x91, 0x87, 0x19, 0xe1, 0x98, 0xb8, 0x7c, 0x88, 0xd2, 0x50, + 0x25, 0x1d, 0x2e, 0xad, 0xed, 0x5f, 0x0c, 0xe8, 0xec, 0x93, 0xd9, 0x82, 0x3a, 0xba, 0x31, 0x6e, + 0x42, 0xf5, 0x11, 0x5d, 0xa5, 0x05, 0x6e, 0xc6, 0x91, 0x95, 0x98, 0x38, 0xf9, 0x41, 0xef, 0x42, + 0x3b, 0x6f, 0x40, 0xd5, 0xde, 0xed, 0xe1, 0xb5, 0x38, 0xb2, 0x0a, 0x10, 0x17, 0x4b, 0xf4, 0x01, + 0x6c, 0x2a, 0xe3, 0x21, 0x15, 0x82, 0xcc, 0xb3, 0x2e, 0xee, 0xc6, 0x91, 0x75, 0x09, 0xc7, 0x97, + 0x2c, 0xfb, 0x07, 0xd8, 0xd2, 0xc9, 0xe4, 0x4f, 0xee, 0x3f, 0xf2, 0xb9, 0x07, 0x4d, 0xfa, 0x54, + 0xd2, 0x40, 0x66, 0x85, 0x44, 0xe5, 0x3b, 0x1e, 0x29, 0xd7, 0x70, 0x3b, 0x3d, 0x7f, 0x46, 0xc5, + 0xd9, 0xc2, 0xfe, 0xc3, 0x80, 0x86, 0x26, 0x21, 0x0b, 0xea, 0x42, 0x12, 0x2e, 0xd5, 0x36, 0xd5, + 0x61, 0x3b, 0x8e, 0x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x8e, 0x47, 0x9f, 0x10, 0x4e, 0xa7, 0x0d, 0xd5, 0xae, 0xef, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, + 0x03, 0x62, 0x94, 0xb1, 0x47, 0x08, 0x00, 0x00, } func (this *PrometheusHeader) Equal(that interface{}) bool { @@ -942,7 +947,7 @@ func (this *SampleStream) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -1241,7 +1246,13 @@ func (this *SampleStream) GoString() string { } s := make([]string, 0, 7) s = append(s, "&querymiddleware.SampleStream{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } if this.Samples != nil { vs := make([]*mimirpb.Sample, len(this.Samples)) for i := range vs { @@ -1584,11 +1595,11 @@ func (m *SampleStream) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintModel(dAtA, i, uint64(size)) } i-- @@ -2249,6 +2260,11 @@ func (this *SampleStream) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" repeatedStringForSamples := "[]Sample{" for _, f := range this.Samples { repeatedStringForSamples += fmt.Sprintf("%v", f) + "," @@ -2260,7 +2276,7 @@ func (this *SampleStream) String() string { } repeatedStringForHistograms += "}" s := strings.Join([]string{`&SampleStream{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `Samples:` + repeatedStringForSamples + `,`, `Histograms:` + repeatedStringForHistograms + `,`, `}`, @@ -2947,7 +2963,7 @@ func (m *SampleStream) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/frontend/querymiddleware/model.proto b/pkg/frontend/querymiddleware/model.proto index af3cc7a23fb..0cb55f8079f 100644 --- a/pkg/frontend/querymiddleware/model.proto +++ b/pkg/frontend/querymiddleware/model.proto @@ -39,7 +39,7 @@ message PrometheusData { } message SampleStream { - repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "metric", (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "metric"]; repeated cortexpb.Sample samples = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "values"]; repeated cortexpb.FloatHistogramPair histograms = 3 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "histograms"]; } diff --git a/pkg/ruler/ruler.pb.go b/pkg/ruler/ruler.pb.go index 33066f66cb1..56d1be9d566 100644 --- a/pkg/ruler/ruler.pb.go +++ b/pkg/ruler/ruler.pb.go @@ -11,8 +11,7 @@ import ( proto "github.com/gogo/protobuf/proto" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" _ "github.com/grafana/mimir/pkg/mimirpb" - _ "github.com/grafana/mimir/pkg/mimirpb_custom" - github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" + mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" rulespb "github.com/grafana/mimir/pkg/ruler/rulespb" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -440,16 +439,16 @@ func (m *RuleStateDesc) GetEvaluationDuration() time.Duration { } type AlertStateDesc struct { - State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` - Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,2,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` - Annotations []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,3,rep,name=annotations,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"annotations"` - Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` - ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` - FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` - ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` - LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` - ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` - KeepFiringSince time.Time `protobuf:"bytes,10,opt,name=keep_firing_since,json=keepFiringSince,proto3,stdtime" json:"keep_firing_since"` + State string `protobuf:"bytes,1,opt,name=state,proto3" json:"state,omitempty"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels"` + Annotations []mimirpb_custom.LabelAdapter `protobuf:"bytes,3,rep,name=annotations,proto3" json:"annotations"` + Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + ActiveAt time.Time `protobuf:"bytes,5,opt,name=active_at,json=activeAt,proto3,stdtime" json:"active_at"` + FiredAt time.Time `protobuf:"bytes,6,opt,name=fired_at,json=firedAt,proto3,stdtime" json:"fired_at"` + ResolvedAt time.Time `protobuf:"bytes,7,opt,name=resolved_at,json=resolvedAt,proto3,stdtime" json:"resolved_at"` + LastSentAt time.Time `protobuf:"bytes,8,opt,name=last_sent_at,json=lastSentAt,proto3,stdtime" json:"last_sent_at"` + ValidUntil time.Time `protobuf:"bytes,9,opt,name=valid_until,json=validUntil,proto3,stdtime" json:"valid_until"` + KeepFiringSince time.Time `protobuf:"bytes,10,opt,name=keep_firing_since,json=keepFiringSince,proto3,stdtime" json:"keep_firing_since"` } func (m *AlertStateDesc) Reset() { *m = AlertStateDesc{} } @@ -491,6 +490,20 @@ func (m *AlertStateDesc) GetState() string { return "" } +func (m *AlertStateDesc) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + +func (m *AlertStateDesc) GetAnnotations() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Annotations + } + return nil +} + func (m *AlertStateDesc) GetValue() float64 { if m != nil { return m.Value @@ -554,66 +567,65 @@ func init() { func init() { proto.RegisterFile("ruler.proto", fileDescriptor_9ecbec0a4cfddea6) } var fileDescriptor_9ecbec0a4cfddea6 = []byte{ - // 944 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcb, 0x6e, 0x23, 0x45, - 0x17, 0x76, 0x3b, 0xf1, 0xa5, 0x8f, 0x93, 0x4c, 0x52, 0xc9, 0xff, 0xd3, 0x63, 0x66, 0x3a, 0x96, - 0x11, 0x92, 0x85, 0x14, 0x07, 0x85, 0x08, 0x58, 0x20, 0x18, 0x47, 0x99, 0x41, 0x48, 0x08, 0xa1, - 0x76, 0x60, 0xdb, 0x2a, 0xdb, 0xe5, 0x4e, 0x2b, 0x7d, 0xa3, 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cf, 0x12, 0xa9, 0xb7, 0x73, 0x4e, 0xa3, 0x70, 0xe4, 0xe7, 0x89, - 0x0c, 0x23, 0xc7, 0x5e, 0x86, 0x06, 0x81, 0x5f, 0x28, 0x1c, 0xf9, 0x1c, 0xb6, 0xce, 0x18, 0xcb, - 0xfc, 0x71, 0xc8, 0xc3, 0x24, 0xf0, 0x45, 0x98, 0x0c, 0x99, 0x03, 0x4b, 0x90, 0xdd, 0x51, 0xf0, - 0x47, 0x88, 0xee, 0x2b, 0xf0, 0xc1, 0x37, 0x50, 0x51, 0x13, 0x82, 0x93, 0x43, 0xbd, 0x10, 0x64, - 0xfb, 0x96, 0x4f, 0x63, 0x73, 0x67, 0xd1, 0x69, 0x06, 0x75, 0x89, 0x3c, 0x00, 0xfb, 0x66, 0x7e, - 0x93, 0xd7, 0x4c, 0xd2, 0x8b, 0x1f, 0x80, 0xa6, 0xf3, 0x72, 0xa0, 0x60, 0x38, 0x3a, 0xbc, 0xbc, - 0x72, 0x4b, 0x4f, 0xaf, 0xdc, 0xd2, 0xf3, 0x2b, 0xd7, 0xfa, 0x76, 0xea, 0x5a, 0x3f, 0x4e, 0x5d, - 0xeb, 0xc9, 0xd4, 0xb5, 0x2e, 0xa7, 0xae, 0xf5, 0xdb, 0xd4, 0xb5, 0xfe, 0x98, 0xba, 0xa5, 0xe7, - 0x53, 0xd7, 0x7a, 0x7c, 0xed, 0x96, 0x2e, 0xaf, 0xdd, 0xd2, 0xd3, 0x6b, 0xb7, 0x34, 0xa8, 0xe2, - 0x29, 0xdf, 0xf9, 0x33, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x06, 0xe6, 0xa2, 0x1d, 0x09, 0x00, 0x00, + // 928 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x6e, 0x23, 0x45, + 0x10, 0xf6, 0x38, 0xfe, 0x9b, 0x72, 0x92, 0x4d,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0, 0x80, 0x02, 0xd8, 0x97, 0xe4, 0x29, 0xac, 0xaa, 0xb1, 0xf3, 0x05, 0x4b, 0xa4, 0xe2, 0x69, + 0x2c, 0xc3, 0xa3, 0x90, 0x03, 0x96, 0x48, 0xbd, 0x9d, 0x33, 0x1a, 0x85, 0x63, 0x3f, 0x4f, 0x64, + 0x18, 0x39, 0xf6, 0x32, 0x34, 0x08, 0xfc, 0x56, 0xe1, 0xc8, 0x37, 0xb0, 0x79, 0xca, 0x58, 0xe6, + 0x4f, 0x42, 0x1e, 0x26, 0x81, 0x2f, 0xc2, 0x64, 0xc4, 0x1c, 0x58, 0x82, 0xec, 0x81, 0x82, 0x3f, + 0x45, 0xf4, 0x40, 0x81, 0xf7, 0x7f, 0x80, 0xaa, 0xba, 0xa8, 0x9c, 0x1c, 0xe8, 0x85, 0x20, 0x5b, + 0x77, 0xfc, 0x43, 0xb5, 0xb6, 0x6f, 0x3a, 0xcd, 0x7b, 0x59, 0x22, 0x9f, 0x83, 0x7d, 0xfd, 0x8c, + 0x92, 0xb7, 0x4c, 0xd2, 0xab, 0xef, 0x70, 0xcb, 0xb9, 0x1d, 0x28, 0x18, 0x0e, 0x0f, 0x2e, 0x2e, + 0xdd, 0xd2, 0x8b, 0x4b, 0xb7, 0xf4, 0xf2, 0xd2, 0xb5, 0x7e, 0x9c, 0xb9, 0xd6, 0x2f, 0x33, 0xd7, + 0x7a, 0x3e, 0x73, 0xad, 0x8b, 0x99, 0x6b, 0xfd, 0x39, 0x73, 0xad, 0xbf, 0x66, 0x6e, 0xe9, 0xe5, + 0xcc, 0xb5, 0x9e, 0x5d, 0xb9, 0xa5, 0x8b, 0x2b, 0xb7, 0xf4, 0xe2, 0xca, 0x2d, 0x0d, 0x6b, 0xd8, + 0xe5, 0x07, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x49, 0x58, 0x92, 0xa4, 0x08, 0x00, 0x00, } func (x RulesRequest_RuleType) String() string { @@ -870,7 +882,7 @@ func (this *AlertStateDesc) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -878,7 +890,7 @@ func (this *AlertStateDesc) Equal(that interface{}) bool { return false } for i := range this.Annotations { - if !this.Annotations[i].Equal(that1.Annotations[i]) { + if !this.Annotations[i].Equal(&that1.Annotations[i]) { return false } } @@ -996,8 +1008,20 @@ func (this *AlertStateDesc) GoString() string { s := make([]string, 0, 14) s = append(s, "&ruler.AlertStateDesc{") s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } + if this.Annotations != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Annotations)) + for i := range vs { + vs[i] = &this.Annotations[i] + } + s = append(s, "Annotations: "+fmt.Sprintf("%#v", vs)+",\n") + } s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") s = append(s, "ActiveAt: "+fmt.Sprintf("%#v", this.ActiveAt)+",\n") s = append(s, "FiredAt: "+fmt.Sprintf("%#v", this.FiredAt)+",\n") @@ -1534,11 +1558,11 @@ func (m *AlertStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Annotations) > 0 { for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Annotations[iNdEx].Size() - i -= size - if _, err := m.Annotations[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Annotations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintRuler(dAtA, i, uint64(size)) } i-- @@ -1548,11 +1572,11 @@ func (m *AlertStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintRuler(dAtA, i, uint64(size)) } i-- @@ -1856,10 +1880,20 @@ func (this *AlertStateDesc) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" + repeatedStringForAnnotations := "[]LabelAdapter{" + for _, f := range this.Annotations { + repeatedStringForAnnotations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForAnnotations += "}" s := strings.Join([]string{`&AlertStateDesc{`, `State:` + fmt.Sprintf("%v", this.State) + `,`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, + `Labels:` + repeatedStringForLabels + `,`, + `Annotations:` + repeatedStringForAnnotations + `,`, `Value:` + fmt.Sprintf("%v", this.Value) + `,`, `ActiveAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ActiveAt), "Timestamp", "timestamppb.Timestamp", 1), `&`, ``, 1) + `,`, `FiredAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.FiredAt), "Timestamp", "timestamppb.Timestamp", 1), `&`, ``, 1) + `,`, @@ -2907,7 +2941,7 @@ func (m *AlertStateDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -2941,7 +2975,7 @@ func (m *AlertStateDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Annotations = append(m.Annotations, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Annotations = append(m.Annotations, mimirpb_custom.LabelAdapter{}) if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/ruler/ruler.proto b/pkg/ruler/ruler.proto index 1e3eb247289..be0af93281a 100644 --- a/pkg/ruler/ruler.proto +++ b/pkg/ruler/ruler.proto @@ -78,12 +78,10 @@ message RuleStateDesc { message AlertStateDesc { string state = 1; repeated cortexpb_custom.LabelAdapter labels = 2 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" + (gogoproto.nullable) = false ]; repeated cortexpb_custom.LabelAdapter annotations = 3 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" + (gogoproto.nullable) = false ]; double value = 4; google.protobuf.Timestamp active_at = 5 diff --git a/pkg/ruler/rulespb/rules.pb.go b/pkg/ruler/rulespb/rules.pb.go index 75200c7dd1a..1f451f5ed96 100644 --- a/pkg/ruler/rulespb/rules.pb.go +++ b/pkg/ruler/rulespb/rules.pb.go @@ -10,8 +10,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" types "github.com/gogo/protobuf/types" _ "github.com/grafana/mimir/pkg/mimirpb" - _ "github.com/grafana/mimir/pkg/mimirpb_custom" - github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" + mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" @@ -156,13 +155,13 @@ func (m *RuleGroupDesc) GetAlignEvaluationTimeOnInterval() bool { // RuleDesc is a proto representation of a Prometheus Rule type RuleDesc struct { - Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` - Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` - Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` - For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` - KeepFiringFor time.Duration `protobuf:"bytes,13,opt,name=keep_firing_for,json=keepFiringFor,proto3,stdduration" json:"keep_firing_for"` - Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` - Annotations []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,6,rep,name=annotations,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"annotations"` + Expr string `protobuf:"bytes,1,opt,name=expr,proto3" json:"expr,omitempty"` + Record string `protobuf:"bytes,2,opt,name=record,proto3" json:"record,omitempty"` + Alert string `protobuf:"bytes,3,opt,name=alert,proto3" json:"alert,omitempty"` + For time.Duration `protobuf:"bytes,4,opt,name=for,proto3,stdduration" json:"for"` + KeepFiringFor time.Duration `protobuf:"bytes,13,opt,name=keep_firing_for,json=keepFiringFor,proto3,stdduration" json:"keep_firing_for"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,5,rep,name=labels,proto3" json:"labels"` + Annotations []mimirpb_custom.LabelAdapter `protobuf:"bytes,6,rep,name=annotations,proto3" json:"annotations"` } func (m *RuleDesc) Reset() { *m = RuleDesc{} } @@ -232,6 +231,20 @@ func (m *RuleDesc) GetKeepFiringFor() time.Duration { return 0 } +func (m *RuleDesc) GetLabels() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Labels + } + return nil +} + +func (m *RuleDesc) GetAnnotations() []mimirpb_custom.LabelAdapter { + if m != nil { + return m.Annotations + } + return nil +} + func init() { proto.RegisterType((*RuleGroupDesc)(nil), "rules.RuleGroupDesc") proto.RegisterType((*RuleDesc)(nil), "rules.RuleDesc") @@ -240,47 +253,45 @@ func init() { func init() { proto.RegisterFile("rules.proto", fileDescriptor_8e722d3e922f0937) } var fileDescriptor_8e722d3e922f0937 = []byte{ - // 625 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x53, 0x3f, 0x6f, 0xd4, 0x3e, - 0x18, 0x8e, 0x7f, 0x97, 0xbb, 0xe6, 0x7c, 0xbf, 0x53, 0x2b, 0xab, 0x42, 0x69, 0x45, 0xdd, 0xa3, - 0x02, 0xe9, 0x16, 0x72, 0xa8, 0x08, 0x89, 0x05, 0x41, 0xab, 0x6b, 0x81, 0x02, 0xaa, 0x14, 0x75, - 0x62, 0x89, 0x9c, 0xd4, 0x09, 0x51, 0x13, 0x3b, 0x38, 0x4e, 0xe9, 0x6d, 0x30, 0xb0, 0x33, 0xf2, - 0x11, 0xf8, 0x28, 0x1d, 0x2b, 0xb1, 0x54, 0x0c, 0x85, 0xa6, 0x0b, 0x63, 0x3f, 0x02, 0xb2, 0x93, - 0xbb, 0xfe, 0x61, 0xb9, 0x2e, 0x4c, 0x7e, 0x1f, 0x3f, 0xef, 0xf3, 0xfe, 0xb5, 0x61, 0x47, 0x14, - 0x09, 0xcd, 0x9d, 0x4c, 0x70, 0xc9, 0x51, 0x53, 0x83, 0xc5, 0xfb, 0x51, 0x2c, 0xdf, 0x15, 0xbe, - 0x13, 0xf0, 0x74, 0x10, 0xf1, 0x88, 0x0f, 0x34, 0xeb, 0x17, 0xa1, 0x46, 0x1a, 0x68, 0xab, 0x52, - 0x2d, 0xe2, 0x88, 0xf3, 0x28, 0xa1, 0x17, 0x5e, 0xbb, 0x85, 0x20, 0x32, 0xe6, 0xac, 0xe6, 0x17, - 0xae, 0xf3, 0x84, 0x8d, 0x6a, 0xea, 0xc1, 0xe5, 0x4c, 0x82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 0x26, 0xa9, 0x58, 0x7f, 0xa6, 0xe2, 0xfc, 0x38, 0x59, - 0x7e, 0x7c, 0x83, 0x7f, 0x75, 0x25, 0x82, 0x5b, 0xa7, 0x43, 0x9f, 0x00, 0xec, 0x10, 0xc6, 0xb8, - 0x24, 0xd5, 0xc3, 0x6c, 0xfd, 0x9b, 0xf4, 0x97, 0x73, 0xea, 0xdd, 0x76, 0xd7, 0x9f, 0x1c, 0x9d, - 0x62, 0xe3, 0xf8, 0x14, 0x1b, 0xe7, 0xa7, 0x18, 0x7c, 0x2c, 0x31, 0xf8, 0x56, 0x62, 0x70, 0x58, - 0x62, 0x70, 0x54, 0x62, 0xf0, 0xab, 0xc4, 0xe0, 0x77, 0x89, 0x8d, 0xf3, 0x12, 0x83, 0x2f, 0x67, - 0xd8, 0x38, 0x3a, 0xc3, 0xc6, 0xf1, 0x19, 0x36, 0xde, 0xce, 0xe8, 0xef, 0x96, 0xf9, 0x7e, 0x4b, - 0x4f, 0xfb, 0xe1, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x5d, 0x2e, 0xd5, 0x1b, 0x05, 0x00, - 0x00, + // 608 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0x3f, 0x6f, 0xd3, 0x40, + 0x14, 0xb7, 0x1b, 0x27, 0x75, 0x2e, 0x44, 0xad, 0x4e, 0x15, 0x72, 0x2b, 0x7a, 0x0d, 0x15, 0x48, + 0x59, 0x70, 0x50, 0x11, 0x13, 0x42, 0xa8, 0x55, 0x5a, 0xa0, 0x80, 0x2a, 0x59, 0x9d, 0x58, 0xac, + 0x8b, 0xfb, 0x6c, 0xac, 0xda, 0x77, 0xe6, 0x7c, 0xae, 0x9a, 0x8d, 0x85, 0x9d, 0x91, 0x8f, 0xc0, + 0x47, 0xe9, 0xd8, 0xb1, 0x62, 0x00, 0xea, 0x2e, 0x8c, 0xfd,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0x8e, 0xea, 0xf9, 0xd7, 0x08, 0xaf, 0xa0, 0x26, 0x4d, 0x40, + 0x48, 0x3d, 0xf9, 0xb6, 0x57, 0x01, 0xfc, 0x14, 0x35, 0x42, 0x2e, 0x1c, 0x6b, 0xfe, 0x4a, 0x95, + 0x3f, 0x7e, 0x83, 0x96, 0x8e, 0x01, 0x32, 0x3f, 0x8c, 0x45, 0xcc, 0x22, 0x5f, 0x85, 0xf8, 0x8f, + 0x66, 0x75, 0x95, 0x76, 0x4f, 0x4b, 0xf7, 0xb8, 0xc0, 0xcf, 0x50, 0x2b, 0xa1, 0x23, 0x48, 0x72, + 0xa7, 0xa9, 0x37, 0x63, 0xdd, 0x0d, 0xb8, 0x90, 0x70, 0x3a, 0xfd, 0x15, 0xee, 0x5b, 0x45, 0x6f, + 0x1f, 0xd1, 0x4c, 0x82, 0xd8, 0xb1, 0x54, 0x1c, 0xaf, 0x96, 0xa8, 0x91, 0x51, 0xc6, 0xb8, 0xa4, + 0xd5, 0x6e, 0xb5, 0xe6, 0x8f, 0x30, 0xab, 0xd3, 0x2d, 0xee, 0xee, 0x3c, 0x3f, 0xbf, 0x24, 0xc6, + 0xc5, 0x25, 0x31, 0xae, 0x2f, 0x89, 0xf9, 0xa9, 0x24, 0xe6, 0xb7, 0x92, 0x98, 0x67, 0x25, 0x31, + 0xcf, 0x4b, 0x62, 0xfe, 0x2a, 0x89, 0xf9, 0xbb, 0x24, 0xc6, 0x75, 0x49, 0xcc, 0x2f, 0x57, 0xc4, + 0x38, 0xbf, 0x22, 0xc6, 0xc5, 0x15, 0x31, 0xde, 0x2f, 0xea, 0xad, 0xcf, 0x46, 0xa3, 0x96, 0x2e, + 0xfa, 0xc9, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x4a, 0xad, 0xe7, 0xa2, 0x04, 0x00, 0x00, } func (this *RuleGroupDesc) Equal(that interface{}) bool { @@ -387,7 +398,7 @@ func (this *RuleDesc) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -395,7 +406,7 @@ func (this *RuleDesc) Equal(that interface{}) bool { return false } for i := range this.Annotations { - if !this.Annotations[i].Equal(that1.Annotations[i]) { + if !this.Annotations[i].Equal(&that1.Annotations[i]) { return false } } @@ -435,8 +446,20 @@ func (this *RuleDesc) GoString() string { s = append(s, "Alert: "+fmt.Sprintf("%#v", this.Alert)+",\n") s = append(s, "For: "+fmt.Sprintf("%#v", this.For)+",\n") s = append(s, "KeepFiringFor: "+fmt.Sprintf("%#v", this.KeepFiringFor)+",\n") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") - s = append(s, "Annotations: "+fmt.Sprintf("%#v", this.Annotations)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } + if this.Annotations != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Annotations)) + for i := range vs { + vs[i] = &this.Annotations[i] + } + s = append(s, "Annotations: "+fmt.Sprintf("%#v", vs)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -594,11 +617,11 @@ func (m *RuleDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Annotations) > 0 { for iNdEx := len(m.Annotations) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Annotations[iNdEx].Size() - i -= size - if _, err := m.Annotations[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Annotations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintRules(dAtA, i, uint64(size)) } i-- @@ -608,11 +631,11 @@ func (m *RuleDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintRules(dAtA, i, uint64(size)) } i-- @@ -786,13 +809,23 @@ func (this *RuleDesc) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" + repeatedStringForAnnotations := "[]LabelAdapter{" + for _, f := range this.Annotations { + repeatedStringForAnnotations += fmt.Sprintf("%v", f) + "," + } + repeatedStringForAnnotations += "}" s := strings.Join([]string{`&RuleDesc{`, `Expr:` + fmt.Sprintf("%v", this.Expr) + `,`, `Record:` + fmt.Sprintf("%v", this.Record) + `,`, `Alert:` + fmt.Sprintf("%v", this.Alert) + `,`, `For:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.For), "Duration", "durationpb.Duration", 1), `&`, ``, 1) + `,`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, - `Annotations:` + fmt.Sprintf("%v", this.Annotations) + `,`, + `Labels:` + repeatedStringForLabels + `,`, + `Annotations:` + repeatedStringForAnnotations + `,`, `KeepFiringFor:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.KeepFiringFor), "Duration", "durationpb.Duration", 1), `&`, ``, 1) + `,`, `}`, }, "") @@ -1361,7 +1394,7 @@ func (m *RuleDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1395,7 +1428,7 @@ func (m *RuleDesc) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Annotations = append(m.Annotations, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Annotations = append(m.Annotations, mimirpb_custom.LabelAdapter{}) if err := m.Annotations[len(m.Annotations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/ruler/rulespb/rules.proto b/pkg/ruler/rulespb/rules.proto index 43af738fbe2..27dd45263d7 100644 --- a/pkg/ruler/rulespb/rules.proto +++ b/pkg/ruler/rulespb/rules.proto @@ -49,11 +49,9 @@ message RuleDesc { google.protobuf.Duration for = 4 [(gogoproto.nullable) = false,(gogoproto.stdduration) = true]; google.protobuf.Duration keep_firing_for = 13 [(gogoproto.nullable) = false,(gogoproto.stdduration) = true]; repeated cortexpb_custom.LabelAdapter labels = 5 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" + (gogoproto.nullable) = false ]; repeated cortexpb_custom.LabelAdapter annotations = 6 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" + (gogoproto.nullable) = false ]; } diff --git a/pkg/storegateway/storepb/types.pb.go b/pkg/storegateway/storepb/types.pb.go index 1cf309b981f..b06c35368dc 100644 --- a/pkg/storegateway/storepb/types.pb.go +++ b/pkg/storegateway/storepb/types.pb.go @@ -9,8 +9,7 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/grafana/mimir/pkg/mimirpb" github_com_grafana_mimir_pkg_mimirpb "github.com/grafana/mimir/pkg/mimirpb" - _ "github.com/grafana/mimir/pkg/mimirpb_custom" - github_com_grafana_mimir_pkg_mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" + mimirpb_custom "github.com/grafana/mimir/pkg/mimirpb_custom" io "io" math "math" math_bits "math/bits" @@ -119,8 +118,8 @@ func (m *Chunk) XXX_DiscardUnknown() { var xxx_messageInfo_Chunk proto.InternalMessageInfo type Series struct { - Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` - Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` + Chunks []AggrChunk `protobuf:"bytes,2,rep,name=chunks,proto3" json:"chunks"` } func (m *Series) Reset() { *m = Series{} } @@ -156,7 +155,7 @@ func (m *Series) XXX_DiscardUnknown() { var xxx_messageInfo_Series proto.InternalMessageInfo type StreamingSeries struct { - Labels []github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter" json:"labels"` + Labels []mimirpb_custom.LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"` } func (m *StreamingSeries) Reset() { *m = StreamingSeries{} } @@ -431,53 +430,52 @@ func init() { func init() { proto.RegisterFile("types.proto", fileDescriptor_d938547f84707355) } var fileDescriptor_d938547f84707355 = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0x41, 0x6f, 0xd3, 0x48, - 0x14, 0xf6, 0x24, 0x4e, 0xe2, 0x4c, 0xda, 0xad, 0x77, 0x9a, 0xdd, 0xa6, 0x95, 0xd6, 0xcd, 0x5a, - 0x5a, 0x29, 0x5a, 0xa9, 0x0e, 0x0a, 0x3d, 0x70, 0xe0, 0x40, 0x53, 0x02, 0x25, 0xa2, 0x94, 0xba, - 0x45, 0x42, 0x08, 0xc9, 0x9a, 0x38, 0x13, 0x67, 0xd4, 0xd8, 0x8e, 0x3c, 0x13, 0x9a, 0x1e, 0x90, - 0x38, 0x71, 0xe0, 0xc4, 0xcf, 0xe0, 0x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10, 0x21, 0x2d, 0x6f, 0xcb, - 0xc0, 0x7c, 0x0d, 0xd5, 0xb8, 0x2e, 0xbe, 0xe9, 0xd3, 0xcd, 0x9c, 0xc6, 0xae, 0xae, 0xa0, 0x22, - 0xd4, 0x67, 0x92, 0xcf, 0x1a, 0xbb, 0x3a, 0xb8, 0x46, 0xb5, 0x1b, 0x7a, 0xea, 0x3a, 0xd5, 0x6e, - 0xe8, 0xe9, 0xfa, 0xc6, 0xf1, 0xc8, 0x50, 0x4e, 0x46, 0x86, 0x72, 0x3a, 0x32, 0x94, 0x8b, 0x91, - 0x01, 0xde, 0x8d, 0x0d, 0xf0, 0x69, 0x6c, 0x80, 0xe3, 0xb1, 0x01, 0x4e, 0xc6, 0x06, 0xf8, 0x3e, - 0x36, 0xc0, 0x8f, 0xb1, 0xa1, 0x5c, 0x8c, 0x0d, 0xf0, 0xf1, 0xdc, 0x50, 0x4e, 0xce, 0x0d, 0xe5, - 0xf4, 0xdc, 0x50, 0x5e, 0xe5, 0x18, 0x0f, 0x23, 0xd2, 0x6f, 0xb5, 0xb2, 0xe2, 0xb1, 0xbc, 0xfb, - 0x33, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x3f, 0xfd, 0xb3, 0xea, 0x05, 0x00, 0x00, + // 716 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x4e, 0xdb, 0x4a, + 0x14, 0xf6, 0x24, 0x4e, 0xe2, 0x4c, 0xe0, 0xe2, 0x3b, 0xe4, 0x5e, 0x02, 0xd2, 0x35, 0xb9, 0x96, + 0x2a, 0x45, 0x95, 0x70, 0xaa, 0x94, 0x5d, 0xbb, 0x21, 0x34, 0x2d, 0x8d, 0x0a, 0x14, 0x43, 0xa5, + 0xaa, 0xaa, 0x64, 0x4d, 0x9c, 0x89, 0x33, 0x22, 0xb6, 0x23, 0xcf, 0x84, 0x86, 0x45, 0xa5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, + 0xe6, 0x5b, 0xa8, 0x26, 0xba, 0xe4, 0xde, 0x66, 0x93, 0x39, 0xad, 0x3d, 0x5d, 0x41, 0x65, 0xa8, + 0x5f, 0x0b, 0xee, 0xb4, 0xf6, 0x74, 0x70, 0x8b, 0x6a, 0xb7, 0xf4, 0xcc, 0x6d, 0xaa, 0xdd, 0xd2, + 0xb3, 0xcd, 0x8d, 0x93, 0x89, 0xa1, 0x9c, 0x4e, 0x0c, 0xe5, 0x6c, 0x62, 0x28, 0x97, 0x13, 0x03, + 0x7c, 0x88, 0x0d, 0xf0, 0x39, 0x36, 0xc0, 0x49, 0x6c, 0x80, 0xd3, 0xd8, 0x00, 0xdf, 0x63, 0x03, + 0xfc, 0x88, 0x0d, 0xe5, 0x32, 0x36, 0xc0, 0xa7, 0x0b, 0x43, 0x39, 0xbd, 0x30, 0x94, 0xb3, 0x0b, + 0x43, 0x79, 0x53, 0x60, 0x3c, 0x8c, 0xc8, 0xb0, 0xd3, 0xc9, 0x8b, 0x4f, 0xd6, 0xc3, 0x9f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x20, 0x90, 0xd8, 0x46, 0x70, 0x05, 0x00, 0x00, } func (x Chunk_Encoding) String() string { @@ -544,7 +542,7 @@ func (this *Series) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -581,7 +579,7 @@ func (this *StreamingSeries) Equal(that interface{}) bool { return false } for i := range this.Labels { - if !this.Labels[i].Equal(that1.Labels[i]) { + if !this.Labels[i].Equal(&that1.Labels[i]) { return false } } @@ -781,7 +779,13 @@ func (this *Series) GoString() string { } s := make([]string, 0, 6) s = append(s, "&storepb.Series{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } if this.Chunks != nil { vs := make([]*AggrChunk, len(this.Chunks)) for i := range vs { @@ -798,7 +802,13 @@ func (this *StreamingSeries) GoString() string { } s := make([]string, 0, 5) s = append(s, "&storepb.StreamingSeries{") - s = append(s, "Labels: "+fmt.Sprintf("%#v", this.Labels)+",\n") + if this.Labels != nil { + vs := make([]*mimirpb_custom.LabelAdapter, len(this.Labels)) + for i := range vs { + vs[i] = &this.Labels[i] + } + s = append(s, "Labels: "+fmt.Sprintf("%#v", vs)+",\n") + } s = append(s, "}") return strings.Join(s, "") } @@ -961,11 +971,11 @@ func (m *Series) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- @@ -998,11 +1008,11 @@ func (m *StreamingSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { if len(m.Labels) > 0 { for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- { { - size := m.Labels[iNdEx].Size() - i -= size - if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil { + size, err := m.Labels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size i = encodeVarintTypes(dAtA, i, uint64(size)) } i-- @@ -1433,13 +1443,18 @@ func (this *Series) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" repeatedStringForChunks := "[]AggrChunk{" for _, f := range this.Chunks { repeatedStringForChunks += strings.Replace(strings.Replace(f.String(), "AggrChunk", "AggrChunk", 1), `&`, ``, 1) + "," } repeatedStringForChunks += "}" s := strings.Join([]string{`&Series{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `Chunks:` + repeatedStringForChunks + `,`, `}`, }, "") @@ -1449,8 +1464,13 @@ func (this *StreamingSeries) String() string { if this == nil { return "nil" } + repeatedStringForLabels := "[]LabelAdapter{" + for _, f := range this.Labels { + repeatedStringForLabels += fmt.Sprintf("%v", f) + "," + } + repeatedStringForLabels += "}" s := strings.Join([]string{`&StreamingSeries{`, - `Labels:` + fmt.Sprintf("%v", this.Labels) + `,`, + `Labels:` + repeatedStringForLabels + `,`, `}`, }, "") return s @@ -1707,7 +1727,7 @@ func (m *Series) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -1828,7 +1848,7 @@ func (m *StreamingSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Labels = append(m.Labels, github_com_grafana_mimir_pkg_mimirpb_custom.LabelAdapter{}) + m.Labels = append(m.Labels, mimirpb_custom.LabelAdapter{}) if err := m.Labels[len(m.Labels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/pkg/storegateway/storepb/types.proto b/pkg/storegateway/storepb/types.proto index 6b65678e05f..f70e11bdf13 100644 --- a/pkg/storegateway/storepb/types.proto +++ b/pkg/storegateway/storepb/types.proto @@ -34,12 +34,12 @@ message Chunk { } message Series { - repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false]; repeated AggrChunk chunks = 2 [(gogoproto.nullable) = false]; } message StreamingSeries { - repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false, (gogoproto.customtype) = "github.com/grafana/mimir/pkg/mimirpb_custom.LabelAdapter"]; + repeated cortexpb_custom.LabelAdapter labels = 1 [(gogoproto.nullable) = false]; } message StreamingSeriesBatch {