From d4fa4314dbd6b9c9ee2024614f311a82de87f54d Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Thu, 21 Mar 2024 20:48:57 +0100 Subject: [PATCH 1/5] feat: read HTTP cookies as a map string to string slightly improve performance and avoid mapping errors now that we started indexing it with dynamic mapping. --- input/elasticapm/docs/spec/v2/error.json | 8 +- .../elasticapm/docs/spec/v2/transaction.json | 8 +- .../modeldecoder/modeldecoderutil/http.go | 14 + .../internal/modeldecoder/v2/decoder.go | 2 +- .../internal/modeldecoder/v2/model.go | 2 +- model/modelpb/cookies.pb.go | 171 ++++++++++++ model/modelpb/cookies_vtproto.pb.go | 257 ++++++++++++++++++ model/modelpb/http.pb.go | 137 +++++----- model/modelpb/http_vtproto.pb.go | 100 +++---- model/proto/cookies.proto | 27 ++ model/proto/http.proto | 4 +- 11 files changed, 608 insertions(+), 122 deletions(-) create mode 100644 model/modelpb/cookies.pb.go create mode 100644 model/modelpb/cookies_vtproto.pb.go create mode 100644 model/proto/cookies.proto diff --git a/input/elasticapm/docs/spec/v2/error.json b/input/elasticapm/docs/spec/v2/error.json index 1a421afc..373f0fc0 100644 --- a/input/elasticapm/docs/spec/v2/error.json +++ b/input/elasticapm/docs/spec/v2/error.json @@ -200,7 +200,13 @@ "type": [ "null", "object" - ] + ], + "additionalProperties": { + "type": [ + "null", + "string" + ] + } }, "env": { "description": "Env holds environment variable information passed to the monitored service.", diff --git a/input/elasticapm/docs/spec/v2/transaction.json b/input/elasticapm/docs/spec/v2/transaction.json index cdc6262f..bd13e84a 100644 --- a/input/elasticapm/docs/spec/v2/transaction.json +++ b/input/elasticapm/docs/spec/v2/transaction.json @@ -199,7 +199,13 @@ "type": [ "null", "object" - ] + ], + "additionalProperties": { + "type": [ + "null", + "string" + ] + } }, "env": { "description": "Env holds environment variable information passed to the monitored service.", diff --git a/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go b/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go index efe68842..e232222f 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go +++ b/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go @@ -45,6 +45,20 @@ func HTTPHeadersToStructPb(h http.Header) *structpb.Struct { return nil } +func HTTPCookiesToModelpb(m map[string]string, out []*modelpb.HTTPCookies) []*modelpb.HTTPCookies { + if len(m) == 0 { + return nil + } + out = Reslice(out, len(m), modelpb.HTTPCookiesFromVTPool) + i := 0 + for k, v := range m { + out[i].Key = k + out[i].Value = v + i++ + } + return out +} + func HTTPHeadersToModelpb(h http.Header, out []*modelpb.HTTPHeader) []*modelpb.HTTPHeader { if len(h) == 0 { return nil diff --git a/input/elasticapm/internal/modeldecoder/v2/decoder.go b/input/elasticapm/internal/modeldecoder/v2/decoder.go index 778d6d43..ba656d61 100644 --- a/input/elasticapm/internal/modeldecoder/v2/decoder.go +++ b/input/elasticapm/internal/modeldecoder/v2/decoder.go @@ -884,7 +884,7 @@ func mapToRequestModel(from contextRequest, out *modelpb.HTTPRequest) { out.Body = modeldecoderutil.ToValue(modeldecoderutil.NormalizeHTTPRequestBody(from.Body.Val)) } if len(from.Cookies) > 0 { - out.Cookies = modeldecoderutil.ToKv(from.Cookies, out.Cookies) + out.Cookies = modeldecoderutil.HTTPCookiesToModelpb(from.Cookies, out.Cookies) } if from.Headers.IsSet() { out.Headers = modeldecoderutil.HTTPHeadersToModelpb(from.Headers.Val, out.Headers) diff --git a/input/elasticapm/internal/modeldecoder/v2/model.go b/input/elasticapm/internal/modeldecoder/v2/model.go index 467fbd51..ec314464 100644 --- a/input/elasticapm/internal/modeldecoder/v2/model.go +++ b/input/elasticapm/internal/modeldecoder/v2/model.go @@ -188,7 +188,7 @@ type contextPage struct { type contextRequest struct { // Cookies used by the request, parsed as key-value objects. - Cookies map[string]any `json:"cookies"` + Cookies map[string]string `json:"cookies"` // Env holds environment variable information passed to the monitored service. Env map[string]any `json:"env"` // Body only contais the request bod, not the query string information. diff --git a/model/modelpb/cookies.pb.go b/model/modelpb/cookies.pb.go new file mode 100644 index 00000000..907b53ba --- /dev/null +++ b/model/modelpb/cookies.pb.go @@ -0,0 +1,171 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.3 +// source: cookies.proto + +package modelpb + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type HTTPCookies struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *HTTPCookies) Reset() { + *x = HTTPCookies{} + if protoimpl.UnsafeEnabled { + mi := &file_cookies_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HTTPCookies) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HTTPCookies) ProtoMessage() {} + +func (x *HTTPCookies) ProtoReflect() protoreflect.Message { + mi := &file_cookies_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HTTPCookies.ProtoReflect.Descriptor instead. +func (*HTTPCookies) Descriptor() ([]byte, []int) { + return file_cookies_proto_rawDescGZIP(), []int{0} +} + +func (x *HTTPCookies) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *HTTPCookies) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_cookies_proto protoreflect.FileDescriptor + +var file_cookies_proto_rawDesc = []byte{ + 0x0a, 0x0d, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x22, + 0x35, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, + 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_cookies_proto_rawDescOnce sync.Once + file_cookies_proto_rawDescData = file_cookies_proto_rawDesc +) + +func file_cookies_proto_rawDescGZIP() []byte { + file_cookies_proto_rawDescOnce.Do(func() { + file_cookies_proto_rawDescData = protoimpl.X.CompressGZIP(file_cookies_proto_rawDescData) + }) + return file_cookies_proto_rawDescData +} + +var file_cookies_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_cookies_proto_goTypes = []interface{}{ + (*HTTPCookies)(nil), // 0: elastic.apm.v1.HTTPCookies +} +var file_cookies_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_cookies_proto_init() } +func file_cookies_proto_init() { + if File_cookies_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_cookies_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*HTTPCookies); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_cookies_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_cookies_proto_goTypes, + DependencyIndexes: file_cookies_proto_depIdxs, + MessageInfos: file_cookies_proto_msgTypes, + }.Build() + File_cookies_proto = out.File + file_cookies_proto_rawDesc = nil + file_cookies_proto_goTypes = nil + file_cookies_proto_depIdxs = nil +} diff --git a/model/modelpb/cookies_vtproto.pb.go b/model/modelpb/cookies_vtproto.pb.go new file mode 100644 index 00000000..a08e1675 --- /dev/null +++ b/model/modelpb/cookies_vtproto.pb.go @@ -0,0 +1,257 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// protoc-gen-go-vtproto version: v0.5.1-0.20230920154146-d6fc6ac3381e +// source: cookies.proto + +package modelpb + +import ( + fmt "fmt" + io "io" + sync "sync" + + proto "google.golang.org/protobuf/proto" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +func (m *HTTPCookies) CloneVT() *HTTPCookies { + if m == nil { + return (*HTTPCookies)(nil) + } + r := HTTPCookiesFromVTPool() + r.Key = m.Key + r.Value = m.Value + if len(m.unknownFields) > 0 { + r.unknownFields = make([]byte, len(m.unknownFields)) + copy(r.unknownFields, m.unknownFields) + } + return r +} + +func (m *HTTPCookies) CloneMessageVT() proto.Message { + return m.CloneVT() +} + +func (m *HTTPCookies) MarshalVT() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVT(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPCookies) MarshalToVT(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVT(dAtA[:size]) +} + +func (m *HTTPCookies) MarshalToSizedBufferVT(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarint(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarint(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +var vtprotoPool_HTTPCookies = sync.Pool{ + New: func() interface{} { + return &HTTPCookies{} + }, +} + +func (m *HTTPCookies) ResetVT() { + if m != nil { + m.Reset() + } +} +func (m *HTTPCookies) ReturnToVTPool() { + if m != nil { + m.ResetVT() + vtprotoPool_HTTPCookies.Put(m) + } +} +func HTTPCookiesFromVTPool() *HTTPCookies { + return vtprotoPool_HTTPCookies.Get().(*HTTPCookies) +} +func (m *HTTPCookies) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sov(uint64(l)) + } + n += len(m.unknownFields) + return n +} + +func (m *HTTPCookies) UnmarshalVT(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPCookies: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPCookies: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + 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 ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + 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 ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skip(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLength + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/model/modelpb/http.pb.go b/model/modelpb/http.pb.go index 483e351f..3667ab55 100644 --- a/model/modelpb/http.pb.go +++ b/model/modelpb/http.pb.go @@ -110,10 +110,10 @@ type HTTPRequest struct { Body *structpb.Value `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` Headers []*HTTPHeader `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"` Env []*KeyValue `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` - Cookies []*KeyValue `protobuf:"bytes,4,rep,name=cookies,proto3" json:"cookies,omitempty"` Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"` Referrer string `protobuf:"bytes,7,opt,name=referrer,proto3" json:"referrer,omitempty"` + Cookies []*HTTPCookies `protobuf:"bytes,8,rep,name=cookies,proto3" json:"cookies,omitempty"` } func (x *HTTPRequest) Reset() { @@ -169,13 +169,6 @@ func (x *HTTPRequest) GetEnv() []*KeyValue { return nil } -func (x *HTTPRequest) GetCookies() []*KeyValue { - if x != nil { - return x.Cookies - } - return nil -} - func (x *HTTPRequest) GetId() string { if x != nil { return x.Id @@ -197,6 +190,13 @@ func (x *HTTPRequest) GetReferrer() string { return "" } +func (x *HTTPRequest) GetCookies() []*HTTPCookies { + if x != nil { + return x.Cookies + } + return nil +} + type HTTPResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -298,65 +298,66 @@ var file_http_proto_rawDesc = []byte{ 0x0a, 0x0a, 0x68, 0x74, 0x74, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, - 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, 0x04, 0x48, 0x54, - 0x54, 0x50, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, - 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, - 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x93, 0x02, - 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, - 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x34, 0x0a, 0x07, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6c, 0x61, + 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x63, 0x6f, 0x6f, 0x6b, + 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, 0x04, 0x48, 0x54, 0x54, + 0x50, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, - 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, - 0x2a, 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, - 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, - 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x32, 0x0a, 0x07, 0x63, - 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, - 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, - 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, - 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x72, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, - 0x72, 0x65, 0x72, 0x22, 0x96, 0x03, 0x0a, 0x0c, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, - 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x69, - 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, - 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x68, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x53, 0x65, 0x6e, 0x74, - 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x48, 0x02, 0x52, 0x0c, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, - 0x11, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x48, 0x03, 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, - 0x0a, 0x11, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, - 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x48, 0x04, 0x52, 0x0f, 0x64, 0x65, 0x63, - 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, - 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, - 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x0f, 0x0a, - 0x0d, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x10, - 0x0a, 0x0e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, - 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, - 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, - 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x2b, 0x5a, 0x29, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, - 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x02, 0x0a, + 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, + 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x34, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6c, 0x61, 0x73, + 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x48, + 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x2a, + 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, + 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, + 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x12, 0x35, + 0x0a, 0x07, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x48, 0x54, 0x54, 0x50, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x52, 0x07, 0x63, 0x6f, + 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0x96, 0x03, 0x0a, 0x0c, + 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, + 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, + 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, + 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, + 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x73, + 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x74, + 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x04, 0x48, 0x02, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x69, + 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, + 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x03, 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x53, + 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, + 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x04, 0x48, 0x04, 0x52, 0x0f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, + 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x66, 0x69, 0x6e, + 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x65, 0x6e, 0x63, + 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x14, + 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, + 0x73, 0x69, 0x7a, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, + 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -379,6 +380,7 @@ var file_http_proto_goTypes = []interface{}{ (*structpb.Value)(nil), // 3: google.protobuf.Value (*HTTPHeader)(nil), // 4: elastic.apm.v1.HTTPHeader (*KeyValue)(nil), // 5: elastic.apm.v1.KeyValue + (*HTTPCookies)(nil), // 6: elastic.apm.v1.HTTPCookies } var file_http_proto_depIdxs = []int32{ 1, // 0: elastic.apm.v1.HTTP.request:type_name -> elastic.apm.v1.HTTPRequest @@ -386,7 +388,7 @@ var file_http_proto_depIdxs = []int32{ 3, // 2: elastic.apm.v1.HTTPRequest.body:type_name -> google.protobuf.Value 4, // 3: elastic.apm.v1.HTTPRequest.headers:type_name -> elastic.apm.v1.HTTPHeader 5, // 4: elastic.apm.v1.HTTPRequest.env:type_name -> elastic.apm.v1.KeyValue - 5, // 5: elastic.apm.v1.HTTPRequest.cookies:type_name -> elastic.apm.v1.KeyValue + 6, // 5: elastic.apm.v1.HTTPRequest.cookies:type_name -> elastic.apm.v1.HTTPCookies 4, // 6: elastic.apm.v1.HTTPResponse.headers:type_name -> elastic.apm.v1.HTTPHeader 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type @@ -400,6 +402,7 @@ func file_http_proto_init() { if File_http_proto != nil { return } + file_cookies_proto_init() file_headers_proto_init() file_keyvalue_proto_init() if !protoimpl.UnsafeEnabled { diff --git a/model/modelpb/http_vtproto.pb.go b/model/modelpb/http_vtproto.pb.go index e03601bc..628103fb 100644 --- a/model/modelpb/http_vtproto.pb.go +++ b/model/modelpb/http_vtproto.pb.go @@ -87,7 +87,7 @@ func (m *HTTPRequest) CloneVT() *HTTPRequest { r.Env = tmpContainer } if rhs := m.Cookies; rhs != nil { - tmpContainer := make([]*KeyValue, len(rhs)) + tmpContainer := make([]*HTTPCookies, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } @@ -238,6 +238,18 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Cookies) > 0 { + for iNdEx := len(m.Cookies) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Cookies[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + } if len(m.Referrer) > 0 { i -= len(m.Referrer) copy(dAtA[i:], m.Referrer) @@ -259,18 +271,6 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if len(m.Cookies) > 0 { - for iNdEx := len(m.Cookies) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Cookies[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - } if len(m.Env) > 0 { for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { size, err := m.Env[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -539,12 +539,6 @@ func (m *HTTPRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } - if len(m.Cookies) > 0 { - for _, e := range m.Cookies { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } l = len(m.Id) if l > 0 { n += 1 + l + sov(uint64(l)) @@ -557,6 +551,12 @@ func (m *HTTPRequest) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + if len(m.Cookies) > 0 { + for _, e := range m.Cookies { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -905,11 +905,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 4: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cookies", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -919,36 +919,27 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if len(m.Cookies) == cap(m.Cookies) { - m.Cookies = append(m.Cookies, &KeyValue{}) - } else { - m.Cookies = m.Cookies[:len(m.Cookies)+1] - if m.Cookies[len(m.Cookies)-1] == nil { - m.Cookies[len(m.Cookies)-1] = &KeyValue{} - } - } - if err := m.Cookies[len(m.Cookies)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -976,11 +967,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Method = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Referrer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1008,13 +999,13 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Method = string(dAtA[iNdEx:postIndex]) + m.Referrer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 7: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Referrer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cookies", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -1024,23 +1015,32 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Referrer = string(dAtA[iNdEx:postIndex]) + if len(m.Cookies) == cap(m.Cookies) { + m.Cookies = append(m.Cookies, &HTTPCookies{}) + } else { + m.Cookies = m.Cookies[:len(m.Cookies)+1] + if m.Cookies[len(m.Cookies)-1] == nil { + m.Cookies[len(m.Cookies)-1] = &HTTPCookies{} + } + } + if err := m.Cookies[len(m.Cookies)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex diff --git a/model/proto/cookies.proto b/model/proto/cookies.proto new file mode 100644 index 00000000..975f1f08 --- /dev/null +++ b/model/proto/cookies.proto @@ -0,0 +1,27 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +syntax = "proto3"; + +package elastic.apm.v1; + +option go_package = "github.com/elastic/apm-data/model/modelpb"; + +message HTTPCookies { + string key = 1; + string value = 2; +} diff --git a/model/proto/http.proto b/model/proto/http.proto index 76a30e71..de1f6537 100644 --- a/model/proto/http.proto +++ b/model/proto/http.proto @@ -20,6 +20,7 @@ syntax = "proto3"; package elastic.apm.v1; import "google/protobuf/struct.proto"; +import "cookies.proto"; import "headers.proto"; import "keyvalue.proto"; @@ -32,13 +33,14 @@ message HTTP { } message HTTPRequest { + reserved 4; google.protobuf.Value body = 1; repeated HTTPHeader headers = 2; repeated KeyValue env = 3; - repeated KeyValue cookies = 4; string id = 5; string method = 6; string referrer = 7; + repeated HTTPCookies cookies = 8; } message HTTPResponse { From 24dbfa6a3b8789cac8a520fa21523c64e9894fe8 Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Thu, 21 Mar 2024 21:17:08 +0100 Subject: [PATCH 2/5] test: update tests to use new cookies type --- codec/fullevent_test.go | 2 +- codec/utils_test.go | 9 ++++ .../modeldecodertest/populator.go | 2 + model/modeljson/apmevent.pb.json_test.go | 2 +- model/modeljson/http.pb.json_test.go | 2 +- model/modeljson/internal/http.go | 2 +- model/modeljson/internal/httpcookies.go | 41 +++++++++++++++++++ model/modeljson/util_test.go | 9 ++++ 8 files changed, 65 insertions(+), 4 deletions(-) create mode 100644 model/modeljson/internal/httpcookies.go diff --git a/codec/fullevent_test.go b/codec/fullevent_test.go index 87439446..6b4cc73a 100644 --- a/codec/fullevent_test.go +++ b/codec/fullevent_test.go @@ -356,7 +356,7 @@ func fullEvent(t *testing.B) *modelpb.APMEvent { Request: &modelpb.HTTPRequest{ Headers: randomHTTPHeaders(t), Env: randomKv(t), - Cookies: randomKv(t), + Cookies: randomHTTPCookies(t), Id: "id", Method: "method", Referrer: "referrer", diff --git a/codec/utils_test.go b/codec/utils_test.go index 94498013..6cc259e6 100644 --- a/codec/utils_test.go +++ b/codec/utils_test.go @@ -49,6 +49,15 @@ func randomHTTPHeaders(t testing.TB) []*modelpb.HTTPHeader { } } +func randomHTTPCookies(t testing.TB) []*modelpb.HTTPCookies { + return []*modelpb.HTTPCookies{ + { + Key: t.Name() + ".key." + randString(), + Value: t.Name() + ".value." + randString(), + }, + } +} + func uintPtr(i uint32) *uint32 { return &i } diff --git a/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go b/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go index 925edc3b..9966eb1e 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go +++ b/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go @@ -163,6 +163,8 @@ func SetStructValues(in interface{}, values *Values, opts ...SetStructValuesOpti switch v := f.Interface().(type) { case map[string]interface{}: elemVal = reflect.ValueOf(values.Str) + case map[string]string: + elemVal = reflect.ValueOf(values.Str) case map[string]float64: elemVal = reflect.ValueOf(values.Float) case map[string]*modelpb.LabelValue: diff --git a/model/modeljson/apmevent.pb.json_test.go b/model/modeljson/apmevent.pb.json_test.go index ea7271d6..6bf30130 100644 --- a/model/modeljson/apmevent.pb.json_test.go +++ b/model/modeljson/apmevent.pb.json_test.go @@ -377,7 +377,7 @@ func fullEvent(t testing.TB) *modelpb.APMEvent { Request: &modelpb.HTTPRequest{ Headers: randomHTTPHeaders(t), Env: randomKv(t), - Cookies: randomKv(t), + Cookies: randomHTTPCookies(t), Id: "id", Method: "method", Referrer: "referrer", diff --git a/model/modeljson/http.pb.json_test.go b/model/modeljson/http.pb.json_test.go index 91a9e9d8..397f6d7a 100644 --- a/model/modeljson/http.pb.json_test.go +++ b/model/modeljson/http.pb.json_test.go @@ -30,7 +30,7 @@ import ( func TestHTTPToModelJSON(t *testing.T) { headers := randomHTTPHeaders(t) headers2 := randomHTTPHeaders(t) - cookies := randomKv(t) + cookies := randomHTTPCookies(t) envs := randomKv(t) tru := true diff --git a/model/modeljson/internal/http.go b/model/modeljson/internal/http.go index e3709abb..dbee1551 100644 --- a/model/modeljson/internal/http.go +++ b/model/modeljson/internal/http.go @@ -30,7 +30,7 @@ type HTTPRequest struct { Method string `json:"method,omitempty"` Referrer string `json:"referrer,omitempty"` Env KeyValueSlice `json:"env,omitempty"` // Non-ECS field. - Cookies KeyValueSlice `json:"cookies,omitempty"` // Non-ECS field. + Cookies HTTPCookies `json:"cookies,omitempty"` // Non-ECS field. } type HTTPRequestBody struct { diff --git a/model/modeljson/internal/httpcookies.go b/model/modeljson/internal/httpcookies.go new file mode 100644 index 00000000..b2c51001 --- /dev/null +++ b/model/modeljson/internal/httpcookies.go @@ -0,0 +1,41 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package modeljson + +import ( + "github.com/elastic/apm-data/model/modelpb" + "go.elastic.co/fastjson" +) + +type HTTPCookies []*modelpb.HTTPCookies + +func (s *HTTPCookies) MarshalFastJSON(w *fastjson.Writer) error { + w.RawByte('{') + { + for i, kv := range *s { + if i != 0 { + w.RawByte(',') + } + w.String(kv.Key) + w.RawByte(':') + w.String(kv.Value) + } + } + w.RawByte('}') + return nil +} diff --git a/model/modeljson/util_test.go b/model/modeljson/util_test.go index 41a3cf91..a8f37c30 100644 --- a/model/modeljson/util_test.go +++ b/model/modeljson/util_test.go @@ -49,6 +49,15 @@ func randomHTTPHeaders(t testing.TB) []*modelpb.HTTPHeader { } } +func randomHTTPCookies(t testing.TB) []*modelpb.HTTPCookies { + return []*modelpb.HTTPCookies{ + { + Key: t.Name() + ".key." + randString(), + Value: t.Name() + ".value." + randString(), + }, + } +} + func uintPtr(i uint32) *uint32 { return &i } From 2d12b9df601628dbb303ffdfab75e98695fd5c69 Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:59:23 +0200 Subject: [PATCH 3/5] feat: replace keyvalue with keyvaluestring protobuf message remove interfaces as much as possible --- codec/fullevent_test.go | 4 +- codec/utils_test.go | 13 +- .../modeldecoder/modeldecoderutil/http.go | 4 +- .../modeldecoderutil/keyvaluepb.go | 14 +- .../modeldecoder/modeldecoderutil/structpb.go | 23 +- .../internal/modeldecoder/rumv3/error_test.go | 6 +- .../modeldecoder/rumv3/transaction_test.go | 6 +- .../internal/modeldecoder/v2/error_test.go | 6 +- .../internal/modeldecoder/v2/span_test.go | 2 +- .../modeldecoder/v2/transaction_test.go | 6 +- model/modeljson/apmevent.pb.json_test.go | 4 +- model/modeljson/context.go | 2 +- model/modeljson/internal/httpheader.go | 2 +- model/modeljson/internal/keyvalue.go | 9 +- model/modeljson/message.pb.json_test.go | 4 +- model/modeljson/util_test.go | 15 +- model/modelpb/error.pb.go | 180 ++++----- model/modelpb/error_vtproto.pb.go | 274 ++++++------- model/modelpb/headers.pb.go | 38 +- model/modelpb/headers_vtproto.pb.go | 36 +- model/modelpb/http.pb.go | 193 +++++----- model/modelpb/http_vtproto.pb.go | 362 +++++++++--------- model/modelpb/keyvalue.pb.go | 177 --------- model/modelpb/keyvaluestring.pb.go | 172 +++++++++ ...oto.pb.go => keyvaluestring_vtproto.pb.go} | 104 ++--- model/modelpb/message.pb.go | 62 +-- model/modelpb/message_vtproto.pb.go | 128 +++---- model/modelpb/stacktrace.pb.go | 171 +++++---- model/modelpb/stacktrace_vtproto.pb.go | 148 +++---- model/modelpb/transaction.pb.go | 225 +++++------ model/modelpb/transaction_vtproto.pb.go | 152 ++++---- model/proto/error.proto | 8 +- model/proto/headers.proto | 2 +- model/proto/http.proto | 11 +- .../{keyvalue.proto => keyvaluestring.proto} | 6 +- model/proto/message.proto | 3 +- model/proto/stacktrace.proto | 5 +- model/proto/transaction.proto | 5 +- 38 files changed, 1267 insertions(+), 1315 deletions(-) delete mode 100644 model/modelpb/keyvalue.pb.go create mode 100644 model/modelpb/keyvaluestring.pb.go rename model/modelpb/{keyvalue_vtproto.pb.go => keyvaluestring_vtproto.pb.go} (66%) rename model/proto/{keyvalue.proto => keyvaluestring.proto} (90%) diff --git a/codec/fullevent_test.go b/codec/fullevent_test.go index 6b4cc73a..3fb37ca4 100644 --- a/codec/fullevent_test.go +++ b/codec/fullevent_test.go @@ -30,7 +30,7 @@ func fullEvent(t *testing.B) *modelpb.APMEvent { Span: &modelpb.Span{ Message: &modelpb.Message{ Body: "body", - Headers: []*modelpb.HTTPHeader{ + Headers: []*modelpb.Header{ { Key: "foo", Value: []string{"bar"}, @@ -150,7 +150,7 @@ func fullEvent(t *testing.B) *modelpb.APMEvent { }, Message: &modelpb.Message{ Body: "body", - Headers: []*modelpb.HTTPHeader{ + Headers: []*modelpb.Header{ { Key: "foo", Value: []string{"bar"}, diff --git a/codec/utils_test.go b/codec/utils_test.go index 6cc259e6..ec8f3187 100644 --- a/codec/utils_test.go +++ b/codec/utils_test.go @@ -23,15 +23,12 @@ import ( "testing" "github.com/elastic/apm-data/model/modelpb" - "github.com/stretchr/testify/require" - "google.golang.org/protobuf/types/known/structpb" ) -func randomKv(t testing.TB) []*modelpb.KeyValue { - value, err := structpb.NewValue(t.Name() + ".value." + randString()) - require.NoError(t, err) +func randomKv(t testing.TB) []*modelpb.KeyValueString { + value := t.Name() + ".value." + randString() - kv := []*modelpb.KeyValue{ + kv := []*modelpb.KeyValueString{ { Key: t.Name() + ".key." + randString(), Value: value, @@ -40,8 +37,8 @@ func randomKv(t testing.TB) []*modelpb.KeyValue { return kv } -func randomHTTPHeaders(t testing.TB) []*modelpb.HTTPHeader { - return []*modelpb.HTTPHeader{ +func randomHTTPHeaders(t testing.TB) []*modelpb.Header { + return []*modelpb.Header{ { Key: t.Name() + ".key." + randString(), Value: []string{t.Name() + ".value." + randString()}, diff --git a/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go b/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go index e232222f..8f1fe149 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go +++ b/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go @@ -59,11 +59,11 @@ func HTTPCookiesToModelpb(m map[string]string, out []*modelpb.HTTPCookies) []*mo return out } -func HTTPHeadersToModelpb(h http.Header, out []*modelpb.HTTPHeader) []*modelpb.HTTPHeader { +func HTTPHeadersToModelpb(h http.Header, out []*modelpb.Header) []*modelpb.Header { if len(h) == 0 { return nil } - out = Reslice(out, len(h), modelpb.HTTPHeaderFromVTPool) + out = Reslice(out, len(h), modelpb.HeaderFromVTPool) i := 0 for k, v := range h { out[i].Key = k diff --git a/input/elasticapm/internal/modeldecoder/modeldecoderutil/keyvaluepb.go b/input/elasticapm/internal/modeldecoder/modeldecoderutil/keyvaluepb.go index c73d7bb5..37f2221c 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecoderutil/keyvaluepb.go +++ b/input/elasticapm/internal/modeldecoder/modeldecoderutil/keyvaluepb.go @@ -19,23 +19,23 @@ package modeldecoderutil import ( "github.com/elastic/apm-data/model/modelpb" - "google.golang.org/protobuf/types/known/structpb" ) -func ToKv(m map[string]any, out []*modelpb.KeyValue) []*modelpb.KeyValue { +func ToKv(m map[string]any, out []*modelpb.KeyValueString) []*modelpb.KeyValueString { m = normalizeMap(m) if len(m) == 0 { return nil } - out = Reslice(out, len(m), modelpb.KeyValueFromVTPool) + out = Reslice(out, len(m), modelpb.KeyValueStringFromVTPool) i := 0 for k, v := range m { - value, _ := structpb.NewValue(v) - out[i].Key = k - out[i].Value = value - i++ + if s, ok := v.(string); ok { + out[i].Key = k + out[i].Value = s + i++ + } } return out diff --git a/input/elasticapm/internal/modeldecoder/modeldecoderutil/structpb.go b/input/elasticapm/internal/modeldecoder/modeldecoderutil/structpb.go index b501f2d5..647b697e 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecoderutil/structpb.go +++ b/input/elasticapm/internal/modeldecoder/modeldecoderutil/structpb.go @@ -19,22 +19,11 @@ package modeldecoderutil import ( "encoding/json" + "fmt" "google.golang.org/protobuf/types/known/structpb" ) -func ToStruct(m map[string]any) *structpb.Struct { - nm := normalizeMap(m) - if len(nm) == 0 { - return nil - } - - if str, err := structpb.NewStruct(nm); err == nil { - return str - } - return nil -} - func ToValue(a any) *structpb.Value { nv := normalizeValue(a) if nv == nil { @@ -48,10 +37,14 @@ func ToValue(a any) *structpb.Value { } func normalizeMap(m map[string]any) map[string]any { - if v := normalizeValue(m); v != nil { - return v.(map[string]any) + for k, v := range m { + switch v := v.(type) { + case string: + default: + m[k] = fmt.Sprint(v) + } } - return nil + return m } func normalizeValue(v interface{}) interface{} { diff --git a/input/elasticapm/internal/modeldecoder/rumv3/error_test.go b/input/elasticapm/internal/modeldecoder/rumv3/error_test.go index 6fd11c4b..fef67ba5 100644 --- a/input/elasticapm/internal/modeldecoder/rumv3/error_test.go +++ b/input/elasticapm/internal/modeldecoder/rumv3/error_test.go @@ -206,7 +206,7 @@ func TestDecodeMapToErrorModel(t *testing.T) { input.Context.Response.Headers.Set(http.Header{"f": []string{"g"}}) var out modelpb.APMEvent mapToErrorModel(&input, &out) - assert.Empty(t, cmp.Diff([]*modelpb.HTTPHeader{ + assert.Empty(t, cmp.Diff([]*modelpb.Header{ { Key: "a", Value: []string{"b"}, @@ -216,13 +216,13 @@ func TestDecodeMapToErrorModel(t *testing.T) { Value: []string{"d", "e"}, }, }, out.Http.Request.Headers, - cmpopts.SortSlices(func(x, y *modelpb.HTTPHeader) bool { + cmpopts.SortSlices(func(x, y *modelpb.Header) bool { return x.Key < y.Key }), protocmp.Transform(), )) - assert.Equal(t, []*modelpb.HTTPHeader{ + assert.Equal(t, []*modelpb.Header{ { Key: "f", Value: []string{"g"}, diff --git a/input/elasticapm/internal/modeldecoder/rumv3/transaction_test.go b/input/elasticapm/internal/modeldecoder/rumv3/transaction_test.go index 721fa357..e5d5f026 100644 --- a/input/elasticapm/internal/modeldecoder/rumv3/transaction_test.go +++ b/input/elasticapm/internal/modeldecoder/rumv3/transaction_test.go @@ -357,7 +357,7 @@ func TestDecodeMapToTransactionModel(t *testing.T) { input.Context.Response.Headers.Set(http.Header{"f": []string{"g"}}) var out modelpb.APMEvent mapToTransactionModel(&input, &out) - assert.Empty(t, cmp.Diff([]*modelpb.HTTPHeader{ + assert.Empty(t, cmp.Diff([]*modelpb.Header{ { Key: "a", Value: []string{"b"}, @@ -367,12 +367,12 @@ func TestDecodeMapToTransactionModel(t *testing.T) { Value: []string{"d", "e"}, }, }, out.Http.Request.Headers, - cmpopts.SortSlices(func(x, y *modelpb.HTTPHeader) bool { + cmpopts.SortSlices(func(x, y *modelpb.Header) bool { return x.Key < y.Key }), protocmp.Transform(), )) - assert.Equal(t, []*modelpb.HTTPHeader{ + assert.Equal(t, []*modelpb.Header{ { Key: "f", Value: []string{"g"}, diff --git a/input/elasticapm/internal/modeldecoder/v2/error_test.go b/input/elasticapm/internal/modeldecoder/v2/error_test.go index bb07874a..1bf1a831 100644 --- a/input/elasticapm/internal/modeldecoder/v2/error_test.go +++ b/input/elasticapm/internal/modeldecoder/v2/error_test.go @@ -184,7 +184,7 @@ func TestDecodeMapToErrorModel(t *testing.T) { input.Context.Response.Headers.Set(http.Header{"f": []string{"g"}}) var out modelpb.APMEvent mapToErrorModel(&input, &out) - assert.Empty(t, cmp.Diff([]*modelpb.HTTPHeader{ + assert.Empty(t, cmp.Diff([]*modelpb.Header{ { Key: "a", Value: []string{"b"}, @@ -194,12 +194,12 @@ func TestDecodeMapToErrorModel(t *testing.T) { Value: []string{"d", "e"}, }, }, out.Http.Request.Headers, - cmpopts.SortSlices(func(x, y *modelpb.HTTPHeader) bool { + cmpopts.SortSlices(func(x, y *modelpb.Header) bool { return x.Key < y.Key }), protocmp.Transform(), )) - assert.Equal(t, []*modelpb.HTTPHeader{ + assert.Equal(t, []*modelpb.Header{ { Key: "f", Value: []string{"g"}, diff --git a/input/elasticapm/internal/modeldecoder/v2/span_test.go b/input/elasticapm/internal/modeldecoder/v2/span_test.go index ff931ed9..cc2c4409 100644 --- a/input/elasticapm/internal/modeldecoder/v2/span_test.go +++ b/input/elasticapm/internal/modeldecoder/v2/span_test.go @@ -280,7 +280,7 @@ func TestDecodeMapToSpanModel(t *testing.T) { input.Context.HTTP.Response.Headers.Set(http.Header{"a": []string{"b", "c"}}) var out modelpb.APMEvent mapToSpanModel(&input, &out) - assert.Equal(t, []*modelpb.HTTPHeader{ + assert.Equal(t, []*modelpb.Header{ { Key: "a", Value: []string{"b", "c"}, diff --git a/input/elasticapm/internal/modeldecoder/v2/transaction_test.go b/input/elasticapm/internal/modeldecoder/v2/transaction_test.go index e1e4859a..8519eae9 100644 --- a/input/elasticapm/internal/modeldecoder/v2/transaction_test.go +++ b/input/elasticapm/internal/modeldecoder/v2/transaction_test.go @@ -330,7 +330,7 @@ func TestDecodeMapToTransactionModel(t *testing.T) { input.Context.Response.Headers.Set(http.Header{"f": []string{"g"}}) var out modelpb.APMEvent mapToTransactionModel(&input, &out) - assert.Empty(t, cmp.Diff([]*modelpb.HTTPHeader{ + assert.Empty(t, cmp.Diff([]*modelpb.Header{ { Key: "a", Value: []string{"b"}, @@ -340,12 +340,12 @@ func TestDecodeMapToTransactionModel(t *testing.T) { Value: []string{"d", "e"}, }, }, out.Http.Request.Headers, - cmpopts.SortSlices(func(x, y *modelpb.HTTPHeader) bool { + cmpopts.SortSlices(func(x, y *modelpb.Header) bool { return x.Key < y.Key }), protocmp.Transform(), )) - assert.Empty(t, cmp.Diff([]*modelpb.HTTPHeader{ + assert.Empty(t, cmp.Diff([]*modelpb.Header{ { Key: "f", Value: []string{"g"}, diff --git a/model/modeljson/apmevent.pb.json_test.go b/model/modeljson/apmevent.pb.json_test.go index 6bf30130..163ef009 100644 --- a/model/modeljson/apmevent.pb.json_test.go +++ b/model/modeljson/apmevent.pb.json_test.go @@ -51,7 +51,7 @@ func fullEvent(t testing.TB) *modelpb.APMEvent { Span: &modelpb.Span{ Message: &modelpb.Message{ Body: "body", - Headers: []*modelpb.HTTPHeader{ + Headers: []*modelpb.Header{ { Key: "foo", Value: []string{"bar"}, @@ -171,7 +171,7 @@ func fullEvent(t testing.TB) *modelpb.APMEvent { }, Message: &modelpb.Message{ Body: "body", - Headers: []*modelpb.HTTPHeader{ + Headers: []*modelpb.Header{ { Key: "foo", Value: []string{"bar"}, diff --git a/model/modeljson/context.go b/model/modeljson/context.go index 760a80af..8b2d50c1 100644 --- a/model/modeljson/context.go +++ b/model/modeljson/context.go @@ -21,7 +21,7 @@ import "github.com/elastic/apm-data/model/modelpb" // updateFields transforms in, returning a copy with sanitized keys, // suitable for storing as "custom" in transaction and error documents. -func updateFields(in []*modelpb.KeyValue) { +func updateFields(in []*modelpb.KeyValueString) { for _, kv := range in { kv.Key = sanitizeLabelKey(kv.Key) } diff --git a/model/modeljson/internal/httpheader.go b/model/modeljson/internal/httpheader.go index 05298daa..80ae8d45 100644 --- a/model/modeljson/internal/httpheader.go +++ b/model/modeljson/internal/httpheader.go @@ -22,7 +22,7 @@ import ( "go.elastic.co/fastjson" ) -type HTTPHeaders []*modelpb.HTTPHeader +type HTTPHeaders []*modelpb.Header func (s *HTTPHeaders) MarshalFastJSON(w *fastjson.Writer) error { w.RawByte('{') diff --git a/model/modeljson/internal/keyvalue.go b/model/modeljson/internal/keyvalue.go index ecf59a4f..d88fa365 100644 --- a/model/modeljson/internal/keyvalue.go +++ b/model/modeljson/internal/keyvalue.go @@ -22,10 +22,9 @@ import ( "go.elastic.co/fastjson" ) -type KeyValueSlice []*modelpb.KeyValue +type KeyValueSlice []*modelpb.KeyValueString func (s *KeyValueSlice) MarshalFastJSON(w *fastjson.Writer) error { - var firstErr error w.RawByte('{') { for i, kv := range *s { @@ -34,11 +33,9 @@ func (s *KeyValueSlice) MarshalFastJSON(w *fastjson.Writer) error { } w.String(kv.Key) w.RawByte(':') - if err := fastjson.Marshal(w, kv.Value.AsInterface()); err != nil && firstErr == nil { - firstErr = err - } + w.String(kv.Value) } } w.RawByte('}') - return firstErr + return nil } diff --git a/model/modeljson/message.pb.json_test.go b/model/modeljson/message.pb.json_test.go index a13e80e8..bb35ef0b 100644 --- a/model/modeljson/message.pb.json_test.go +++ b/model/modeljson/message.pb.json_test.go @@ -41,7 +41,7 @@ func TestMessageToModelJSON(t *testing.T) { "full": { proto: &modelpb.Message{ Body: "body", - Headers: []*modelpb.HTTPHeader{ + Headers: []*modelpb.Header{ { Key: "foo", Value: []string{"bar"}, @@ -53,7 +53,7 @@ func TestMessageToModelJSON(t *testing.T) { }, expected: &modeljson.Message{ Body: "body", - Headers: []*modelpb.HTTPHeader{ + Headers: []*modelpb.Header{ { Key: "foo", Value: []string{"bar"}, diff --git a/model/modeljson/util_test.go b/model/modeljson/util_test.go index a8f37c30..5fa08322 100644 --- a/model/modeljson/util_test.go +++ b/model/modeljson/util_test.go @@ -23,16 +23,13 @@ import ( "testing" "github.com/elastic/apm-data/model/modelpb" - "github.com/stretchr/testify/require" - structpb "google.golang.org/protobuf/types/known/structpb" ) -func randomKv(t testing.TB) []*modelpb.KeyValue { - value, err := structpb.NewValue(t.Name() + ".value." + randString()) - require.NoError(t, err) +func randomKv(t testing.TB) []*modelpb.KeyValueString { + value := t.Name() + ".value." + randString() - kv := []*modelpb.KeyValue{ - &modelpb.KeyValue{ + kv := []*modelpb.KeyValueString{ + &modelpb.KeyValueString{ Key: t.Name() + ".key." + randString(), Value: value, }, @@ -40,8 +37,8 @@ func randomKv(t testing.TB) []*modelpb.KeyValue { return kv } -func randomHTTPHeaders(t testing.TB) []*modelpb.HTTPHeader { - return []*modelpb.HTTPHeader{ +func randomHTTPHeaders(t testing.TB) []*modelpb.Header { + return []*modelpb.Header{ { Key: t.Name() + ".key." + randString(), Value: []string{t.Name() + ".value." + randString()}, diff --git a/model/modelpb/error.pb.go b/model/modelpb/error.pb.go index a31cbbc6..9baefe0f 100644 --- a/model/modelpb/error.pb.go +++ b/model/modelpb/error.pb.go @@ -43,15 +43,15 @@ type Error struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Custom []*KeyValue `protobuf:"bytes,1,rep,name=custom,proto3" json:"custom,omitempty"` - Exception *Exception `protobuf:"bytes,2,opt,name=exception,proto3" json:"exception,omitempty"` - Log *ErrorLog `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` - Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` - GroupingKey string `protobuf:"bytes,5,opt,name=grouping_key,json=groupingKey,proto3" json:"grouping_key,omitempty"` - Culprit string `protobuf:"bytes,6,opt,name=culprit,proto3" json:"culprit,omitempty"` - StackTrace string `protobuf:"bytes,7,opt,name=stack_trace,json=stackTrace,proto3" json:"stack_trace,omitempty"` - Message string `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` - Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"` + Exception *Exception `protobuf:"bytes,2,opt,name=exception,proto3" json:"exception,omitempty"` + Log *ErrorLog `protobuf:"bytes,3,opt,name=log,proto3" json:"log,omitempty"` + Id string `protobuf:"bytes,4,opt,name=id,proto3" json:"id,omitempty"` + GroupingKey string `protobuf:"bytes,5,opt,name=grouping_key,json=groupingKey,proto3" json:"grouping_key,omitempty"` + Culprit string `protobuf:"bytes,6,opt,name=culprit,proto3" json:"culprit,omitempty"` + StackTrace string `protobuf:"bytes,7,opt,name=stack_trace,json=stackTrace,proto3" json:"stack_trace,omitempty"` + Message string `protobuf:"bytes,8,opt,name=message,proto3" json:"message,omitempty"` + Type string `protobuf:"bytes,9,opt,name=type,proto3" json:"type,omitempty"` + Custom []*KeyValueString `protobuf:"bytes,10,rep,name=custom,proto3" json:"custom,omitempty"` } func (x *Error) Reset() { @@ -86,13 +86,6 @@ func (*Error) Descriptor() ([]byte, []int) { return file_error_proto_rawDescGZIP(), []int{0} } -func (x *Error) GetCustom() []*KeyValue { - if x != nil { - return x.Custom - } - return nil -} - func (x *Error) GetException() *Exception { if x != nil { return x.Exception @@ -149,6 +142,13 @@ func (x *Error) GetType() string { return "" } +func (x *Error) GetCustom() []*KeyValueString { + if x != nil { + return x.Custom + } + return nil +} + type Exception struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -157,11 +157,11 @@ type Exception struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` Module string `protobuf:"bytes,2,opt,name=module,proto3" json:"module,omitempty"` Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` - Attributes []*KeyValue `protobuf:"bytes,4,rep,name=attributes,proto3" json:"attributes,omitempty"` Stacktrace []*StacktraceFrame `protobuf:"bytes,5,rep,name=stacktrace,proto3" json:"stacktrace,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` Handled *bool `protobuf:"varint,7,opt,name=handled,proto3,oneof" json:"handled,omitempty"` Cause []*Exception `protobuf:"bytes,8,rep,name=cause,proto3" json:"cause,omitempty"` + Attributes []*KeyValueString `protobuf:"bytes,9,rep,name=attributes,proto3" json:"attributes,omitempty"` } func (x *Exception) Reset() { @@ -217,13 +217,6 @@ func (x *Exception) GetCode() string { return "" } -func (x *Exception) GetAttributes() []*KeyValue { - if x != nil { - return x.Attributes - } - return nil -} - func (x *Exception) GetStacktrace() []*StacktraceFrame { if x != nil { return x.Stacktrace @@ -252,6 +245,13 @@ func (x *Exception) GetCause() []*Exception { return nil } +func (x *Exception) GetAttributes() []*KeyValueString { + if x != nil { + return x.Attributes + } + return nil +} + type ErrorLog struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -337,63 +337,65 @@ var file_error_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x1a, 0x10, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, - 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xba, 0x02, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, - 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x37, 0x0a, 0x09, 0x65, - 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x52, 0x03, 0x6c, 0x6f, 0x67, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, - 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x6c, 0x70, 0x72, 0x69, 0x74, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x75, 0x6c, 0x70, 0x72, 0x69, 0x74, 0x12, 0x1f, 0x0a, - 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x12, 0x18, - 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xbc, 0x02, 0x0a, - 0x09, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, - 0x12, 0x38, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x04, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, - 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x0a, - 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, - 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, - 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, - 0x53, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, - 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x1d, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, - 0x48, 0x00, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2f, - 0x0a, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, - 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x42, - 0x0a, 0x0a, 0x08, 0x5f, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x64, 0x22, 0xc1, 0x01, 0x0a, 0x08, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0c, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, - 0x0b, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0a, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3f, - 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x46, 0x72, - 0x61, 0x6d, 0x65, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x42, - 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, - 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, - 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x14, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x02, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, + 0x37, 0x0a, 0x09, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, + 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x65, + 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x03, 0x6c, 0x6f, 0x67, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, + 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x52, + 0x03, 0x6c, 0x6f, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, + 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x67, 0x72, 0x6f, 0x75, + 0x70, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x75, 0x6c, 0x70, 0x72, + 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x75, 0x6c, 0x70, 0x72, 0x69, + 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, + 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x12, 0x36, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1e, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xc8, + 0x02, 0x0a, 0x09, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x12, + 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, + 0x64, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, + 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, + 0x63, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, + 0x61, 0x63, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, + 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, + 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x05, 0x63, 0x61, 0x75, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, + 0x62, 0x75, 0x74, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x6c, + 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0a, 0x61, 0x74, 0x74, + 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x68, 0x61, 0x6e, 0x64, + 0x6c, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0xc1, 0x01, 0x0a, 0x08, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x5f, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, + 0x61, 0x72, 0x61, 0x6d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6c, + 0x6f, 0x67, 0x67, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0a, 0x6c, 0x6f, 0x67, 0x67, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x0a, + 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x1f, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x46, 0x72, 0x61, 0x6d, + 0x65, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x42, 0x2b, 0x5a, + 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, + 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -413,16 +415,16 @@ var file_error_proto_goTypes = []interface{}{ (*Error)(nil), // 0: elastic.apm.v1.Error (*Exception)(nil), // 1: elastic.apm.v1.Exception (*ErrorLog)(nil), // 2: elastic.apm.v1.ErrorLog - (*KeyValue)(nil), // 3: elastic.apm.v1.KeyValue + (*KeyValueString)(nil), // 3: elastic.apm.v1.KeyValueString (*StacktraceFrame)(nil), // 4: elastic.apm.v1.StacktraceFrame } var file_error_proto_depIdxs = []int32{ - 3, // 0: elastic.apm.v1.Error.custom:type_name -> elastic.apm.v1.KeyValue - 1, // 1: elastic.apm.v1.Error.exception:type_name -> elastic.apm.v1.Exception - 2, // 2: elastic.apm.v1.Error.log:type_name -> elastic.apm.v1.ErrorLog - 3, // 3: elastic.apm.v1.Exception.attributes:type_name -> elastic.apm.v1.KeyValue - 4, // 4: elastic.apm.v1.Exception.stacktrace:type_name -> elastic.apm.v1.StacktraceFrame - 1, // 5: elastic.apm.v1.Exception.cause:type_name -> elastic.apm.v1.Exception + 1, // 0: elastic.apm.v1.Error.exception:type_name -> elastic.apm.v1.Exception + 2, // 1: elastic.apm.v1.Error.log:type_name -> elastic.apm.v1.ErrorLog + 3, // 2: elastic.apm.v1.Error.custom:type_name -> elastic.apm.v1.KeyValueString + 4, // 3: elastic.apm.v1.Exception.stacktrace:type_name -> elastic.apm.v1.StacktraceFrame + 1, // 4: elastic.apm.v1.Exception.cause:type_name -> elastic.apm.v1.Exception + 3, // 5: elastic.apm.v1.Exception.attributes:type_name -> elastic.apm.v1.KeyValueString 4, // 6: elastic.apm.v1.ErrorLog.stacktrace:type_name -> elastic.apm.v1.StacktraceFrame 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type @@ -437,7 +439,7 @@ func file_error_proto_init() { return } file_stacktrace_proto_init() - file_keyvalue_proto_init() + file_keyvaluestring_proto_init() if !protoimpl.UnsafeEnabled { file_error_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Error); i { diff --git a/model/modelpb/error_vtproto.pb.go b/model/modelpb/error_vtproto.pb.go index a26be3f4..5c25a856 100644 --- a/model/modelpb/error_vtproto.pb.go +++ b/model/modelpb/error_vtproto.pb.go @@ -51,7 +51,7 @@ func (m *Error) CloneVT() *Error { r.Message = m.Message r.Type = m.Type if rhs := m.Custom; rhs != nil { - tmpContainer := make([]*KeyValue, len(rhs)) + tmpContainer := make([]*KeyValueString, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } @@ -77,13 +77,6 @@ func (m *Exception) CloneVT() *Exception { r.Module = m.Module r.Code = m.Code r.Type = m.Type - if rhs := m.Attributes; rhs != nil { - tmpContainer := make([]*KeyValue, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.Attributes = tmpContainer - } if rhs := m.Stacktrace; rhs != nil { tmpContainer := make([]*StacktraceFrame, len(rhs)) for k, v := range rhs { @@ -102,6 +95,13 @@ func (m *Exception) CloneVT() *Exception { } r.Cause = tmpContainer } + if rhs := m.Attributes; rhs != nil { + tmpContainer := make([]*KeyValueString, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Attributes = tmpContainer + } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -170,6 +170,18 @@ func (m *Error) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Custom) > 0 { + for iNdEx := len(m.Custom) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Custom[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + } if len(m.Type) > 0 { i -= len(m.Type) copy(dAtA[i:], m.Type) @@ -232,18 +244,6 @@ func (m *Error) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Custom) > 0 { - for iNdEx := len(m.Custom) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Custom[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -277,6 +277,18 @@ func (m *Exception) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Attributes[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } + } if len(m.Cause) > 0 { for iNdEx := len(m.Cause) - 1; iNdEx >= 0; iNdEx-- { size, err := m.Cause[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -318,18 +330,6 @@ func (m *Exception) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x2a } } - if len(m.Attributes) > 0 { - for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Attributes[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x22 - } - } if len(m.Code) > 0 { i -= len(m.Code) copy(dAtA[i:], m.Code) @@ -435,12 +435,12 @@ var vtprotoPool_Error = sync.Pool{ func (m *Error) ResetVT() { if m != nil { + m.Exception.ReturnToVTPool() + m.Log.ReturnToVTPool() for _, mm := range m.Custom { mm.ResetVT() } f0 := m.Custom[:0] - m.Exception.ReturnToVTPool() - m.Log.ReturnToVTPool() m.Reset() m.Custom = f0 } @@ -463,22 +463,22 @@ var vtprotoPool_Exception = sync.Pool{ func (m *Exception) ResetVT() { if m != nil { - for _, mm := range m.Attributes { - mm.ResetVT() - } - f0 := m.Attributes[:0] for _, mm := range m.Stacktrace { mm.ResetVT() } - f1 := m.Stacktrace[:0] + f0 := m.Stacktrace[:0] for _, mm := range m.Cause { mm.ResetVT() } - f2 := m.Cause[:0] + f1 := m.Cause[:0] + for _, mm := range m.Attributes { + mm.ResetVT() + } + f2 := m.Attributes[:0] m.Reset() - m.Attributes = f0 - m.Stacktrace = f1 - m.Cause = f2 + m.Stacktrace = f0 + m.Cause = f1 + m.Attributes = f2 } } func (m *Exception) ReturnToVTPool() { @@ -522,12 +522,6 @@ func (m *Error) SizeVT() (n int) { } var l int _ = l - if len(m.Custom) > 0 { - for _, e := range m.Custom { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } if m.Exception != nil { l = m.Exception.SizeVT() n += 1 + l + sov(uint64(l)) @@ -560,6 +554,12 @@ func (m *Error) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + if len(m.Custom) > 0 { + for _, e := range m.Custom { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -582,12 +582,6 @@ func (m *Exception) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if len(m.Attributes) > 0 { - for _, e := range m.Attributes { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } if len(m.Stacktrace) > 0 { for _, e := range m.Stacktrace { l = e.SizeVT() @@ -607,6 +601,12 @@ func (m *Exception) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -672,47 +672,6 @@ func (m *Error) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: Error: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if len(m.Custom) == cap(m.Custom) { - m.Custom = append(m.Custom, &KeyValue{}) - } else { - m.Custom = m.Custom[:len(m.Custom)+1] - if m.Custom[len(m.Custom)-1] == nil { - m.Custom[len(m.Custom)-1] = &KeyValue{} - } - } - if err := m.Custom[len(m.Custom)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Exception", wireType) @@ -977,6 +936,47 @@ func (m *Error) UnmarshalVT(dAtA []byte) error { } m.Type = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Custom) == cap(m.Custom) { + m.Custom = append(m.Custom, &KeyValueString{}) + } else { + m.Custom = m.Custom[:len(m.Custom)+1] + if m.Custom[len(m.Custom)-1] == nil { + m.Custom[len(m.Custom)-1] = &KeyValueString{} + } + } + if err := m.Custom[len(m.Custom)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) @@ -1124,47 +1124,6 @@ func (m *Exception) UnmarshalVT(dAtA []byte) error { } m.Code = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if len(m.Attributes) == cap(m.Attributes) { - m.Attributes = append(m.Attributes, &KeyValue{}) - } else { - m.Attributes = m.Attributes[:len(m.Attributes)+1] - if m.Attributes[len(m.Attributes)-1] == nil { - m.Attributes[len(m.Attributes)-1] = &KeyValue{} - } - } - if err := m.Attributes[len(m.Attributes)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 5: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Stacktrace", wireType) @@ -1300,6 +1259,47 @@ func (m *Exception) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Attributes) == cap(m.Attributes) { + m.Attributes = append(m.Attributes, &KeyValueString{}) + } else { + m.Attributes = m.Attributes[:len(m.Attributes)+1] + if m.Attributes[len(m.Attributes)-1] == nil { + m.Attributes[len(m.Attributes)-1] = &KeyValueString{} + } + } + if err := m.Attributes[len(m.Attributes)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/model/modelpb/headers.pb.go b/model/modelpb/headers.pb.go index 648a5f9a..d8e2a8cd 100644 --- a/model/modelpb/headers.pb.go +++ b/model/modelpb/headers.pb.go @@ -38,7 +38,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type HTTPHeader struct { +type Header struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -47,8 +47,8 @@ type HTTPHeader struct { Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` } -func (x *HTTPHeader) Reset() { - *x = HTTPHeader{} +func (x *Header) Reset() { + *x = Header{} if protoimpl.UnsafeEnabled { mi := &file_headers_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -56,13 +56,13 @@ func (x *HTTPHeader) Reset() { } } -func (x *HTTPHeader) String() string { +func (x *Header) String() string { return protoimpl.X.MessageStringOf(x) } -func (*HTTPHeader) ProtoMessage() {} +func (*Header) ProtoMessage() {} -func (x *HTTPHeader) ProtoReflect() protoreflect.Message { +func (x *Header) ProtoReflect() protoreflect.Message { mi := &file_headers_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -74,19 +74,19 @@ func (x *HTTPHeader) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use HTTPHeader.ProtoReflect.Descriptor instead. -func (*HTTPHeader) Descriptor() ([]byte, []int) { +// Deprecated: Use Header.ProtoReflect.Descriptor instead. +func (*Header) Descriptor() ([]byte, []int) { return file_headers_proto_rawDescGZIP(), []int{0} } -func (x *HTTPHeader) GetKey() string { +func (x *Header) GetKey() string { if x != nil { return x.Key } return "" } -func (x *HTTPHeader) GetValue() []string { +func (x *Header) GetValue() []string { if x != nil { return x.Value } @@ -98,13 +98,13 @@ var File_headers_proto protoreflect.FileDescriptor var file_headers_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x22, - 0x34, 0x0a, 0x0a, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, - 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, - 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, - 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x30, 0x0a, 0x06, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, + 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -121,7 +121,7 @@ func file_headers_proto_rawDescGZIP() []byte { var file_headers_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_headers_proto_goTypes = []interface{}{ - (*HTTPHeader)(nil), // 0: elastic.apm.v1.HTTPHeader + (*Header)(nil), // 0: elastic.apm.v1.Header } var file_headers_proto_depIdxs = []int32{ 0, // [0:0] is the sub-list for method output_type @@ -138,7 +138,7 @@ func file_headers_proto_init() { } if !protoimpl.UnsafeEnabled { file_headers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HTTPHeader); i { + switch v := v.(*Header); i { case 0: return &v.state case 1: diff --git a/model/modelpb/headers_vtproto.pb.go b/model/modelpb/headers_vtproto.pb.go index c5ef29e2..1897f8b8 100644 --- a/model/modelpb/headers_vtproto.pb.go +++ b/model/modelpb/headers_vtproto.pb.go @@ -37,11 +37,11 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -func (m *HTTPHeader) CloneVT() *HTTPHeader { +func (m *Header) CloneVT() *Header { if m == nil { - return (*HTTPHeader)(nil) + return (*Header)(nil) } - r := HTTPHeaderFromVTPool() + r := HeaderFromVTPool() r.Key = m.Key if rhs := m.Value; rhs != nil { tmpContainer := make([]string, len(rhs)) @@ -55,11 +55,11 @@ func (m *HTTPHeader) CloneVT() *HTTPHeader { return r } -func (m *HTTPHeader) CloneMessageVT() proto.Message { +func (m *Header) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *HTTPHeader) MarshalVT() (dAtA []byte, err error) { +func (m *Header) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -72,12 +72,12 @@ func (m *HTTPHeader) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPHeader) MarshalToVT(dAtA []byte) (int, error) { +func (m *Header) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *HTTPHeader) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *Header) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -108,29 +108,29 @@ func (m *HTTPHeader) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -var vtprotoPool_HTTPHeader = sync.Pool{ +var vtprotoPool_Header = sync.Pool{ New: func() interface{} { - return &HTTPHeader{} + return &Header{} }, } -func (m *HTTPHeader) ResetVT() { +func (m *Header) ResetVT() { if m != nil { f0 := m.Value[:0] m.Reset() m.Value = f0 } } -func (m *HTTPHeader) ReturnToVTPool() { +func (m *Header) ReturnToVTPool() { if m != nil { m.ResetVT() - vtprotoPool_HTTPHeader.Put(m) + vtprotoPool_Header.Put(m) } } -func HTTPHeaderFromVTPool() *HTTPHeader { - return vtprotoPool_HTTPHeader.Get().(*HTTPHeader) +func HeaderFromVTPool() *Header { + return vtprotoPool_Header.Get().(*Header) } -func (m *HTTPHeader) SizeVT() (n int) { +func (m *Header) SizeVT() (n int) { if m == nil { return 0 } @@ -150,7 +150,7 @@ func (m *HTTPHeader) SizeVT() (n int) { return n } -func (m *HTTPHeader) UnmarshalVT(dAtA []byte) error { +func (m *Header) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -173,10 +173,10 @@ func (m *HTTPHeader) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HTTPHeader: wiretype end group for non-group") + return fmt.Errorf("proto: Header: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HTTPHeader: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: Header: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/model/modelpb/http.pb.go b/model/modelpb/http.pb.go index 3667ab55..1f2fd105 100644 --- a/model/modelpb/http.pb.go +++ b/model/modelpb/http.pb.go @@ -107,13 +107,13 @@ type HTTPRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Body *structpb.Value `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Headers []*HTTPHeader `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"` - Env []*KeyValue `protobuf:"bytes,3,rep,name=env,proto3" json:"env,omitempty"` - Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` - Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"` - Referrer string `protobuf:"bytes,7,opt,name=referrer,proto3" json:"referrer,omitempty"` - Cookies []*HTTPCookies `protobuf:"bytes,8,rep,name=cookies,proto3" json:"cookies,omitempty"` + Body *structpb.Value `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + Id string `protobuf:"bytes,5,opt,name=id,proto3" json:"id,omitempty"` + Method string `protobuf:"bytes,6,opt,name=method,proto3" json:"method,omitempty"` + Referrer string `protobuf:"bytes,7,opt,name=referrer,proto3" json:"referrer,omitempty"` + Cookies []*HTTPCookies `protobuf:"bytes,8,rep,name=cookies,proto3" json:"cookies,omitempty"` + Headers []*Header `protobuf:"bytes,9,rep,name=headers,proto3" json:"headers,omitempty"` + Env []*KeyValueString `protobuf:"bytes,10,rep,name=env,proto3" json:"env,omitempty"` } func (x *HTTPRequest) Reset() { @@ -155,20 +155,6 @@ func (x *HTTPRequest) GetBody() *structpb.Value { return nil } -func (x *HTTPRequest) GetHeaders() []*HTTPHeader { - if x != nil { - return x.Headers - } - return nil -} - -func (x *HTTPRequest) GetEnv() []*KeyValue { - if x != nil { - return x.Env - } - return nil -} - func (x *HTTPRequest) GetId() string { if x != nil { return x.Id @@ -197,18 +183,32 @@ func (x *HTTPRequest) GetCookies() []*HTTPCookies { return nil } +func (x *HTTPRequest) GetHeaders() []*Header { + if x != nil { + return x.Headers + } + return nil +} + +func (x *HTTPRequest) GetEnv() []*KeyValueString { + if x != nil { + return x.Env + } + return nil +} + type HTTPResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Headers []*HTTPHeader `protobuf:"bytes,1,rep,name=headers,proto3" json:"headers,omitempty"` - Finished *bool `protobuf:"varint,2,opt,name=finished,proto3,oneof" json:"finished,omitempty"` - HeadersSent *bool `protobuf:"varint,3,opt,name=headers_sent,json=headersSent,proto3,oneof" json:"headers_sent,omitempty"` - TransferSize *uint64 `protobuf:"varint,4,opt,name=transfer_size,json=transferSize,proto3,oneof" json:"transfer_size,omitempty"` - EncodedBodySize *uint64 `protobuf:"varint,5,opt,name=encoded_body_size,json=encodedBodySize,proto3,oneof" json:"encoded_body_size,omitempty"` - DecodedBodySize *uint64 `protobuf:"varint,6,opt,name=decoded_body_size,json=decodedBodySize,proto3,oneof" json:"decoded_body_size,omitempty"` - StatusCode uint32 `protobuf:"varint,7,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + Finished *bool `protobuf:"varint,2,opt,name=finished,proto3,oneof" json:"finished,omitempty"` + HeadersSent *bool `protobuf:"varint,3,opt,name=headers_sent,json=headersSent,proto3,oneof" json:"headers_sent,omitempty"` + TransferSize *uint64 `protobuf:"varint,4,opt,name=transfer_size,json=transferSize,proto3,oneof" json:"transfer_size,omitempty"` + EncodedBodySize *uint64 `protobuf:"varint,5,opt,name=encoded_body_size,json=encodedBodySize,proto3,oneof" json:"encoded_body_size,omitempty"` + DecodedBodySize *uint64 `protobuf:"varint,6,opt,name=decoded_body_size,json=decodedBodySize,proto3,oneof" json:"decoded_body_size,omitempty"` + StatusCode uint32 `protobuf:"varint,7,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"` + Headers []*Header `protobuf:"bytes,8,rep,name=headers,proto3" json:"headers,omitempty"` } func (x *HTTPResponse) Reset() { @@ -243,13 +243,6 @@ func (*HTTPResponse) Descriptor() ([]byte, []int) { return file_http_proto_rawDescGZIP(), []int{2} } -func (x *HTTPResponse) GetHeaders() []*HTTPHeader { - if x != nil { - return x.Headers - } - return nil -} - func (x *HTTPResponse) GetFinished() bool { if x != nil && x.Finished != nil { return *x.Finished @@ -292,6 +285,13 @@ func (x *HTTPResponse) GetStatusCode() uint32 { return 0 } +func (x *HTTPResponse) GetHeaders() []*Header { + if x != nil { + return x.Headers + } + return nil +} + var File_http_proto protoreflect.FileDescriptor var file_http_proto_rawDesc = []byte{ @@ -300,64 +300,65 @@ var file_http_proto_rawDesc = []byte{ 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, 0x01, 0x0a, 0x04, 0x48, 0x54, 0x54, - 0x50, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x61, - 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0x9c, 0x02, 0x0a, - 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, - 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x34, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, - 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x65, 0x6c, 0x61, 0x73, - 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x48, - 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x2a, - 0x0a, 0x03, 0x65, 0x6e, 0x76, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, - 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, - 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x74, 0x68, - 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, 0x65, 0x72, 0x12, 0x35, - 0x0a, 0x07, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x48, 0x54, 0x54, 0x50, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x52, 0x07, 0x63, 0x6f, - 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, 0x96, 0x03, 0x0a, 0x0c, - 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x34, 0x0a, 0x07, - 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, - 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, - 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, - 0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x73, - 0x65, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x04, 0x48, 0x02, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x69, - 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, - 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, - 0x48, 0x03, 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x53, - 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, - 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x04, 0x48, 0x04, 0x52, 0x0f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, - 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x66, 0x69, 0x6e, + 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x91, + 0x01, 0x0a, 0x04, 0x48, 0x54, 0x54, 0x50, 0x12, 0x35, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, + 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x38, + 0x0a, 0x08, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, + 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x08, + 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, + 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, + 0x6f, 0x6e, 0x22, 0xaa, 0x02, 0x0a, 0x0b, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x0e, + 0x0a, 0x02, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, + 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x66, 0x65, 0x72, 0x72, + 0x65, 0x72, 0x12, 0x35, 0x0a, 0x07, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x18, 0x08, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x54, 0x54, 0x50, 0x43, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, + 0x52, 0x07, 0x63, 0x6f, 0x6f, 0x6b, 0x69, 0x65, 0x73, 0x12, 0x30, 0x0a, 0x07, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6c, 0x61, + 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, + 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x30, 0x0a, 0x03, 0x65, + 0x6e, 0x76, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, + 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x03, 0x65, 0x6e, 0x76, 0x4a, 0x04, 0x08, + 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x22, + 0x98, 0x03, 0x0a, 0x0c, 0x48, 0x54, 0x54, 0x50, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1f, 0x0a, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x08, 0x48, 0x00, 0x52, 0x08, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x88, 0x01, + 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x73, 0x65, 0x6e, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x64, 0x65, + 0x72, 0x73, 0x53, 0x65, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x28, 0x0a, 0x0d, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, + 0x48, 0x02, 0x52, 0x0c, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x53, 0x69, 0x7a, 0x65, + 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, + 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x48, 0x03, + 0x52, 0x0f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x69, 0x7a, + 0x65, 0x88, 0x01, 0x01, 0x12, 0x2f, 0x0a, 0x11, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, + 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x48, + 0x04, 0x52, 0x0f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x42, 0x6f, 0x64, 0x79, 0x53, 0x69, + 0x7a, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x5f, + 0x63, 0x6f, 0x64, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, + 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, + 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, + 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x66, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x42, 0x0f, 0x0a, 0x0d, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x5f, 0x73, 0x65, 0x6e, 0x74, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x5f, 0x62, 0x6f, 0x64, 0x79, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, - 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x69, 0x7a, 0x65, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, + 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -378,18 +379,18 @@ var file_http_proto_goTypes = []interface{}{ (*HTTPRequest)(nil), // 1: elastic.apm.v1.HTTPRequest (*HTTPResponse)(nil), // 2: elastic.apm.v1.HTTPResponse (*structpb.Value)(nil), // 3: google.protobuf.Value - (*HTTPHeader)(nil), // 4: elastic.apm.v1.HTTPHeader - (*KeyValue)(nil), // 5: elastic.apm.v1.KeyValue - (*HTTPCookies)(nil), // 6: elastic.apm.v1.HTTPCookies + (*HTTPCookies)(nil), // 4: elastic.apm.v1.HTTPCookies + (*Header)(nil), // 5: elastic.apm.v1.Header + (*KeyValueString)(nil), // 6: elastic.apm.v1.KeyValueString } var file_http_proto_depIdxs = []int32{ 1, // 0: elastic.apm.v1.HTTP.request:type_name -> elastic.apm.v1.HTTPRequest 2, // 1: elastic.apm.v1.HTTP.response:type_name -> elastic.apm.v1.HTTPResponse 3, // 2: elastic.apm.v1.HTTPRequest.body:type_name -> google.protobuf.Value - 4, // 3: elastic.apm.v1.HTTPRequest.headers:type_name -> elastic.apm.v1.HTTPHeader - 5, // 4: elastic.apm.v1.HTTPRequest.env:type_name -> elastic.apm.v1.KeyValue - 6, // 5: elastic.apm.v1.HTTPRequest.cookies:type_name -> elastic.apm.v1.HTTPCookies - 4, // 6: elastic.apm.v1.HTTPResponse.headers:type_name -> elastic.apm.v1.HTTPHeader + 4, // 3: elastic.apm.v1.HTTPRequest.cookies:type_name -> elastic.apm.v1.HTTPCookies + 5, // 4: elastic.apm.v1.HTTPRequest.headers:type_name -> elastic.apm.v1.Header + 6, // 5: elastic.apm.v1.HTTPRequest.env:type_name -> elastic.apm.v1.KeyValueString + 5, // 6: elastic.apm.v1.HTTPResponse.headers:type_name -> elastic.apm.v1.Header 7, // [7:7] is the sub-list for method output_type 7, // [7:7] is the sub-list for method input_type 7, // [7:7] is the sub-list for extension type_name @@ -404,7 +405,7 @@ func file_http_proto_init() { } file_cookies_proto_init() file_headers_proto_init() - file_keyvalue_proto_init() + file_keyvaluestring_proto_init() if !protoimpl.UnsafeEnabled { file_http_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*HTTP); i { diff --git a/model/modelpb/http_vtproto.pb.go b/model/modelpb/http_vtproto.pb.go index 628103fb..5ac781ba 100644 --- a/model/modelpb/http_vtproto.pb.go +++ b/model/modelpb/http_vtproto.pb.go @@ -72,26 +72,26 @@ func (m *HTTPRequest) CloneVT() *HTTPRequest { r.Body = proto.Clone(rhs).(*structpb.Value) } } - if rhs := m.Headers; rhs != nil { - tmpContainer := make([]*HTTPHeader, len(rhs)) + if rhs := m.Cookies; rhs != nil { + tmpContainer := make([]*HTTPCookies, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } - r.Headers = tmpContainer + r.Cookies = tmpContainer } - if rhs := m.Env; rhs != nil { - tmpContainer := make([]*KeyValue, len(rhs)) + if rhs := m.Headers; rhs != nil { + tmpContainer := make([]*Header, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } - r.Env = tmpContainer + r.Headers = tmpContainer } - if rhs := m.Cookies; rhs != nil { - tmpContainer := make([]*HTTPCookies, len(rhs)) + if rhs := m.Env; rhs != nil { + tmpContainer := make([]*KeyValueString, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } - r.Cookies = tmpContainer + r.Env = tmpContainer } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) @@ -110,13 +110,6 @@ func (m *HTTPResponse) CloneVT() *HTTPResponse { } r := HTTPResponseFromVTPool() r.StatusCode = m.StatusCode - if rhs := m.Headers; rhs != nil { - tmpContainer := make([]*HTTPHeader, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.Headers = tmpContainer - } if rhs := m.Finished; rhs != nil { tmpVal := *rhs r.Finished = &tmpVal @@ -137,6 +130,13 @@ func (m *HTTPResponse) CloneVT() *HTTPResponse { tmpVal := *rhs r.DecodedBodySize = &tmpVal } + if rhs := m.Headers; rhs != nil { + tmpContainer := make([]*Header, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Headers = tmpContainer + } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -238,6 +238,30 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Env) > 0 { + for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Env[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x52 + } + } + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x4a + } + } if len(m.Cookies) > 0 { for iNdEx := len(m.Cookies) - 1; iNdEx >= 0; iNdEx-- { size, err := m.Cookies[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) @@ -271,30 +295,6 @@ func (m *HTTPRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x2a } - if len(m.Env) > 0 { - for iNdEx := len(m.Env) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Env[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - } if m.Body != nil { if vtmsg, ok := interface{}(m.Body).(interface { MarshalToSizedBufferVT([]byte) (int, error) @@ -350,6 +350,18 @@ func (m *HTTPResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x42 + } + } if m.StatusCode != 0 { i = encodeVarint(dAtA, i, uint64(m.StatusCode)) i-- @@ -390,18 +402,6 @@ func (m *HTTPResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -436,22 +436,22 @@ var vtprotoPool_HTTPRequest = sync.Pool{ func (m *HTTPRequest) ResetVT() { if m != nil { - for _, mm := range m.Headers { + for _, mm := range m.Cookies { mm.ResetVT() } - f0 := m.Headers[:0] - for _, mm := range m.Env { + f0 := m.Cookies[:0] + for _, mm := range m.Headers { mm.ResetVT() } - f1 := m.Env[:0] - for _, mm := range m.Cookies { + f1 := m.Headers[:0] + for _, mm := range m.Env { mm.ResetVT() } - f2 := m.Cookies[:0] + f2 := m.Env[:0] m.Reset() - m.Headers = f0 - m.Env = f1 - m.Cookies = f2 + m.Cookies = f0 + m.Headers = f1 + m.Env = f2 } } func (m *HTTPRequest) ReturnToVTPool() { @@ -527,18 +527,6 @@ func (m *HTTPRequest) SizeVT() (n int) { } n += 1 + l + sov(uint64(l)) } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } - if len(m.Env) > 0 { - for _, e := range m.Env { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } l = len(m.Id) if l > 0 { n += 1 + l + sov(uint64(l)) @@ -557,6 +545,18 @@ func (m *HTTPRequest) SizeVT() (n int) { n += 1 + l + sov(uint64(l)) } } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, e := range m.Env { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -567,12 +567,6 @@ func (m *HTTPResponse) SizeVT() (n int) { } var l int _ = l - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } if m.Finished != nil { n += 2 } @@ -591,6 +585,12 @@ func (m *HTTPResponse) SizeVT() (n int) { if m.StatusCode != 0 { n += 1 + sov(uint64(m.StatusCode)) } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -823,11 +823,11 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } } iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -837,38 +837,29 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if len(m.Headers) == cap(m.Headers) { - m.Headers = append(m.Headers, &HTTPHeader{}) - } else { - m.Headers = m.Headers[:len(m.Headers)+1] - if m.Headers[len(m.Headers)-1] == nil { - m.Headers[len(m.Headers)-1] = &HTTPHeader{} - } - } - if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Id = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -878,36 +869,27 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if len(m.Env) == cap(m.Env) { - m.Env = append(m.Env, &KeyValue{}) - } else { - m.Env = m.Env[:len(m.Env)+1] - if m.Env[len(m.Env)-1] == nil { - m.Env[len(m.Env)-1] = &KeyValue{} - } - } - if err := m.Env[len(m.Env)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Method = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 5: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Referrer", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -935,13 +917,13 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Id = string(dAtA[iNdEx:postIndex]) + m.Referrer = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Cookies", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -951,29 +933,38 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Method = string(dAtA[iNdEx:postIndex]) + if len(m.Cookies) == cap(m.Cookies) { + m.Cookies = append(m.Cookies, &HTTPCookies{}) + } else { + m.Cookies = m.Cookies[:len(m.Cookies)+1] + if m.Cookies[len(m.Cookies)-1] == nil { + m.Cookies[len(m.Cookies)-1] = &HTTPCookies{} + } + } + if err := m.Cookies[len(m.Cookies)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 7: + case 9: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Referrer", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -983,27 +974,36 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLength } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - m.Referrer = string(dAtA[iNdEx:postIndex]) + if len(m.Headers) == cap(m.Headers) { + m.Headers = append(m.Headers, &Header{}) + } else { + m.Headers = m.Headers[:len(m.Headers)+1] + if m.Headers[len(m.Headers)-1] == nil { + m.Headers[len(m.Headers)-1] = &Header{} + } + } + if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 8: + case 10: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cookies", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1030,15 +1030,15 @@ func (m *HTTPRequest) UnmarshalVT(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if len(m.Cookies) == cap(m.Cookies) { - m.Cookies = append(m.Cookies, &HTTPCookies{}) + if len(m.Env) == cap(m.Env) { + m.Env = append(m.Env, &KeyValueString{}) } else { - m.Cookies = m.Cookies[:len(m.Cookies)+1] - if m.Cookies[len(m.Cookies)-1] == nil { - m.Cookies[len(m.Cookies)-1] = &HTTPCookies{} + m.Env = m.Env[:len(m.Env)+1] + if m.Env[len(m.Env)-1] == nil { + m.Env[len(m.Env)-1] = &KeyValueString{} } } - if err := m.Cookies[len(m.Cookies)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Env[len(m.Env)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1093,47 +1093,6 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: HTTPResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if len(m.Headers) == cap(m.Headers) { - m.Headers = append(m.Headers, &HTTPHeader{}) - } else { - m.Headers = m.Headers[:len(m.Headers)+1] - if m.Headers[len(m.Headers)-1] == nil { - m.Headers[len(m.Headers)-1] = &HTTPHeader{} - } - } - if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Finished", wireType) @@ -1255,6 +1214,47 @@ func (m *HTTPResponse) UnmarshalVT(dAtA []byte) error { break } } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Headers) == cap(m.Headers) { + m.Headers = append(m.Headers, &Header{}) + } else { + m.Headers = m.Headers[:len(m.Headers)+1] + if m.Headers[len(m.Headers)-1] == nil { + m.Headers[len(m.Headers)-1] = &Header{} + } + } + if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/model/modelpb/keyvalue.pb.go b/model/modelpb/keyvalue.pb.go deleted file mode 100644 index a7839146..00000000 --- a/model/modelpb/keyvalue.pb.go +++ /dev/null @@ -1,177 +0,0 @@ -// Licensed to Elasticsearch B.V. under one or more contributor -// license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright -// ownership. Elasticsearch B.V. licenses this file to you under -// the Apache License, Version 2.0 (the "License"); you may -// not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.24.3 -// source: keyvalue.proto - -package modelpb - -import ( - reflect "reflect" - sync "sync" - - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - structpb "google.golang.org/protobuf/types/known/structpb" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type KeyValue struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value *structpb.Value `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *KeyValue) Reset() { - *x = KeyValue{} - if protoimpl.UnsafeEnabled { - mi := &file_keyvalue_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *KeyValue) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*KeyValue) ProtoMessage() {} - -func (x *KeyValue) ProtoReflect() protoreflect.Message { - mi := &file_keyvalue_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use KeyValue.ProtoReflect.Descriptor instead. -func (*KeyValue) Descriptor() ([]byte, []int) { - return file_keyvalue_proto_rawDescGZIP(), []int{0} -} - -func (x *KeyValue) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *KeyValue) GetValue() *structpb.Value { - if x != nil { - return x.Value - } - return nil -} - -var File_keyvalue_proto protoreflect.FileDescriptor - -var file_keyvalue_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, - 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, - 0x0a, 0x08, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x56, 0x61, - 0x6c, 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, - 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, - 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, - 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_keyvalue_proto_rawDescOnce sync.Once - file_keyvalue_proto_rawDescData = file_keyvalue_proto_rawDesc -) - -func file_keyvalue_proto_rawDescGZIP() []byte { - file_keyvalue_proto_rawDescOnce.Do(func() { - file_keyvalue_proto_rawDescData = protoimpl.X.CompressGZIP(file_keyvalue_proto_rawDescData) - }) - return file_keyvalue_proto_rawDescData -} - -var file_keyvalue_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_keyvalue_proto_goTypes = []interface{}{ - (*KeyValue)(nil), // 0: elastic.apm.v1.KeyValue - (*structpb.Value)(nil), // 1: google.protobuf.Value -} -var file_keyvalue_proto_depIdxs = []int32{ - 1, // 0: elastic.apm.v1.KeyValue.value:type_name -> google.protobuf.Value - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_keyvalue_proto_init() } -func file_keyvalue_proto_init() { - if File_keyvalue_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_keyvalue_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyValue); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_keyvalue_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_keyvalue_proto_goTypes, - DependencyIndexes: file_keyvalue_proto_depIdxs, - MessageInfos: file_keyvalue_proto_msgTypes, - }.Build() - File_keyvalue_proto = out.File - file_keyvalue_proto_rawDesc = nil - file_keyvalue_proto_goTypes = nil - file_keyvalue_proto_depIdxs = nil -} diff --git a/model/modelpb/keyvaluestring.pb.go b/model/modelpb/keyvaluestring.pb.go new file mode 100644 index 00000000..ea24f1da --- /dev/null +++ b/model/modelpb/keyvaluestring.pb.go @@ -0,0 +1,172 @@ +// Licensed to Elasticsearch B.V. under one or more contributor +// license agreements. See the NOTICE file distributed with +// this work for additional information regarding copyright +// ownership. Elasticsearch B.V. licenses this file to you under +// the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.24.3 +// source: keyvaluestring.proto + +package modelpb + +import ( + reflect "reflect" + sync "sync" + + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type KeyValueString struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *KeyValueString) Reset() { + *x = KeyValueString{} + if protoimpl.UnsafeEnabled { + mi := &file_keyvaluestring_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *KeyValueString) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*KeyValueString) ProtoMessage() {} + +func (x *KeyValueString) ProtoReflect() protoreflect.Message { + mi := &file_keyvaluestring_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use KeyValueString.ProtoReflect.Descriptor instead. +func (*KeyValueString) Descriptor() ([]byte, []int) { + return file_keyvaluestring_proto_rawDescGZIP(), []int{0} +} + +func (x *KeyValueString) GetKey() string { + if x != nil { + return x.Key + } + return "" +} + +func (x *KeyValueString) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_keyvaluestring_proto protoreflect.FileDescriptor + +var file_keyvaluestring_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, + 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x22, 0x38, 0x0a, 0x0e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, + 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_keyvaluestring_proto_rawDescOnce sync.Once + file_keyvaluestring_proto_rawDescData = file_keyvaluestring_proto_rawDesc +) + +func file_keyvaluestring_proto_rawDescGZIP() []byte { + file_keyvaluestring_proto_rawDescOnce.Do(func() { + file_keyvaluestring_proto_rawDescData = protoimpl.X.CompressGZIP(file_keyvaluestring_proto_rawDescData) + }) + return file_keyvaluestring_proto_rawDescData +} + +var file_keyvaluestring_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_keyvaluestring_proto_goTypes = []interface{}{ + (*KeyValueString)(nil), // 0: elastic.apm.v1.KeyValueString +} +var file_keyvaluestring_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_keyvaluestring_proto_init() } +func file_keyvaluestring_proto_init() { + if File_keyvaluestring_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_keyvaluestring_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*KeyValueString); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_keyvaluestring_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_keyvaluestring_proto_goTypes, + DependencyIndexes: file_keyvaluestring_proto_depIdxs, + MessageInfos: file_keyvaluestring_proto_msgTypes, + }.Build() + File_keyvaluestring_proto = out.File + file_keyvaluestring_proto_rawDesc = nil + file_keyvaluestring_proto_goTypes = nil + file_keyvaluestring_proto_depIdxs = nil +} diff --git a/model/modelpb/keyvalue_vtproto.pb.go b/model/modelpb/keyvaluestring_vtproto.pb.go similarity index 66% rename from model/modelpb/keyvalue_vtproto.pb.go rename to model/modelpb/keyvaluestring_vtproto.pb.go index 6f553941..274414f5 100644 --- a/model/modelpb/keyvalue_vtproto.pb.go +++ b/model/modelpb/keyvaluestring_vtproto.pb.go @@ -17,7 +17,7 @@ // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. // protoc-gen-go-vtproto version: v0.5.1-0.20230920154146-d6fc6ac3381e -// source: keyvalue.proto +// source: keyvaluestring.proto package modelpb @@ -28,7 +28,6 @@ import ( proto "google.golang.org/protobuf/proto" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - structpb "google.golang.org/protobuf/types/known/structpb" ) const ( @@ -38,19 +37,13 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -func (m *KeyValue) CloneVT() *KeyValue { +func (m *KeyValueString) CloneVT() *KeyValueString { if m == nil { - return (*KeyValue)(nil) + return (*KeyValueString)(nil) } - r := KeyValueFromVTPool() + r := KeyValueStringFromVTPool() r.Key = m.Key - if rhs := m.Value; rhs != nil { - if vtpb, ok := interface{}(rhs).(interface{ CloneVT() *structpb.Value }); ok { - r.Value = vtpb.CloneVT() - } else { - r.Value = proto.Clone(rhs).(*structpb.Value) - } - } + r.Value = m.Value if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -58,11 +51,11 @@ func (m *KeyValue) CloneVT() *KeyValue { return r } -func (m *KeyValue) CloneMessageVT() proto.Message { +func (m *KeyValueString) CloneMessageVT() proto.Message { return m.CloneVT() } -func (m *KeyValue) MarshalVT() (dAtA []byte, err error) { +func (m *KeyValueString) MarshalVT() (dAtA []byte, err error) { if m == nil { return nil, nil } @@ -75,12 +68,12 @@ func (m *KeyValue) MarshalVT() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *KeyValue) MarshalToVT(dAtA []byte) (int, error) { +func (m *KeyValueString) MarshalToVT(dAtA []byte) (int, error) { size := m.SizeVT() return m.MarshalToSizedBufferVT(dAtA[:size]) } -func (m *KeyValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { +func (m *KeyValueString) MarshalToSizedBufferVT(dAtA []byte) (int, error) { if m == nil { return 0, nil } @@ -92,25 +85,10 @@ func (m *KeyValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } - if m.Value != nil { - if vtmsg, ok := interface{}(m.Value).(interface { - MarshalToSizedBufferVT([]byte) (int, error) - }); ok { - size, err := vtmsg.MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - } else { - encoded, err := proto.Marshal(m.Value) - if err != nil { - return 0, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = encodeVarint(dAtA, i, uint64(len(encoded))) - } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarint(dAtA, i, uint64(len(m.Value))) i-- dAtA[i] = 0x12 } @@ -124,27 +102,27 @@ func (m *KeyValue) MarshalToSizedBufferVT(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -var vtprotoPool_KeyValue = sync.Pool{ +var vtprotoPool_KeyValueString = sync.Pool{ New: func() interface{} { - return &KeyValue{} + return &KeyValueString{} }, } -func (m *KeyValue) ResetVT() { +func (m *KeyValueString) ResetVT() { if m != nil { m.Reset() } } -func (m *KeyValue) ReturnToVTPool() { +func (m *KeyValueString) ReturnToVTPool() { if m != nil { m.ResetVT() - vtprotoPool_KeyValue.Put(m) + vtprotoPool_KeyValueString.Put(m) } } -func KeyValueFromVTPool() *KeyValue { - return vtprotoPool_KeyValue.Get().(*KeyValue) +func KeyValueStringFromVTPool() *KeyValueString { + return vtprotoPool_KeyValueString.Get().(*KeyValueString) } -func (m *KeyValue) SizeVT() (n int) { +func (m *KeyValueString) SizeVT() (n int) { if m == nil { return 0 } @@ -154,21 +132,15 @@ func (m *KeyValue) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if m.Value != nil { - if size, ok := interface{}(m.Value).(interface { - SizeVT() int - }); ok { - l = size.SizeVT() - } else { - l = proto.Size(m.Value) - } + l = len(m.Value) + if l > 0 { n += 1 + l + sov(uint64(l)) } n += len(m.unknownFields) return n } -func (m *KeyValue) UnmarshalVT(dAtA []byte) error { +func (m *KeyValueString) UnmarshalVT(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -191,10 +163,10 @@ func (m *KeyValue) UnmarshalVT(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KeyValue: wiretype end group for non-group") + return fmt.Errorf("proto: KeyValueString: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: KeyValueString: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -233,7 +205,7 @@ func (m *KeyValue) UnmarshalVT(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflow @@ -243,35 +215,23 @@ func (m *KeyValue) UnmarshalVT(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLength } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLength } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Value == nil { - m.Value = &structpb.Value{} - } - if unmarshal, ok := interface{}(m.Value).(interface { - UnmarshalVT([]byte) error - }); ok { - if err := unmarshal.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - } else { - if err := proto.Unmarshal(dAtA[iNdEx:postIndex], m.Value); err != nil { - return err - } - } + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/model/modelpb/message.pb.go b/model/modelpb/message.pb.go index e87b98b6..34f0766d 100644 --- a/model/modelpb/message.pb.go +++ b/model/modelpb/message.pb.go @@ -43,11 +43,11 @@ type Message struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` - Headers []*HTTPHeader `protobuf:"bytes,2,rep,name=headers,proto3" json:"headers,omitempty"` - AgeMillis *uint64 `protobuf:"varint,3,opt,name=age_millis,json=ageMillis,proto3,oneof" json:"age_millis,omitempty"` - QueueName string `protobuf:"bytes,4,opt,name=queue_name,json=queueName,proto3" json:"queue_name,omitempty"` - RoutingKey string `protobuf:"bytes,5,opt,name=routing_key,json=routingKey,proto3" json:"routing_key,omitempty"` + Body string `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` + AgeMillis *uint64 `protobuf:"varint,3,opt,name=age_millis,json=ageMillis,proto3,oneof" json:"age_millis,omitempty"` + QueueName string `protobuf:"bytes,4,opt,name=queue_name,json=queueName,proto3" json:"queue_name,omitempty"` + RoutingKey string `protobuf:"bytes,5,opt,name=routing_key,json=routingKey,proto3" json:"routing_key,omitempty"` + Headers []*Header `protobuf:"bytes,6,rep,name=headers,proto3" json:"headers,omitempty"` } func (x *Message) Reset() { @@ -89,13 +89,6 @@ func (x *Message) GetBody() string { return "" } -func (x *Message) GetHeaders() []*HTTPHeader { - if x != nil { - return x.Headers - } - return nil -} - func (x *Message) GetAgeMillis() uint64 { if x != nil && x.AgeMillis != nil { return *x.AgeMillis @@ -117,28 +110,35 @@ func (x *Message) GetRoutingKey() string { return "" } +func (x *Message) GetHeaders() []*Header { + if x != nil { + return x.Headers + } + return nil +} + var File_message_proto protoreflect.FileDescriptor var file_message_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x1a, - 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, + 0x0d, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc8, 0x01, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, - 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x34, - 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, - 0x2e, 0x48, 0x54, 0x54, 0x50, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, - 0x64, 0x65, 0x72, 0x73, 0x12, 0x22, 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, - 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x48, 0x00, 0x52, 0x09, 0x61, 0x67, 0x65, 0x4d, - 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x71, 0x75, 0x65, 0x75, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x75, - 0x65, 0x75, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x69, - 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x6f, - 0x75, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x67, 0x65, - 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, - 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, - 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x22, + 0x0a, 0x0a, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x48, 0x00, 0x52, 0x09, 0x61, 0x67, 0x65, 0x4d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x88, + 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x0a, 0x71, 0x75, 0x65, 0x75, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x71, 0x75, 0x65, 0x75, 0x65, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x72, 0x6f, 0x75, 0x74, 0x69, 0x6e, 0x67, 0x4b, + 0x65, 0x79, 0x12, 0x30, 0x0a, 0x07, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, + 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x07, 0x68, 0x65, 0x61, + 0x64, 0x65, 0x72, 0x73, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x61, 0x67, 0x65, 0x5f, 0x6d, 0x69, 0x6c, + 0x6c, 0x69, 0x73, 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, + 0x61, 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -155,11 +155,11 @@ func file_message_proto_rawDescGZIP() []byte { var file_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_message_proto_goTypes = []interface{}{ - (*Message)(nil), // 0: elastic.apm.v1.Message - (*HTTPHeader)(nil), // 1: elastic.apm.v1.HTTPHeader + (*Message)(nil), // 0: elastic.apm.v1.Message + (*Header)(nil), // 1: elastic.apm.v1.Header } var file_message_proto_depIdxs = []int32{ - 1, // 0: elastic.apm.v1.Message.headers:type_name -> elastic.apm.v1.HTTPHeader + 1, // 0: elastic.apm.v1.Message.headers:type_name -> elastic.apm.v1.Header 1, // [1:1] is the sub-list for method output_type 1, // [1:1] is the sub-list for method input_type 1, // [1:1] is the sub-list for extension type_name diff --git a/model/modelpb/message_vtproto.pb.go b/model/modelpb/message_vtproto.pb.go index ee27aa76..2913cbc4 100644 --- a/model/modelpb/message_vtproto.pb.go +++ b/model/modelpb/message_vtproto.pb.go @@ -45,17 +45,17 @@ func (m *Message) CloneVT() *Message { r.Body = m.Body r.QueueName = m.QueueName r.RoutingKey = m.RoutingKey + if rhs := m.AgeMillis; rhs != nil { + tmpVal := *rhs + r.AgeMillis = &tmpVal + } if rhs := m.Headers; rhs != nil { - tmpContainer := make([]*HTTPHeader, len(rhs)) + tmpContainer := make([]*Header, len(rhs)) for k, v := range rhs { tmpContainer[k] = v.CloneVT() } r.Headers = tmpContainer } - if rhs := m.AgeMillis; rhs != nil { - tmpVal := *rhs - r.AgeMillis = &tmpVal - } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -97,6 +97,18 @@ func (m *Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Headers) > 0 { + for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x32 + } + } if len(m.RoutingKey) > 0 { i -= len(m.RoutingKey) copy(dAtA[i:], m.RoutingKey) @@ -116,18 +128,6 @@ func (m *Message) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x18 } - if len(m.Headers) > 0 { - for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Headers[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x12 - } - } if len(m.Body) > 0 { i -= len(m.Body) copy(dAtA[i:], m.Body) @@ -173,12 +173,6 @@ func (m *Message) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } - if len(m.Headers) > 0 { - for _, e := range m.Headers { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } if m.AgeMillis != nil { n += 1 + sov(uint64(*m.AgeMillis)) } @@ -190,6 +184,12 @@ func (m *Message) SizeVT() (n int) { if l > 0 { n += 1 + l + sov(uint64(l)) } + if len(m.Headers) > 0 { + for _, e := range m.Headers { + l = e.SizeVT() + n += 1 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -255,47 +255,6 @@ func (m *Message) UnmarshalVT(dAtA []byte) error { } m.Body = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if len(m.Headers) == cap(m.Headers) { - m.Headers = append(m.Headers, &HTTPHeader{}) - } else { - m.Headers = m.Headers[:len(m.Headers)+1] - if m.Headers[len(m.Headers)-1] == nil { - m.Headers[len(m.Headers)-1] = &HTTPHeader{} - } - } - if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field AgeMillis", wireType) @@ -380,6 +339,47 @@ func (m *Message) UnmarshalVT(dAtA []byte) error { } m.RoutingKey = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Headers) == cap(m.Headers) { + m.Headers = append(m.Headers, &Header{}) + } else { + m.Headers = m.Headers[:len(m.Headers)+1] + if m.Headers[len(m.Headers)-1] == nil { + m.Headers[len(m.Headers)-1] = &Header{} + } + } + if err := m.Headers[len(m.Headers)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/model/modelpb/stacktrace.pb.go b/model/modelpb/stacktrace.pb.go index aa1387ef..f7166bd8 100644 --- a/model/modelpb/stacktrace.pb.go +++ b/model/modelpb/stacktrace.pb.go @@ -43,22 +43,22 @@ type StacktraceFrame struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Vars []*KeyValue `protobuf:"bytes,1,rep,name=vars,proto3" json:"vars,omitempty"` - Lineno *uint32 `protobuf:"varint,2,opt,name=lineno,proto3,oneof" json:"lineno,omitempty"` - Colno *uint32 `protobuf:"varint,3,opt,name=colno,proto3,oneof" json:"colno,omitempty"` - Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` - Classname string `protobuf:"bytes,5,opt,name=classname,proto3" json:"classname,omitempty"` - ContextLine string `protobuf:"bytes,6,opt,name=context_line,json=contextLine,proto3" json:"context_line,omitempty"` - Module string `protobuf:"bytes,7,opt,name=module,proto3" json:"module,omitempty"` - Function string `protobuf:"bytes,8,opt,name=function,proto3" json:"function,omitempty"` - AbsPath string `protobuf:"bytes,9,opt,name=abs_path,json=absPath,proto3" json:"abs_path,omitempty"` - SourcemapError string `protobuf:"bytes,10,opt,name=sourcemap_error,json=sourcemapError,proto3" json:"sourcemap_error,omitempty"` - Original *Original `protobuf:"bytes,11,opt,name=original,proto3" json:"original,omitempty"` - PreContext []string `protobuf:"bytes,12,rep,name=pre_context,json=preContext,proto3" json:"pre_context,omitempty"` - PostContext []string `protobuf:"bytes,13,rep,name=post_context,json=postContext,proto3" json:"post_context,omitempty"` - LibraryFrame bool `protobuf:"varint,14,opt,name=library_frame,json=libraryFrame,proto3" json:"library_frame,omitempty"` - SourcemapUpdated bool `protobuf:"varint,15,opt,name=sourcemap_updated,json=sourcemapUpdated,proto3" json:"sourcemap_updated,omitempty"` - ExcludeFromGrouping bool `protobuf:"varint,16,opt,name=exclude_from_grouping,json=excludeFromGrouping,proto3" json:"exclude_from_grouping,omitempty"` + Lineno *uint32 `protobuf:"varint,2,opt,name=lineno,proto3,oneof" json:"lineno,omitempty"` + Colno *uint32 `protobuf:"varint,3,opt,name=colno,proto3,oneof" json:"colno,omitempty"` + Filename string `protobuf:"bytes,4,opt,name=filename,proto3" json:"filename,omitempty"` + Classname string `protobuf:"bytes,5,opt,name=classname,proto3" json:"classname,omitempty"` + ContextLine string `protobuf:"bytes,6,opt,name=context_line,json=contextLine,proto3" json:"context_line,omitempty"` + Module string `protobuf:"bytes,7,opt,name=module,proto3" json:"module,omitempty"` + Function string `protobuf:"bytes,8,opt,name=function,proto3" json:"function,omitempty"` + AbsPath string `protobuf:"bytes,9,opt,name=abs_path,json=absPath,proto3" json:"abs_path,omitempty"` + SourcemapError string `protobuf:"bytes,10,opt,name=sourcemap_error,json=sourcemapError,proto3" json:"sourcemap_error,omitempty"` + Original *Original `protobuf:"bytes,11,opt,name=original,proto3" json:"original,omitempty"` + PreContext []string `protobuf:"bytes,12,rep,name=pre_context,json=preContext,proto3" json:"pre_context,omitempty"` + PostContext []string `protobuf:"bytes,13,rep,name=post_context,json=postContext,proto3" json:"post_context,omitempty"` + LibraryFrame bool `protobuf:"varint,14,opt,name=library_frame,json=libraryFrame,proto3" json:"library_frame,omitempty"` + SourcemapUpdated bool `protobuf:"varint,15,opt,name=sourcemap_updated,json=sourcemapUpdated,proto3" json:"sourcemap_updated,omitempty"` + ExcludeFromGrouping bool `protobuf:"varint,16,opt,name=exclude_from_grouping,json=excludeFromGrouping,proto3" json:"exclude_from_grouping,omitempty"` + Vars []*KeyValueString `protobuf:"bytes,17,rep,name=vars,proto3" json:"vars,omitempty"` } func (x *StacktraceFrame) Reset() { @@ -93,13 +93,6 @@ func (*StacktraceFrame) Descriptor() ([]byte, []int) { return file_stacktrace_proto_rawDescGZIP(), []int{0} } -func (x *StacktraceFrame) GetVars() []*KeyValue { - if x != nil { - return x.Vars - } - return nil -} - func (x *StacktraceFrame) GetLineno() uint32 { if x != nil && x.Lineno != nil { return *x.Lineno @@ -205,6 +198,13 @@ func (x *StacktraceFrame) GetExcludeFromGrouping() bool { return false } +func (x *StacktraceFrame) GetVars() []*KeyValueString { + if x != nil { + return x.Vars + } + return nil +} + type Original struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -305,64 +305,65 @@ var File_stacktrace_proto protoreflect.FileDescriptor var file_stacktrace_proto_rawDesc = []byte{ 0x0a, 0x10, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, - 0x76, 0x31, 0x1a, 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xe1, 0x04, 0x0a, 0x0f, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, - 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x04, 0x76, 0x61, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, - 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, - 0x76, 0x61, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x88, 0x01, - 0x01, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, - 0x48, 0x01, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, - 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, - 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, - 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, - 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, - 0x08, 0x61, 0x62, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x07, 0x61, 0x62, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x12, 0x34, 0x0a, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x0b, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x08, 0x6f, - 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x63, - 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x74, - 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, - 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6c, - 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, - 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x5f, 0x75, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x6f, 0x75, - 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, - 0x15, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, - 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x72, 0x6f, 0x6d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, - 0x67, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x42, 0x08, 0x0a, 0x06, - 0x5f, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x22, 0xed, 0x01, 0x0a, 0x08, 0x4f, 0x72, 0x69, 0x67, 0x69, - 0x6e, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x62, 0x73, 0x50, 0x61, 0x74, 0x68, 0x12, 0x1a, - 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, - 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x6c, 0x69, 0x6e, 0x65, - 0x6e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x06, 0x6c, 0x69, 0x6e, 0x65, - 0x6e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x88, 0x01, 0x01, - 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, - 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, - 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x42, 0x08, 0x0a, 0x06, - 0x5f, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, - 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x31, 0x1a, 0x14, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xed, 0x04, 0x0a, 0x0f, 0x53, 0x74, 0x61, + 0x63, 0x6b, 0x74, 0x72, 0x61, 0x63, 0x65, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, + 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x06, + 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x6c, + 0x6e, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6e, + 0x6f, 0x88, 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x4c, 0x69, 0x6e, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x62, 0x73, 0x50, 0x61, 0x74, 0x68, + 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x6d, 0x61, 0x70, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x34, 0x0a, 0x08, 0x6f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, + 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x52, 0x08, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x12, + 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x0c, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x6f, 0x73, 0x74, 0x43, 0x6f, 0x6e, 0x74, + 0x65, 0x78, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x66, + 0x72, 0x61, 0x6d, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x46, 0x72, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x73, 0x6f, 0x75, 0x72, + 0x63, 0x65, 0x6d, 0x61, 0x70, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x18, 0x0f, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x10, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x6d, 0x61, 0x70, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x64, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, + 0x5f, 0x66, 0x72, 0x6f, 0x6d, 0x5f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x10, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x65, 0x78, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x46, 0x72, 0x6f, + 0x6d, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x32, 0x0a, 0x04, 0x76, 0x61, 0x72, + 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, + 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x04, 0x76, 0x61, 0x72, 0x73, 0x42, 0x09, 0x0a, + 0x07, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x63, 0x6f, 0x6c, + 0x6e, 0x6f, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x22, 0xed, 0x01, 0x0a, 0x08, 0x4f, 0x72, 0x69, + 0x67, 0x69, 0x6e, 0x61, 0x6c, 0x12, 0x19, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x5f, 0x70, 0x61, 0x74, + 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x62, 0x73, 0x50, 0x61, 0x74, 0x68, + 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x06, 0x6c, 0x69, + 0x6e, 0x65, 0x6e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x06, 0x6c, 0x69, + 0x6e, 0x65, 0x6e, 0x6f, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x05, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x88, + 0x01, 0x01, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, + 0x0a, 0x0d, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x5f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x18, + 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x46, 0x72, + 0x61, 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x6c, 0x69, 0x6e, 0x65, 0x6e, 0x6f, 0x42, 0x08, + 0x0a, 0x06, 0x5f, 0x63, 0x6f, 0x6c, 0x6e, 0x6f, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, + 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -381,11 +382,11 @@ var file_stacktrace_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_stacktrace_proto_goTypes = []interface{}{ (*StacktraceFrame)(nil), // 0: elastic.apm.v1.StacktraceFrame (*Original)(nil), // 1: elastic.apm.v1.Original - (*KeyValue)(nil), // 2: elastic.apm.v1.KeyValue + (*KeyValueString)(nil), // 2: elastic.apm.v1.KeyValueString } var file_stacktrace_proto_depIdxs = []int32{ - 2, // 0: elastic.apm.v1.StacktraceFrame.vars:type_name -> elastic.apm.v1.KeyValue - 1, // 1: elastic.apm.v1.StacktraceFrame.original:type_name -> elastic.apm.v1.Original + 1, // 0: elastic.apm.v1.StacktraceFrame.original:type_name -> elastic.apm.v1.Original + 2, // 1: elastic.apm.v1.StacktraceFrame.vars:type_name -> elastic.apm.v1.KeyValueString 2, // [2:2] is the sub-list for method output_type 2, // [2:2] is the sub-list for method input_type 2, // [2:2] is the sub-list for extension type_name @@ -398,7 +399,7 @@ func file_stacktrace_proto_init() { if File_stacktrace_proto != nil { return } - file_keyvalue_proto_init() + file_keyvaluestring_proto_init() if !protoimpl.UnsafeEnabled { file_stacktrace_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StacktraceFrame); i { diff --git a/model/modelpb/stacktrace_vtproto.pb.go b/model/modelpb/stacktrace_vtproto.pb.go index cc68f834..1f4c695a 100644 --- a/model/modelpb/stacktrace_vtproto.pb.go +++ b/model/modelpb/stacktrace_vtproto.pb.go @@ -53,13 +53,6 @@ func (m *StacktraceFrame) CloneVT() *StacktraceFrame { r.LibraryFrame = m.LibraryFrame r.SourcemapUpdated = m.SourcemapUpdated r.ExcludeFromGrouping = m.ExcludeFromGrouping - if rhs := m.Vars; rhs != nil { - tmpContainer := make([]*KeyValue, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.Vars = tmpContainer - } if rhs := m.Lineno; rhs != nil { tmpVal := *rhs r.Lineno = &tmpVal @@ -78,6 +71,13 @@ func (m *StacktraceFrame) CloneVT() *StacktraceFrame { copy(tmpContainer, rhs) r.PostContext = tmpContainer } + if rhs := m.Vars; rhs != nil { + tmpContainer := make([]*KeyValueString, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Vars = tmpContainer + } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -148,6 +148,20 @@ func (m *StacktraceFrame) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Vars) > 0 { + for iNdEx := len(m.Vars) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Vars[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } if m.ExcludeFromGrouping { i-- if m.ExcludeFromGrouping { @@ -267,18 +281,6 @@ func (m *StacktraceFrame) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if len(m.Vars) > 0 { - for iNdEx := len(m.Vars) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Vars[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0xa - } - } return len(dAtA) - i, nil } @@ -371,17 +373,17 @@ var vtprotoPool_StacktraceFrame = sync.Pool{ func (m *StacktraceFrame) ResetVT() { if m != nil { + m.Original.ReturnToVTPool() + f0 := m.PreContext[:0] + f1 := m.PostContext[:0] for _, mm := range m.Vars { mm.ResetVT() } - f0 := m.Vars[:0] - m.Original.ReturnToVTPool() - f1 := m.PreContext[:0] - f2 := m.PostContext[:0] + f2 := m.Vars[:0] m.Reset() - m.Vars = f0 - m.PreContext = f1 - m.PostContext = f2 + m.PreContext = f0 + m.PostContext = f1 + m.Vars = f2 } } func (m *StacktraceFrame) ReturnToVTPool() { @@ -420,12 +422,6 @@ func (m *StacktraceFrame) SizeVT() (n int) { } var l int _ = l - if len(m.Vars) > 0 { - for _, e := range m.Vars { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } if m.Lineno != nil { n += 1 + sov(uint64(*m.Lineno)) } @@ -485,6 +481,12 @@ func (m *StacktraceFrame) SizeVT() (n int) { if m.ExcludeFromGrouping { n += 3 } + if len(m.Vars) > 0 { + for _, e := range m.Vars { + l = e.SizeVT() + n += 2 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -553,47 +555,6 @@ func (m *StacktraceFrame) UnmarshalVT(dAtA []byte) error { return fmt.Errorf("proto: StacktraceFrame: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Vars", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if len(m.Vars) == cap(m.Vars) { - m.Vars = append(m.Vars, &KeyValue{}) - } else { - m.Vars = m.Vars[:len(m.Vars)+1] - if m.Vars[len(m.Vars)-1] == nil { - m.Vars[len(m.Vars)-1] = &KeyValue{} - } - } - if err := m.Vars[len(m.Vars)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 2: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Lineno", wireType) @@ -1018,6 +979,47 @@ func (m *StacktraceFrame) UnmarshalVT(dAtA []byte) error { } } m.ExcludeFromGrouping = bool(v != 0) + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vars", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Vars) == cap(m.Vars) { + m.Vars = append(m.Vars, &KeyValueString{}) + } else { + m.Vars = m.Vars[:len(m.Vars)+1] + if m.Vars[len(m.Vars)-1] == nil { + m.Vars[len(m.Vars)-1] = &KeyValueString{} + } + } + if err := m.Vars[len(m.Vars)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/model/modelpb/transaction.pb.go b/model/modelpb/transaction.pb.go index 5b38ef02..8d5e123c 100644 --- a/model/modelpb/transaction.pb.go +++ b/model/modelpb/transaction.pb.go @@ -45,7 +45,6 @@ type Transaction struct { SpanCount *SpanCount `protobuf:"bytes,1,opt,name=span_count,json=spanCount,proto3" json:"span_count,omitempty"` UserExperience *UserExperience `protobuf:"bytes,2,opt,name=user_experience,json=userExperience,proto3" json:"user_experience,omitempty"` - Custom []*KeyValue `protobuf:"bytes,3,rep,name=custom,proto3" json:"custom,omitempty"` Marks map[string]*TransactionMark `protobuf:"bytes,4,rep,name=marks,proto3" json:"marks,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Message *Message `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` Type string `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"` @@ -59,6 +58,7 @@ type Transaction struct { Sampled bool `protobuf:"varint,14,opt,name=sampled,proto3" json:"sampled,omitempty"` Root bool `protobuf:"varint,15,opt,name=root,proto3" json:"root,omitempty"` ProfilerStackTraceIds []string `protobuf:"bytes,16,rep,name=profiler_stack_trace_ids,json=profilerStackTraceIds,proto3" json:"profiler_stack_trace_ids,omitempty"` + Custom []*KeyValueString `protobuf:"bytes,17,rep,name=custom,proto3" json:"custom,omitempty"` } func (x *Transaction) Reset() { @@ -107,13 +107,6 @@ func (x *Transaction) GetUserExperience() *UserExperience { return nil } -func (x *Transaction) GetCustom() []*KeyValue { - if x != nil { - return x.Custom - } - return nil -} - func (x *Transaction) GetMarks() map[string]*TransactionMark { if x != nil { return x.Marks @@ -205,6 +198,13 @@ func (x *Transaction) GetProfilerStackTraceIds() []string { return nil } +func (x *Transaction) GetCustom() []*KeyValueString { + if x != nil { + return x.Custom + } + return nil +} + type SpanCount struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -394,99 +394,100 @@ var file_transaction_proto_rawDesc = []byte{ 0x2e, 0x76, 0x31, 0x1a, 0x10, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x65, 0x74, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0e, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xde, 0x06, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6e, 0x5f, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x61, 0x73, - 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x47, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, - 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, - 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, - 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, - 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x3c, 0x0a, 0x05, 0x6d, 0x61, - 0x72, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x65, 0x6c, 0x61, 0x73, - 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x52, 0x05, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x31, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x65, 0x6c, 0x61, 0x73, - 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x48, 0x0a, 0x12, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, - 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, - 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, - 0x61, 0x6d, 0x52, 0x11, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x48, 0x69, 0x73, 0x74, - 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x50, 0x0a, 0x13, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, - 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, - 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x53, 0x70, 0x61, 0x6e, 0x53, - 0x74, 0x61, 0x74, 0x73, 0x52, 0x11, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x53, 0x70, 0x61, - 0x6e, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x48, 0x0a, 0x10, 0x64, 0x75, 0x72, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, - 0x76, 0x31, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, - 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, - 0x79, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, - 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x13, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x76, 0x65, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x72, 0x6f, - 0x6f, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x5f, 0x73, - 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x10, - 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x72, 0x53, 0x74, - 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x73, 0x1a, 0x59, 0x0a, 0x0a, 0x4d, - 0x61, 0x72, 0x6b, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6c, 0x61, - 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x61, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x07, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x07, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x88, - 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x88, 0x01, - 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x42, 0x0a, 0x0a, - 0x08, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x0f, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, 0x55, 0x0a, - 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, - 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x4d, 0x61, 0x72, 0x6b, 0x2e, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, - 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, - 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x02, 0x0a, 0x10, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, - 0x64, 0x53, 0x70, 0x61, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, - 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x1a, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x13, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x74, - 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x13, - 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, - 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, - 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, - 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, - 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, 0x70, 0x6d, - 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, 0x64, 0x65, - 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x6b, 0x65, 0x79, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xea, 0x06, 0x0a, 0x0b, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x0a, 0x73, + 0x70, 0x61, 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x19, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x53, 0x70, 0x61, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x47, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x65, 0x78, + 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, + 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, + 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x52, 0x0e, + 0x75, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x65, 0x72, 0x69, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x3c, + 0x0a, 0x05, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, + 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4d, 0x61, 0x72, 0x6b, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6d, 0x61, 0x72, 0x6b, 0x73, 0x12, 0x31, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, + 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, + 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x48, 0x0a, 0x12, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x68, 0x69, 0x73, 0x74, + 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x65, 0x6c, + 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x52, 0x11, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x50, 0x0a, 0x13, 0x64, 0x72, 0x6f, + 0x70, 0x70, 0x65, 0x64, 0x5f, 0x73, 0x70, 0x61, 0x6e, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x73, + 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, + 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x53, + 0x70, 0x61, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x11, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, + 0x64, 0x53, 0x70, 0x61, 0x6e, 0x73, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x48, 0x0a, 0x10, 0x64, + 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, + 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, + 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x4d, 0x65, + 0x74, 0x72, 0x69, 0x63, 0x52, 0x0f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x75, + 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x31, 0x0a, 0x14, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, + 0x6e, 0x74, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x13, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x74, + 0x69, 0x76, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x61, 0x6d, 0x70, + 0x6c, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x61, 0x6d, 0x70, 0x6c, + 0x65, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, + 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x74, 0x12, 0x37, 0x0a, 0x18, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, + 0x64, 0x73, 0x18, 0x10, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, + 0x65, 0x72, 0x53, 0x74, 0x61, 0x63, 0x6b, 0x54, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x73, 0x12, + 0x36, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x11, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x1e, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, + 0x2e, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x1a, 0x59, 0x0a, 0x0a, 0x4d, 0x61, 0x72, 0x6b, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x35, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, + 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, + 0x38, 0x01, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0x61, 0x0a, 0x09, 0x53, 0x70, 0x61, 0x6e, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x07, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x00, 0x52, 0x07, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, + 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x48, 0x01, 0x52, 0x07, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, + 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x64, 0x72, 0x6f, 0x70, 0x70, 0x65, 0x64, 0x42, + 0x0a, 0x0a, 0x08, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x65, 0x64, 0x22, 0xa9, 0x01, 0x0a, 0x0f, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x12, + 0x55, 0x0a, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2e, + 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x4d, 0x61, 0x72, 0x6b, 0x2e, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x6d, 0x65, 0x61, 0x73, 0x75, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x4d, 0x65, 0x61, 0x73, 0x75, 0x72, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, + 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x8e, 0x02, 0x0a, 0x10, 0x44, 0x72, 0x6f, 0x70, + 0x70, 0x65, 0x64, 0x53, 0x70, 0x61, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x40, 0x0a, 0x1c, + 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x5f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x1a, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, + 0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, + 0x0a, 0x13, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x73, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x18, + 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x6f, 0x75, 0x74, 0x63, 0x6f, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x65, 0x6c, 0x61, + 0x73, 0x74, 0x69, 0x63, 0x2e, 0x61, 0x70, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, + 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x2b, 0x5a, 0x29, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x61, 0x73, 0x74, 0x69, 0x63, 0x2f, 0x61, + 0x70, 0x6d, 0x2d, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2f, 0x6d, 0x6f, + 0x64, 0x65, 0x6c, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -510,21 +511,21 @@ var file_transaction_proto_goTypes = []interface{}{ nil, // 4: elastic.apm.v1.Transaction.MarksEntry nil, // 5: elastic.apm.v1.TransactionMark.MeasurementsEntry (*UserExperience)(nil), // 6: elastic.apm.v1.UserExperience - (*KeyValue)(nil), // 7: elastic.apm.v1.KeyValue - (*Message)(nil), // 8: elastic.apm.v1.Message - (*Histogram)(nil), // 9: elastic.apm.v1.Histogram - (*SummaryMetric)(nil), // 10: elastic.apm.v1.SummaryMetric + (*Message)(nil), // 7: elastic.apm.v1.Message + (*Histogram)(nil), // 8: elastic.apm.v1.Histogram + (*SummaryMetric)(nil), // 9: elastic.apm.v1.SummaryMetric + (*KeyValueString)(nil), // 10: elastic.apm.v1.KeyValueString (*AggregatedDuration)(nil), // 11: elastic.apm.v1.AggregatedDuration } var file_transaction_proto_depIdxs = []int32{ 1, // 0: elastic.apm.v1.Transaction.span_count:type_name -> elastic.apm.v1.SpanCount 6, // 1: elastic.apm.v1.Transaction.user_experience:type_name -> elastic.apm.v1.UserExperience - 7, // 2: elastic.apm.v1.Transaction.custom:type_name -> elastic.apm.v1.KeyValue - 4, // 3: elastic.apm.v1.Transaction.marks:type_name -> elastic.apm.v1.Transaction.MarksEntry - 8, // 4: elastic.apm.v1.Transaction.message:type_name -> elastic.apm.v1.Message - 9, // 5: elastic.apm.v1.Transaction.duration_histogram:type_name -> elastic.apm.v1.Histogram - 3, // 6: elastic.apm.v1.Transaction.dropped_spans_stats:type_name -> elastic.apm.v1.DroppedSpanStats - 10, // 7: elastic.apm.v1.Transaction.duration_summary:type_name -> elastic.apm.v1.SummaryMetric + 4, // 2: elastic.apm.v1.Transaction.marks:type_name -> elastic.apm.v1.Transaction.MarksEntry + 7, // 3: elastic.apm.v1.Transaction.message:type_name -> elastic.apm.v1.Message + 8, // 4: elastic.apm.v1.Transaction.duration_histogram:type_name -> elastic.apm.v1.Histogram + 3, // 5: elastic.apm.v1.Transaction.dropped_spans_stats:type_name -> elastic.apm.v1.DroppedSpanStats + 9, // 6: elastic.apm.v1.Transaction.duration_summary:type_name -> elastic.apm.v1.SummaryMetric + 10, // 7: elastic.apm.v1.Transaction.custom:type_name -> elastic.apm.v1.KeyValueString 5, // 8: elastic.apm.v1.TransactionMark.measurements:type_name -> elastic.apm.v1.TransactionMark.MeasurementsEntry 11, // 9: elastic.apm.v1.DroppedSpanStats.duration:type_name -> elastic.apm.v1.AggregatedDuration 2, // 10: elastic.apm.v1.Transaction.MarksEntry.value:type_name -> elastic.apm.v1.TransactionMark @@ -543,7 +544,7 @@ func file_transaction_proto_init() { file_experience_proto_init() file_message_proto_init() file_metricset_proto_init() - file_keyvalue_proto_init() + file_keyvaluestring_proto_init() if !protoimpl.UnsafeEnabled { file_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Transaction); i { diff --git a/model/modelpb/transaction_vtproto.pb.go b/model/modelpb/transaction_vtproto.pb.go index c2cafefe..ec5d78c6 100644 --- a/model/modelpb/transaction_vtproto.pb.go +++ b/model/modelpb/transaction_vtproto.pb.go @@ -56,13 +56,6 @@ func (m *Transaction) CloneVT() *Transaction { r.RepresentativeCount = m.RepresentativeCount r.Sampled = m.Sampled r.Root = m.Root - if rhs := m.Custom; rhs != nil { - tmpContainer := make([]*KeyValue, len(rhs)) - for k, v := range rhs { - tmpContainer[k] = v.CloneVT() - } - r.Custom = tmpContainer - } if rhs := m.Marks; rhs != nil { tmpContainer := make(map[string]*TransactionMark, len(rhs)) for k, v := range rhs { @@ -82,6 +75,13 @@ func (m *Transaction) CloneVT() *Transaction { copy(tmpContainer, rhs) r.ProfilerStackTraceIds = tmpContainer } + if rhs := m.Custom; rhs != nil { + tmpContainer := make([]*KeyValueString, len(rhs)) + for k, v := range rhs { + tmpContainer[k] = v.CloneVT() + } + r.Custom = tmpContainer + } if len(m.unknownFields) > 0 { r.unknownFields = make([]byte, len(m.unknownFields)) copy(r.unknownFields, m.unknownFields) @@ -191,6 +191,20 @@ func (m *Transaction) MarshalToSizedBufferVT(dAtA []byte) (int, error) { i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.Custom) > 0 { + for iNdEx := len(m.Custom) - 1; iNdEx >= 0; iNdEx-- { + size, err := m.Custom[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + } if len(m.ProfilerStackTraceIds) > 0 { for iNdEx := len(m.ProfilerStackTraceIds) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.ProfilerStackTraceIds[iNdEx]) @@ -320,18 +334,6 @@ func (m *Transaction) MarshalToSizedBufferVT(dAtA []byte) (int, error) { dAtA[i] = 0x22 } } - if len(m.Custom) > 0 { - for iNdEx := len(m.Custom) - 1; iNdEx >= 0; iNdEx-- { - size, err := m.Custom[iNdEx].MarshalToSizedBufferVT(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarint(dAtA, i, uint64(size)) - i-- - dAtA[i] = 0x1a - } - } if m.UserExperience != nil { size, err := m.UserExperience.MarshalToSizedBufferVT(dAtA[:i]) if err != nil { @@ -530,22 +532,22 @@ func (m *Transaction) ResetVT() { if m != nil { m.SpanCount.ReturnToVTPool() m.UserExperience.ReturnToVTPool() - for _, mm := range m.Custom { - mm.ResetVT() - } - f0 := m.Custom[:0] m.Message.ReturnToVTPool() m.DurationHistogram.ReturnToVTPool() for _, mm := range m.DroppedSpansStats { mm.ResetVT() } - f1 := m.DroppedSpansStats[:0] + f0 := m.DroppedSpansStats[:0] m.DurationSummary.ReturnToVTPool() - f2 := m.ProfilerStackTraceIds[:0] + f1 := m.ProfilerStackTraceIds[:0] + for _, mm := range m.Custom { + mm.ResetVT() + } + f2 := m.Custom[:0] m.Reset() - m.Custom = f0 - m.DroppedSpansStats = f1 - m.ProfilerStackTraceIds = f2 + m.DroppedSpansStats = f0 + m.ProfilerStackTraceIds = f1 + m.Custom = f2 } } func (m *Transaction) ReturnToVTPool() { @@ -635,12 +637,6 @@ func (m *Transaction) SizeVT() (n int) { l = m.UserExperience.SizeVT() n += 1 + l + sov(uint64(l)) } - if len(m.Custom) > 0 { - for _, e := range m.Custom { - l = e.SizeVT() - n += 1 + l + sov(uint64(l)) - } - } if len(m.Marks) > 0 { for k, v := range m.Marks { _ = k @@ -703,6 +699,12 @@ func (m *Transaction) SizeVT() (n int) { n += 2 + l + sov(uint64(l)) } } + if len(m.Custom) > 0 { + for _, e := range m.Custom { + l = e.SizeVT() + n += 2 + l + sov(uint64(l)) + } + } n += len(m.unknownFields) return n } @@ -872,47 +874,6 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { return err } iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflow - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLength - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if len(m.Custom) == cap(m.Custom) { - m.Custom = append(m.Custom, &KeyValue{}) - } else { - m.Custom = m.Custom[:len(m.Custom)+1] - if m.Custom[len(m.Custom)-1] == nil { - m.Custom[len(m.Custom)-1] = &KeyValue{} - } - } - if err := m.Custom[len(m.Custom)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Marks", wireType) @@ -1402,6 +1363,47 @@ func (m *Transaction) UnmarshalVT(dAtA []byte) error { } m.ProfilerStackTraceIds = append(m.ProfilerStackTraceIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Custom", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflow + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLength + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if len(m.Custom) == cap(m.Custom) { + m.Custom = append(m.Custom, &KeyValueString{}) + } else { + m.Custom = m.Custom[:len(m.Custom)+1] + if m.Custom[len(m.Custom)-1] == nil { + m.Custom[len(m.Custom)-1] = &KeyValueString{} + } + } + if err := m.Custom[len(m.Custom)-1].UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skip(dAtA[iNdEx:]) diff --git a/model/proto/error.proto b/model/proto/error.proto index 73a66719..2be4d86b 100644 --- a/model/proto/error.proto +++ b/model/proto/error.proto @@ -20,12 +20,12 @@ syntax = "proto3"; package elastic.apm.v1; import "stacktrace.proto"; -import "keyvalue.proto"; +import "keyvaluestring.proto"; option go_package = "github.com/elastic/apm-data/model/modelpb"; message Error { - repeated KeyValue custom = 1; + reserved 1; Exception exception = 2; ErrorLog log = 3; string id = 4; @@ -34,17 +34,19 @@ message Error { string stack_trace = 7; string message = 8; string type = 9; + repeated KeyValueString custom = 10; } message Exception { + reserved 4; string message = 1; string module = 2; string code = 3; - repeated KeyValue attributes = 4; repeated StacktraceFrame stacktrace = 5; string type = 6; optional bool handled = 7; repeated Exception cause = 8; + repeated KeyValueString attributes = 9; } message ErrorLog { diff --git a/model/proto/headers.proto b/model/proto/headers.proto index cf371092..4a950790 100644 --- a/model/proto/headers.proto +++ b/model/proto/headers.proto @@ -21,7 +21,7 @@ package elastic.apm.v1; option go_package = "github.com/elastic/apm-data/model/modelpb"; -message HTTPHeader { +message Header { string key = 1; repeated string value = 2; } diff --git a/model/proto/http.proto b/model/proto/http.proto index de1f6537..3ce9f8d8 100644 --- a/model/proto/http.proto +++ b/model/proto/http.proto @@ -22,7 +22,7 @@ package elastic.apm.v1; import "google/protobuf/struct.proto"; import "cookies.proto"; import "headers.proto"; -import "keyvalue.proto"; +import "keyvaluestring.proto"; option go_package = "github.com/elastic/apm-data/model/modelpb"; @@ -33,22 +33,23 @@ message HTTP { } message HTTPRequest { - reserved 4; + reserved 2, 3, 4; google.protobuf.Value body = 1; - repeated HTTPHeader headers = 2; - repeated KeyValue env = 3; string id = 5; string method = 6; string referrer = 7; repeated HTTPCookies cookies = 8; + repeated Header headers = 9; + repeated KeyValueString env = 10; } message HTTPResponse { - repeated HTTPHeader headers = 1; + reserved 1; optional bool finished = 2; optional bool headers_sent = 3; optional uint64 transfer_size = 4; optional uint64 encoded_body_size = 5; optional uint64 decoded_body_size = 6; uint32 status_code = 7; + repeated Header headers = 8; } diff --git a/model/proto/keyvalue.proto b/model/proto/keyvaluestring.proto similarity index 90% rename from model/proto/keyvalue.proto rename to model/proto/keyvaluestring.proto index e9a95278..9143f13c 100644 --- a/model/proto/keyvalue.proto +++ b/model/proto/keyvaluestring.proto @@ -19,11 +19,9 @@ syntax = "proto3"; package elastic.apm.v1; -import "google/protobuf/struct.proto"; - option go_package = "github.com/elastic/apm-data/model/modelpb"; -message KeyValue { +message KeyValueString { string key = 1; - google.protobuf.Value value = 2; + string value = 2; } diff --git a/model/proto/message.proto b/model/proto/message.proto index f94273cd..14d0915a 100644 --- a/model/proto/message.proto +++ b/model/proto/message.proto @@ -24,9 +24,10 @@ import "headers.proto"; option go_package = "github.com/elastic/apm-data/model/modelpb"; message Message { + reserved 2; string body = 1; - repeated HTTPHeader headers = 2; optional uint64 age_millis = 3; string queue_name = 4; string routing_key = 5; + repeated Header headers = 6; } diff --git a/model/proto/stacktrace.proto b/model/proto/stacktrace.proto index 6da2b611..262c725c 100644 --- a/model/proto/stacktrace.proto +++ b/model/proto/stacktrace.proto @@ -19,12 +19,12 @@ syntax = "proto3"; package elastic.apm.v1; -import "keyvalue.proto"; +import "keyvaluestring.proto"; option go_package = "github.com/elastic/apm-data/model/modelpb"; message StacktraceFrame { - repeated KeyValue vars = 1; + reserved 1; optional uint32 lineno = 2; optional uint32 colno = 3; string filename = 4; @@ -40,6 +40,7 @@ message StacktraceFrame { bool library_frame = 14; bool sourcemap_updated = 15; bool exclude_from_grouping = 16; + repeated KeyValueString vars = 17; } message Original { diff --git a/model/proto/transaction.proto b/model/proto/transaction.proto index 6e44b145..3f4ce542 100644 --- a/model/proto/transaction.proto +++ b/model/proto/transaction.proto @@ -22,14 +22,14 @@ package elastic.apm.v1; import "experience.proto"; import "message.proto"; import "metricset.proto"; -import "keyvalue.proto"; +import "keyvaluestring.proto"; option go_package = "github.com/elastic/apm-data/model/modelpb"; message Transaction { + reserved 3; SpanCount span_count = 1; UserExperience user_experience = 2; - repeated KeyValue custom = 3; map marks = 4; Message message = 5; string type = 6; @@ -43,6 +43,7 @@ message Transaction { bool sampled = 14; bool root = 15; repeated string profiler_stack_trace_ids = 16; + repeated KeyValueString custom = 17; } message SpanCount { From a8c25f7627be8e3b9fb2fdc7ab6807a365d1fa31 Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:04:03 +0200 Subject: [PATCH 4/5] test: update tests --- .../modeldecoder/modeldecodertest/populator.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go b/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go index 9966eb1e..3baa983e 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go +++ b/input/elasticapm/internal/modeldecoder/modeldecodertest/populator.go @@ -26,7 +26,6 @@ import ( "time" "github.com/stretchr/testify/assert" - "google.golang.org/protobuf/types/known/structpb" "github.com/elastic/apm-data/input/elasticapm/internal/modeldecoder/nullable" "github.com/elastic/apm-data/model/modelpb" @@ -284,13 +283,12 @@ func AssertStructValues(t *testing.T, i interface{}, isException func(string) bo m[fmt.Sprintf("%s%v", values.Str, i)] = &modelpb.LabelValue{Value: values.Str} } newVal = m - case []*modelpb.KeyValue: - m := []*modelpb.KeyValue{} + case []*modelpb.KeyValueString: + m := []*modelpb.KeyValueString{} for i := 0; i < values.N; i++ { - value, _ := structpb.NewValue(values.Str) - m = append(m, &modelpb.KeyValue{ + m = append(m, &modelpb.KeyValueString{ Key: fmt.Sprintf("%s%v", values.Str, i), - Value: value, + Value: values.Str, }) } newVal = m @@ -442,7 +440,7 @@ func iterateStruct(v reflect.Value, key string, fn func(f reflect.Value, fKey st } switch f.Interface().(type) { - case []*modelpb.KeyValue: + case []*modelpb.KeyValueString: continue } From 14052e8eee6ceb4be12a84efe5cb5101cb80ebff Mon Sep 17 00:00:00 2001 From: kruskal <99559985+kruskall@users.noreply.github.com> Date: Thu, 4 Apr 2024 13:22:31 +0200 Subject: [PATCH 5/5] feat: accept non-string values for http cookies --- input/elasticapm/docs/spec/v2/error.json | 8 +------- input/elasticapm/docs/spec/v2/transaction.json | 8 +------- .../internal/modeldecoder/modeldecoderutil/http.go | 5 +++-- input/elasticapm/internal/modeldecoder/v2/model.go | 2 +- 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/input/elasticapm/docs/spec/v2/error.json b/input/elasticapm/docs/spec/v2/error.json index 373f0fc0..1a421afc 100644 --- a/input/elasticapm/docs/spec/v2/error.json +++ b/input/elasticapm/docs/spec/v2/error.json @@ -200,13 +200,7 @@ "type": [ "null", "object" - ], - "additionalProperties": { - "type": [ - "null", - "string" - ] - } + ] }, "env": { "description": "Env holds environment variable information passed to the monitored service.", diff --git a/input/elasticapm/docs/spec/v2/transaction.json b/input/elasticapm/docs/spec/v2/transaction.json index bd13e84a..cdc6262f 100644 --- a/input/elasticapm/docs/spec/v2/transaction.json +++ b/input/elasticapm/docs/spec/v2/transaction.json @@ -199,13 +199,7 @@ "type": [ "null", "object" - ], - "additionalProperties": { - "type": [ - "null", - "string" - ] - } + ] }, "env": { "description": "Env holds environment variable information passed to the monitored service.", diff --git a/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go b/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go index 8f1fe149..52de2e5a 100644 --- a/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go +++ b/input/elasticapm/internal/modeldecoder/modeldecoderutil/http.go @@ -19,6 +19,7 @@ package modeldecoderutil import ( "encoding/json" + "fmt" "net/http" "github.com/elastic/apm-data/model/modelpb" @@ -45,7 +46,7 @@ func HTTPHeadersToStructPb(h http.Header) *structpb.Struct { return nil } -func HTTPCookiesToModelpb(m map[string]string, out []*modelpb.HTTPCookies) []*modelpb.HTTPCookies { +func HTTPCookiesToModelpb(m map[string]any, out []*modelpb.HTTPCookies) []*modelpb.HTTPCookies { if len(m) == 0 { return nil } @@ -53,7 +54,7 @@ func HTTPCookiesToModelpb(m map[string]string, out []*modelpb.HTTPCookies) []*mo i := 0 for k, v := range m { out[i].Key = k - out[i].Value = v + out[i].Value = fmt.Sprint(v) i++ } return out diff --git a/input/elasticapm/internal/modeldecoder/v2/model.go b/input/elasticapm/internal/modeldecoder/v2/model.go index ec314464..467fbd51 100644 --- a/input/elasticapm/internal/modeldecoder/v2/model.go +++ b/input/elasticapm/internal/modeldecoder/v2/model.go @@ -188,7 +188,7 @@ type contextPage struct { type contextRequest struct { // Cookies used by the request, parsed as key-value objects. - Cookies map[string]string `json:"cookies"` + Cookies map[string]any `json:"cookies"` // Env holds environment variable information passed to the monitored service. Env map[string]any `json:"env"` // Body only contais the request bod, not the query string information.