From baebe1c59daa6acaa29769e9c1bd2cb0f3c699b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Pazos?= Date: Thu, 21 Dec 2023 15:30:18 -0300 Subject: [PATCH] make Metadata not nullable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolás Pazos --- prompb/write/v2/custom.go | 18 +++-- prompb/write/v2/types.pb.go | 135 +++++++++++++++++------------------- prompb/write/v2/types.proto | 2 +- 3 files changed, 73 insertions(+), 82 deletions(-) diff --git a/prompb/write/v2/custom.go b/prompb/write/v2/custom.go index 0f47b1454..5f543b467 100644 --- a/prompb/write/v2/custom.go +++ b/prompb/write/v2/custom.go @@ -92,18 +92,16 @@ func (m *TimeSeries) OptimizedMarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x30 } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a if len(m.Histograms) > 0 { for iNdEx := len(m.Histograms) - 1; iNdEx >= 0; iNdEx-- { { diff --git a/prompb/write/v2/types.pb.go b/prompb/write/v2/types.pb.go index 248e54017..8ebd561fd 100644 --- a/prompb/write/v2/types.pb.go +++ b/prompb/write/v2/types.pb.go @@ -162,7 +162,7 @@ type TimeSeries struct { Exemplars []Exemplar `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"` // Same as current version Histograms []Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms"` - Metadata *Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` + Metadata Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"` // Optional created timestamp for the metric in ms format, // if the first sample in samples does not contain 0 value. // See model/timestamp/timestamp.go for conversion from time.Time @@ -234,11 +234,11 @@ func (m *TimeSeries) GetHistograms() []Histogram { return nil } -func (m *TimeSeries) GetMetadata() *Metadata { +func (m *TimeSeries) GetMetadata() Metadata { if m != nil { return m.Metadata } - return nil + return Metadata{} } func (m *TimeSeries) GetCreatedTimestamp() int64 { @@ -748,59 +748,59 @@ func init() { func init() { proto.RegisterFile("write/v2/types.proto", fileDescriptor_4919b8b88a093366) } var fileDescriptor_4919b8b88a093366 = []byte{ - // 829 bytes of a gzipped FileDescriptorProto + // 831 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0xdd, 0x6e, 0xe3, 0x44, 0x14, 0xee, 0xc4, 0x49, 0x6c, 0x9f, 0xfc, 0xac, 0x3b, 0x14, 0x64, 0x10, 0xdb, 0x0d, 0x91, 0x80, - 0x08, 0xa4, 0x14, 0x02, 0x42, 0x02, 0xf5, 0x26, 0x59, 0xb2, 0x4d, 0x85, 0x9a, 0x48, 0x63, 0x57, - 0xab, 0xe5, 0x26, 0x9a, 0x26, 0x93, 0xc4, 0xc2, 0x7f, 0x78, 0x26, 0x81, 0xf2, 0x52, 0x3c, 0x05, - 0xd2, 0x5e, 0xf2, 0x04, 0x08, 0xf5, 0x01, 0x78, 0x06, 0x34, 0xe3, 0x9f, 0x69, 0x8b, 0x50, 0xef, - 0xe6, 0x7c, 0xe7, 0xfb, 0xe6, 0x7c, 0xe7, 0xf8, 0x8c, 0x0c, 0x27, 0xbf, 0x64, 0x81, 0x60, 0x67, - 0x87, 0xd1, 0x99, 0xb8, 0x4d, 0x19, 0x1f, 0xa6, 0x59, 0x22, 0x12, 0x6c, 0x29, 0x74, 0x78, 0x18, - 0x7d, 0x70, 0xb2, 0x4d, 0xb6, 0x89, 0x02, 0xcf, 0xe4, 0x29, 0xcf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 0x8a, 0x9d, 0xda, 0xdd, 0x0e, 0x29, 0xa2, 0xc9, 0xfb, 0x6f, 0xee, 0x4e, 0xd1, 0x5f, 0x77, + 0xa7, 0xe8, 0x9f, 0xbb, 0x53, 0xf4, 0x93, 0xa9, 0xfa, 0x3b, 0x8c, 0x6e, 0x9a, 0xea, 0x8f, 0xf2, + 0xcd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x13, 0xc8, 0xac, 0x89, 0x06, 0x00, 0x00, } func (m *WriteRequest) Marshal() (dAtA []byte, err error) { @@ -882,18 +882,16 @@ func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x30 } - if m.Metadata != nil { - { - size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTypes(dAtA, i, uint64(size)) + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err } - i-- - dAtA[i] = 0x2a + i -= size + i = encodeVarintTypes(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x2a if len(m.Histograms) > 0 { for iNdEx := len(m.Histograms) - 1; iNdEx >= 0; iNdEx-- { { @@ -1404,10 +1402,8 @@ func (m *TimeSeries) Size() (n int) { n += 1 + l + sovTypes(uint64(l)) } } - if m.Metadata != nil { - l = m.Metadata.Size() - n += 1 + l + sovTypes(uint64(l)) - } + l = m.Metadata.Size() + n += 1 + l + sovTypes(uint64(l)) if m.CreatedTimestamp != 0 { n += 1 + sovTypes(uint64(m.CreatedTimestamp)) } @@ -1959,9 +1955,6 @@ func (m *TimeSeries) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Metadata == nil { - m.Metadata = &Metadata{} - } if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } diff --git a/prompb/write/v2/types.proto b/prompb/write/v2/types.proto index f4fe50ba5..c225aa9ac 100644 --- a/prompb/write/v2/types.proto +++ b/prompb/write/v2/types.proto @@ -35,7 +35,7 @@ message TimeSeries { // Same as current version repeated Histogram histograms = 4 [(gogoproto.nullable) = false]; - Metadata metadata = 5; + Metadata metadata = 5 [(gogoproto.nullable) = false]; // Optional created timestamp for the metric in ms format, // if the first sample in samples does not contain 0 value.