From b131f7afd57fbce9365d55c70eb15c92d18142e7 Mon Sep 17 00:00:00 2001 From: Annanay Date: Sat, 16 Mar 2019 11:56:40 +0530 Subject: [PATCH 1/8] New project layout for proto definitions Signed-off-by: Annanay --- model/proto/api_v2/collector.proto | 66 +++++++++++++++++++ .../{api_v2.proto => api_v2/sampling.proto} | 21 +----- proto-gen/openapi/api_v2.swagger.json | 2 +- 3 files changed, 68 insertions(+), 21 deletions(-) create mode 100644 model/proto/api_v2/collector.proto rename model/proto/{api_v2.proto => api_v2/sampling.proto} (88%) diff --git a/model/proto/api_v2/collector.proto b/model/proto/api_v2/collector.proto new file mode 100644 index 00000000000..c6c4c17ee79 --- /dev/null +++ b/model/proto/api_v2/collector.proto @@ -0,0 +1,66 @@ +// Copyright (c) 2018 Uber Technologies, Inc. +// Copyright (c) 2019 The Jaeger Authors. +// +// Licensed 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 jaeger.api_v2; + +import "model/proto/model.proto"; +import "gogoproto/gogo.proto"; +import "google/api/annotations.proto"; +import "protoc-gen-swagger/options/annotations.proto"; + +option go_package = "api_v2"; +option java_package = "io.jaegertracing.api_v2"; + +// Enable gogoprotobuf extensions (https://github.com/gogo/protobuf/blob/master/extensions.md). +// Enable custom Marshal method. +option (gogoproto.marshaler_all) = true; +// Enable custom Unmarshal method. +option (gogoproto.unmarshaler_all) = true; +// Enable custom Size method (Required by Marshal and Unmarshal). +option (gogoproto.sizer_all) = true; +// Enable registration with golang/protobuf for the grpc-gateway. +option (gogoproto.goproto_registration) = true; + +option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { + info: { + version: "1.0"; + }; + external_docs: { + url: "https://github.com/jaegertracing/jaeger"; + description: "Jaeger API"; + } + schemes: HTTP; + schemes: HTTPS; +}; + +message PostSpansRequest { + Batch batch = 1 [ + (gogoproto.nullable) = false + ]; +} + +message PostSpansResponse { +} + +service CollectorService { + rpc PostSpans(PostSpansRequest) returns (PostSpansResponse) { + option (google.api.http) = { + post: "/api/v2/spans" + body: "*" + }; + } +} diff --git a/model/proto/api_v2.proto b/model/proto/api_v2/sampling.proto similarity index 88% rename from model/proto/api_v2.proto rename to model/proto/api_v2/sampling.proto index 1fbc358aacd..4fe6a40a6b6 100644 --- a/model/proto/api_v2.proto +++ b/model/proto/api_v2/sampling.proto @@ -1,4 +1,5 @@ // Copyright (c) 2018 Uber Technologies, Inc. +// Copyright (c) 2019 The Jaeger Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,7 +17,6 @@ syntax="proto3"; package jaeger.api_v2; -import "model.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "protoc-gen-swagger/options/annotations.proto"; @@ -46,24 +46,6 @@ option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = { schemes: HTTPS; }; -message PostSpansRequest { - Batch batch = 1 [ - (gogoproto.nullable) = false - ]; -} - -message PostSpansResponse { -} - -service CollectorService { - rpc PostSpans(PostSpansRequest) returns (PostSpansResponse) { - option (google.api.http) = { - post: "/api/v2/spans" - body: "*" - }; - } -} - enum SamplingStrategyType { PROBABILISTIC = 0; RATE_LIMITING = 1; @@ -108,4 +90,3 @@ service SamplingManager { }; } } - diff --git a/proto-gen/openapi/api_v2.swagger.json b/proto-gen/openapi/api_v2.swagger.json index 468e1ceca96..d46c61234e8 100644 --- a/proto-gen/openapi/api_v2.swagger.json +++ b/proto-gen/openapi/api_v2.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "api_v2.proto", + "title": "model/proto/api_v2/sampling.proto", "version": "1.0" }, "schemes": [ From 10762ee6a81013b06eedf3264701baed6d0f450e Mon Sep 17 00:00:00 2001 From: Annanay Date: Sun, 17 Mar 2019 01:05:14 +0530 Subject: [PATCH 2/8] Regenerate grpc code from proto definitions Signed-off-by: Annanay --- proto-gen/api_v2/collector.pb.go | 514 ++++++++++++++ proto-gen/api_v2/collector.pb.gw.go | 112 +++ .../api_v2/{api_v2.pb.go => sampling.pb.go} | 656 ++++++------------ proto-gen/api_v2/sampling.pb.gw.go | 112 +++ 4 files changed, 935 insertions(+), 459 deletions(-) create mode 100644 proto-gen/api_v2/collector.pb.go create mode 100644 proto-gen/api_v2/collector.pb.gw.go rename proto-gen/api_v2/{api_v2.pb.go => sampling.pb.go} (63%) create mode 100644 proto-gen/api_v2/sampling.pb.gw.go diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go new file mode 100644 index 00000000000..7f6ef1bc881 --- /dev/null +++ b/proto-gen/api_v2/collector.pb.go @@ -0,0 +1,514 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: model/proto/api_v2/collector.proto + +/* + Package api_v2 is a generated protocol buffer package. + + It is generated from these files: + model/proto/api_v2/collector.proto + model/proto/api_v2/sampling.proto + + It has these top-level messages: + PostSpansRequest + PostSpansResponse + ProbabilisticSamplingStrategy + RateLimitingSamplingStrategy + OperationSamplingStrategy + PerOperationSamplingStrategies + SamplingStrategyResponse + SamplingStrategyParameters +*/ +package api_v2 + +import proto "github.com/gogo/protobuf/proto" +import golang_proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import jaeger_api_v2 "github.com/jaegertracing/jaeger/model/proto" +import _ "github.com/gogo/protobuf/gogoproto" +import _ "github.com/gogo/googleapis/google/api" +import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" + +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) + +import io "io" + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = golang_proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + +type PostSpansRequest struct { + Batch jaeger_api_v2.Batch `protobuf:"bytes,1,opt,name=batch" json:"batch"` +} + +func (m *PostSpansRequest) Reset() { *m = PostSpansRequest{} } +func (m *PostSpansRequest) String() string { return proto.CompactTextString(m) } +func (*PostSpansRequest) ProtoMessage() {} +func (*PostSpansRequest) Descriptor() ([]byte, []int) { return fileDescriptorCollector, []int{0} } + +func (m *PostSpansRequest) GetBatch() jaeger_api_v2.Batch { + if m != nil { + return m.Batch + } + return jaeger_api_v2.Batch{} +} + +type PostSpansResponse struct { +} + +func (m *PostSpansResponse) Reset() { *m = PostSpansResponse{} } +func (m *PostSpansResponse) String() string { return proto.CompactTextString(m) } +func (*PostSpansResponse) ProtoMessage() {} +func (*PostSpansResponse) Descriptor() ([]byte, []int) { return fileDescriptorCollector, []int{1} } + +func init() { + proto.RegisterType((*PostSpansRequest)(nil), "jaeger.api_v2.PostSpansRequest") + golang_proto.RegisterType((*PostSpansRequest)(nil), "jaeger.api_v2.PostSpansRequest") + proto.RegisterType((*PostSpansResponse)(nil), "jaeger.api_v2.PostSpansResponse") + golang_proto.RegisterType((*PostSpansResponse)(nil), "jaeger.api_v2.PostSpansResponse") +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// Client API for CollectorService service + +type CollectorServiceClient interface { + PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) +} + +type collectorServiceClient struct { + cc *grpc.ClientConn +} + +func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { + return &collectorServiceClient{cc} +} + +func (c *collectorServiceClient) PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) { + out := new(PostSpansResponse) + err := grpc.Invoke(ctx, "/jaeger.api_v2.CollectorService/PostSpans", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for CollectorService service + +type CollectorServiceServer interface { + PostSpans(context.Context, *PostSpansRequest) (*PostSpansResponse, error) +} + +func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { + s.RegisterService(&_CollectorService_serviceDesc, srv) +} + +func _CollectorService_PostSpans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PostSpansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(CollectorServiceServer).PostSpans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/jaeger.api_v2.CollectorService/PostSpans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(CollectorServiceServer).PostSpans(ctx, req.(*PostSpansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _CollectorService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "jaeger.api_v2.CollectorService", + HandlerType: (*CollectorServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "PostSpans", + Handler: _CollectorService_PostSpans_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "model/proto/api_v2/collector.proto", +} + +func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostSpansRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + dAtA[i] = 0xa + i++ + i = encodeVarintCollector(dAtA, i, uint64(m.Batch.Size())) + n1, err := m.Batch.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + return i, nil +} + +func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PostSpansResponse) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + return i, nil +} + +func encodeFixed64Collector(dAtA []byte, offset int, v uint64) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + dAtA[offset+4] = uint8(v >> 32) + dAtA[offset+5] = uint8(v >> 40) + dAtA[offset+6] = uint8(v >> 48) + dAtA[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Collector(dAtA []byte, offset int, v uint32) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *PostSpansRequest) Size() (n int) { + var l int + _ = l + l = m.Batch.Size() + n += 1 + l + sovCollector(uint64(l)) + return n +} + +func (m *PostSpansResponse) Size() (n int) { + var l int + _ = l + return n +} + +func sovCollector(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozCollector(x uint64) (n int) { + return sovCollector(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *PostSpansRequest) Unmarshal(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 ErrIntOverflowCollector + } + 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: PostSpansRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostSpansRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowCollector + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthCollector + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Batch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipCollector(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCollector + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PostSpansResponse) Unmarshal(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 ErrIntOverflowCollector + } + 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: PostSpansResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PostSpansResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipCollector(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthCollector + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipCollector(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCollector + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCollector + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCollector + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthCollector + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowCollector + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipCollector(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("model/proto/api_v2/collector.proto", fileDescriptorCollector) } +func init() { golang_proto.RegisterFile("model/proto/api_v2/collector.proto", fileDescriptorCollector) } + +var fileDescriptorCollector = []byte{ + // 344 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xc1, 0x4e, 0xea, 0x40, + 0x14, 0x86, 0xef, 0x70, 0x2f, 0x24, 0x77, 0x0c, 0x09, 0x56, 0x12, 0x08, 0x31, 0x85, 0x74, 0xa3, + 0x21, 0xd2, 0xc1, 0x1a, 0x37, 0xec, 0xa8, 0x6e, 0x74, 0x45, 0x60, 0xe7, 0xc6, 0x0c, 0x75, 0x32, + 0xad, 0x29, 0x3d, 0x75, 0x66, 0xa8, 0x1b, 0x57, 0x3e, 0x82, 0xbe, 0x90, 0x4b, 0x96, 0x26, 0xee, + 0x8d, 0x41, 0x1f, 0xc4, 0x74, 0xa6, 0x1a, 0xc0, 0xb8, 0x3a, 0xa7, 0xe7, 0xff, 0xfa, 0x9f, 0x7f, + 0x0e, 0x76, 0x66, 0x70, 0xc5, 0x62, 0x92, 0x0a, 0x50, 0x40, 0x68, 0x1a, 0x5d, 0x66, 0x1e, 0x09, + 0x20, 0x8e, 0x59, 0xa0, 0x40, 0xb8, 0x7a, 0x6c, 0x55, 0xaf, 0x29, 0xe3, 0x4c, 0xb8, 0x46, 0x6e, + 0x35, 0x56, 0x7f, 0xd1, 0xbd, 0xe1, 0x5a, 0x75, 0x0e, 0x1c, 0xcc, 0x38, 0xef, 0x8a, 0xe9, 0x2e, + 0x07, 0xe0, 0x31, 0xcb, 0xcd, 0x09, 0x4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xae, 0x81, + 0x45, 0xb6, 0x8b, 0x8a, 0xa9, 0xd3, 0x8a, 0xbe, 0xeb, 0xd1, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x45, 0xdb, 0x7c, 0x7d, 0x07, 0x02, 0x00, 0x00, +} diff --git a/proto-gen/api_v2/collector.pb.gw.go b/proto-gen/api_v2/collector.pb.gw.go new file mode 100644 index 00000000000..cc253e09c11 --- /dev/null +++ b/proto-gen/api_v2/collector.pb.gw.go @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: model/proto/api_v2/collector.proto + +/* +Package api_v2 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package api_v2 + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_CollectorService_PostSpans_0(ctx context.Context, marshaler runtime.Marshaler, client CollectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq PostSpansRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.PostSpans(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterCollectorServiceHandlerFromEndpoint is same as RegisterCollectorServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterCollectorServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterCollectorServiceHandler(ctx, mux, conn) +} + +// RegisterCollectorServiceHandler registers the http handlers for service CollectorService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterCollectorServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewCollectorServiceClient(conn) + + mux.Handle("POST", pattern_CollectorService_PostSpans_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_CollectorService_PostSpans_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_CollectorService_PostSpans_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_CollectorService_PostSpans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "spans"}, "")) +) + +var ( + forward_CollectorService_PostSpans_0 = runtime.ForwardResponseMessage +) diff --git a/proto-gen/api_v2/api_v2.pb.go b/proto-gen/api_v2/sampling.pb.go similarity index 63% rename from proto-gen/api_v2/api_v2.pb.go rename to proto-gen/api_v2/sampling.pb.go index 64affc52580..13412008a45 100644 --- a/proto-gen/api_v2/api_v2.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -1,37 +1,20 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api_v2.proto - -/* - Package api_v2 is a generated protocol buffer package. - - It is generated from these files: - api_v2.proto - - It has these top-level messages: - PostSpansRequest - PostSpansResponse - ProbabilisticSamplingStrategy - RateLimitingSamplingStrategy - OperationSamplingStrategy - PerOperationSamplingStrategies - SamplingStrategyResponse - SamplingStrategyParameters -*/ +// source: model/proto/api_v2/sampling.proto + package api_v2 import proto "github.com/gogo/protobuf/proto" import golang_proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import jaeger_api_v2 "github.com/jaegertracing/jaeger/model" import _ "github.com/gogo/protobuf/gogoproto" import _ "github.com/gogo/googleapis/google/api" import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" -import context "golang.org/x/net/context" -import grpc "google.golang.org/grpc" - -import binary "encoding/binary" +import ( + context "golang.org/x/net/context" + grpc "google.golang.org/grpc" +) import io "io" @@ -41,12 +24,6 @@ var _ = golang_proto.Marshal var _ = fmt.Errorf var _ = math.Inf -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package - type SamplingStrategyType int32 const ( @@ -66,31 +43,7 @@ var SamplingStrategyType_value = map[string]int32{ func (x SamplingStrategyType) String() string { return proto.EnumName(SamplingStrategyType_name, int32(x)) } -func (SamplingStrategyType) EnumDescriptor() ([]byte, []int) { return fileDescriptorApiV2, []int{0} } - -type PostSpansRequest struct { - Batch jaeger_api_v2.Batch `protobuf:"bytes,1,opt,name=batch" json:"batch"` -} - -func (m *PostSpansRequest) Reset() { *m = PostSpansRequest{} } -func (m *PostSpansRequest) String() string { return proto.CompactTextString(m) } -func (*PostSpansRequest) ProtoMessage() {} -func (*PostSpansRequest) Descriptor() ([]byte, []int) { return fileDescriptorApiV2, []int{0} } - -func (m *PostSpansRequest) GetBatch() jaeger_api_v2.Batch { - if m != nil { - return m.Batch - } - return jaeger_api_v2.Batch{} -} - -type PostSpansResponse struct { -} - -func (m *PostSpansResponse) Reset() { *m = PostSpansResponse{} } -func (m *PostSpansResponse) String() string { return proto.CompactTextString(m) } -func (*PostSpansResponse) ProtoMessage() {} -func (*PostSpansResponse) Descriptor() ([]byte, []int) { return fileDescriptorApiV2, []int{1} } +func (SamplingStrategyType) EnumDescriptor() ([]byte, []int) { return fileDescriptorSampling, []int{0} } type ProbabilisticSamplingStrategy struct { SamplingRate float64 `protobuf:"fixed64,1,opt,name=samplingRate,proto3" json:"samplingRate,omitempty"` @@ -100,7 +53,7 @@ func (m *ProbabilisticSamplingStrategy) Reset() { *m = ProbabilisticSamp func (m *ProbabilisticSamplingStrategy) String() string { return proto.CompactTextString(m) } func (*ProbabilisticSamplingStrategy) ProtoMessage() {} func (*ProbabilisticSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptorApiV2, []int{2} + return fileDescriptorSampling, []int{0} } func (m *ProbabilisticSamplingStrategy) GetSamplingRate() float64 { @@ -118,7 +71,7 @@ func (m *RateLimitingSamplingStrategy) Reset() { *m = RateLimitingSampli func (m *RateLimitingSamplingStrategy) String() string { return proto.CompactTextString(m) } func (*RateLimitingSamplingStrategy) ProtoMessage() {} func (*RateLimitingSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptorApiV2, []int{3} + return fileDescriptorSampling, []int{1} } func (m *RateLimitingSamplingStrategy) GetMaxTracesPerSecond() int32 { @@ -133,10 +86,12 @@ type OperationSamplingStrategy struct { ProbabilisticSampling *ProbabilisticSamplingStrategy `protobuf:"bytes,2,opt,name=probabilisticSampling" json:"probabilisticSampling,omitempty"` } -func (m *OperationSamplingStrategy) Reset() { *m = OperationSamplingStrategy{} } -func (m *OperationSamplingStrategy) String() string { return proto.CompactTextString(m) } -func (*OperationSamplingStrategy) ProtoMessage() {} -func (*OperationSamplingStrategy) Descriptor() ([]byte, []int) { return fileDescriptorApiV2, []int{4} } +func (m *OperationSamplingStrategy) Reset() { *m = OperationSamplingStrategy{} } +func (m *OperationSamplingStrategy) String() string { return proto.CompactTextString(m) } +func (*OperationSamplingStrategy) ProtoMessage() {} +func (*OperationSamplingStrategy) Descriptor() ([]byte, []int) { + return fileDescriptorSampling, []int{2} +} func (m *OperationSamplingStrategy) GetOperation() string { if m != nil { @@ -163,7 +118,7 @@ func (m *PerOperationSamplingStrategies) Reset() { *m = PerOperationSamp func (m *PerOperationSamplingStrategies) String() string { return proto.CompactTextString(m) } func (*PerOperationSamplingStrategies) ProtoMessage() {} func (*PerOperationSamplingStrategies) Descriptor() ([]byte, []int) { - return fileDescriptorApiV2, []int{5} + return fileDescriptorSampling, []int{3} } func (m *PerOperationSamplingStrategies) GetDefaultSamplingProbability() float64 { @@ -204,7 +159,7 @@ type SamplingStrategyResponse struct { func (m *SamplingStrategyResponse) Reset() { *m = SamplingStrategyResponse{} } func (m *SamplingStrategyResponse) String() string { return proto.CompactTextString(m) } func (*SamplingStrategyResponse) ProtoMessage() {} -func (*SamplingStrategyResponse) Descriptor() ([]byte, []int) { return fileDescriptorApiV2, []int{6} } +func (*SamplingStrategyResponse) Descriptor() ([]byte, []int) { return fileDescriptorSampling, []int{4} } func (m *SamplingStrategyResponse) GetStrategyType() SamplingStrategyType { if m != nil { @@ -238,10 +193,12 @@ type SamplingStrategyParameters struct { ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` } -func (m *SamplingStrategyParameters) Reset() { *m = SamplingStrategyParameters{} } -func (m *SamplingStrategyParameters) String() string { return proto.CompactTextString(m) } -func (*SamplingStrategyParameters) ProtoMessage() {} -func (*SamplingStrategyParameters) Descriptor() ([]byte, []int) { return fileDescriptorApiV2, []int{7} } +func (m *SamplingStrategyParameters) Reset() { *m = SamplingStrategyParameters{} } +func (m *SamplingStrategyParameters) String() string { return proto.CompactTextString(m) } +func (*SamplingStrategyParameters) ProtoMessage() {} +func (*SamplingStrategyParameters) Descriptor() ([]byte, []int) { + return fileDescriptorSampling, []int{5} +} func (m *SamplingStrategyParameters) GetServiceName() string { if m != nil { @@ -251,10 +208,6 @@ func (m *SamplingStrategyParameters) GetServiceName() string { } func init() { - proto.RegisterType((*PostSpansRequest)(nil), "jaeger.api_v2.PostSpansRequest") - golang_proto.RegisterType((*PostSpansRequest)(nil), "jaeger.api_v2.PostSpansRequest") - proto.RegisterType((*PostSpansResponse)(nil), "jaeger.api_v2.PostSpansResponse") - golang_proto.RegisterType((*PostSpansResponse)(nil), "jaeger.api_v2.PostSpansResponse") proto.RegisterType((*ProbabilisticSamplingStrategy)(nil), "jaeger.api_v2.ProbabilisticSamplingStrategy") golang_proto.RegisterType((*ProbabilisticSamplingStrategy)(nil), "jaeger.api_v2.ProbabilisticSamplingStrategy") proto.RegisterType((*RateLimitingSamplingStrategy)(nil), "jaeger.api_v2.RateLimitingSamplingStrategy") @@ -279,70 +232,6 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for CollectorService service - -type CollectorServiceClient interface { - PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) -} - -type collectorServiceClient struct { - cc *grpc.ClientConn -} - -func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { - return &collectorServiceClient{cc} -} - -func (c *collectorServiceClient) PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) { - out := new(PostSpansResponse) - err := grpc.Invoke(ctx, "/jaeger.api_v2.CollectorService/PostSpans", in, out, c.cc, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// Server API for CollectorService service - -type CollectorServiceServer interface { - PostSpans(context.Context, *PostSpansRequest) (*PostSpansResponse, error) -} - -func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { - s.RegisterService(&_CollectorService_serviceDesc, srv) -} - -func _CollectorService_PostSpans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PostSpansRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(CollectorServiceServer).PostSpans(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.CollectorService/PostSpans", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(CollectorServiceServer).PostSpans(ctx, req.(*PostSpansRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _CollectorService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "jaeger.api_v2.CollectorService", - HandlerType: (*CollectorServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "PostSpans", - Handler: _CollectorService_PostSpans_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "api_v2.proto", -} - // Client API for SamplingManager service type SamplingManagerClient interface { @@ -404,51 +293,7 @@ var _SamplingManager_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "api_v2.proto", -} - -func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PostSpansRequest) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.Batch.Size())) - n1, err := m.Batch.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 - return i, nil -} - -func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PostSpansResponse) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - return i, nil + Metadata: "model/proto/api_v2/sampling.proto", } func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { @@ -469,8 +314,7 @@ func (m *ProbabilisticSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { if m.SamplingRate != 0 { dAtA[i] = 0x9 i++ - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SamplingRate)))) - i += 8 + i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.SamplingRate)))) } return i, nil } @@ -493,7 +337,7 @@ func (m *RateLimitingSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { if m.MaxTracesPerSecond != 0 { dAtA[i] = 0x8 i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.MaxTracesPerSecond)) + i = encodeVarintSampling(dAtA, i, uint64(m.MaxTracesPerSecond)) } return i, nil } @@ -516,18 +360,18 @@ func (m *OperationSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { if len(m.Operation) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintApiV2(dAtA, i, uint64(len(m.Operation))) + i = encodeVarintSampling(dAtA, i, uint64(len(m.Operation))) i += copy(dAtA[i:], m.Operation) } if m.ProbabilisticSampling != nil { dAtA[i] = 0x12 i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.ProbabilisticSampling.Size())) - n2, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) + i = encodeVarintSampling(dAtA, i, uint64(m.ProbabilisticSampling.Size())) + n1, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n2 + i += n1 } return i, nil } @@ -550,20 +394,18 @@ func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { if m.DefaultSamplingProbability != 0 { dAtA[i] = 0x9 i++ - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) - i += 8 + i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) } if m.DefaultLowerBoundTracesPerSecond != 0 { dAtA[i] = 0x11 i++ - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) - i += 8 + i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) } if len(m.PerOperationStrategies) > 0 { for _, msg := range m.PerOperationStrategies { dAtA[i] = 0x1a i++ - i = encodeVarintApiV2(dAtA, i, uint64(msg.Size())) + i = encodeVarintSampling(dAtA, i, uint64(msg.Size())) n, err := msg.MarshalTo(dAtA[i:]) if err != nil { return 0, err @@ -574,8 +416,7 @@ func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { if m.DefaultUpperBoundTracesPerSecond != 0 { dAtA[i] = 0x21 i++ - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) - i += 8 + i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) } return i, nil } @@ -598,37 +439,37 @@ func (m *SamplingStrategyResponse) MarshalTo(dAtA []byte) (int, error) { if m.StrategyType != 0 { dAtA[i] = 0x8 i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.StrategyType)) + i = encodeVarintSampling(dAtA, i, uint64(m.StrategyType)) } if m.ProbabilisticSampling != nil { dAtA[i] = 0x12 i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.ProbabilisticSampling.Size())) - n3, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) + i = encodeVarintSampling(dAtA, i, uint64(m.ProbabilisticSampling.Size())) + n2, err := m.ProbabilisticSampling.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n3 + i += n2 } if m.RateLimitingSampling != nil { dAtA[i] = 0x1a i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.RateLimitingSampling.Size())) - n4, err := m.RateLimitingSampling.MarshalTo(dAtA[i:]) + i = encodeVarintSampling(dAtA, i, uint64(m.RateLimitingSampling.Size())) + n3, err := m.RateLimitingSampling.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n4 + i += n3 } if m.OperationSampling != nil { dAtA[i] = 0x22 i++ - i = encodeVarintApiV2(dAtA, i, uint64(m.OperationSampling.Size())) - n5, err := m.OperationSampling.MarshalTo(dAtA[i:]) + i = encodeVarintSampling(dAtA, i, uint64(m.OperationSampling.Size())) + n4, err := m.OperationSampling.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n5 + i += n4 } return i, nil } @@ -651,13 +492,31 @@ func (m *SamplingStrategyParameters) MarshalTo(dAtA []byte) (int, error) { if len(m.ServiceName) > 0 { dAtA[i] = 0xa i++ - i = encodeVarintApiV2(dAtA, i, uint64(len(m.ServiceName))) + i = encodeVarintSampling(dAtA, i, uint64(len(m.ServiceName))) i += copy(dAtA[i:], m.ServiceName) } return i, nil } -func encodeVarintApiV2(dAtA []byte, offset int, v uint64) int { +func encodeFixed64Sampling(dAtA []byte, offset int, v uint64) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + dAtA[offset+4] = uint8(v >> 32) + dAtA[offset+5] = uint8(v >> 40) + dAtA[offset+6] = uint8(v >> 48) + dAtA[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Sampling(dAtA []byte, offset int, v uint32) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 @@ -666,20 +525,6 @@ func encodeVarintApiV2(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return offset + 1 } -func (m *PostSpansRequest) Size() (n int) { - var l int - _ = l - l = m.Batch.Size() - n += 1 + l + sovApiV2(uint64(l)) - return n -} - -func (m *PostSpansResponse) Size() (n int) { - var l int - _ = l - return n -} - func (m *ProbabilisticSamplingStrategy) Size() (n int) { var l int _ = l @@ -693,7 +538,7 @@ func (m *RateLimitingSamplingStrategy) Size() (n int) { var l int _ = l if m.MaxTracesPerSecond != 0 { - n += 1 + sovApiV2(uint64(m.MaxTracesPerSecond)) + n += 1 + sovSampling(uint64(m.MaxTracesPerSecond)) } return n } @@ -703,11 +548,11 @@ func (m *OperationSamplingStrategy) Size() (n int) { _ = l l = len(m.Operation) if l > 0 { - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } if m.ProbabilisticSampling != nil { l = m.ProbabilisticSampling.Size() - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } return n } @@ -724,7 +569,7 @@ func (m *PerOperationSamplingStrategies) Size() (n int) { if len(m.PerOperationStrategies) > 0 { for _, e := range m.PerOperationStrategies { l = e.Size() - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } } if m.DefaultUpperBoundTracesPerSecond != 0 { @@ -737,19 +582,19 @@ func (m *SamplingStrategyResponse) Size() (n int) { var l int _ = l if m.StrategyType != 0 { - n += 1 + sovApiV2(uint64(m.StrategyType)) + n += 1 + sovSampling(uint64(m.StrategyType)) } if m.ProbabilisticSampling != nil { l = m.ProbabilisticSampling.Size() - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } if m.RateLimitingSampling != nil { l = m.RateLimitingSampling.Size() - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } if m.OperationSampling != nil { l = m.OperationSampling.Size() - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } return n } @@ -759,12 +604,12 @@ func (m *SamplingStrategyParameters) Size() (n int) { _ = l l = len(m.ServiceName) if l > 0 { - n += 1 + l + sovApiV2(uint64(l)) + n += 1 + l + sovSampling(uint64(l)) } return n } -func sovApiV2(x uint64) (n int) { +func sovSampling(x uint64) (n int) { for { n++ x >>= 7 @@ -774,138 +619,8 @@ func sovApiV2(x uint64) (n int) { } return n } -func sozApiV2(x uint64) (n int) { - return sovApiV2(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *PostSpansRequest) Unmarshal(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 ErrIntOverflowApiV2 - } - 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: PostSpansRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PostSpansRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Batch", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowApiV2 - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthApiV2 - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Batch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthApiV2 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PostSpansResponse) Unmarshal(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 ErrIntOverflowApiV2 - } - 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: PostSpansResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PostSpansResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthApiV2 - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil +func sozSampling(x uint64) (n int) { + return sovSampling(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { l := len(dAtA) @@ -915,7 +630,7 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -944,17 +659,24 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 + v = uint64(dAtA[iNdEx-8]) + v |= uint64(dAtA[iNdEx-7]) << 8 + v |= uint64(dAtA[iNdEx-6]) << 16 + v |= uint64(dAtA[iNdEx-5]) << 24 + v |= uint64(dAtA[iNdEx-4]) << 32 + v |= uint64(dAtA[iNdEx-3]) << 40 + v |= uint64(dAtA[iNdEx-2]) << 48 + v |= uint64(dAtA[iNdEx-1]) << 56 m.SamplingRate = float64(math.Float64frombits(v)) default: iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) + skippy, err := skipSampling(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -976,7 +698,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1004,7 +726,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { m.MaxTracesPerSecond = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1018,12 +740,12 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { } default: iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) + skippy, err := skipSampling(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1045,7 +767,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1073,7 +795,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1087,7 +809,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + intStringLen if postIndex > l { @@ -1102,7 +824,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1115,7 +837,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + msglen if postIndex > l { @@ -1130,12 +852,12 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) + skippy, err := skipSampling(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1157,7 +879,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1186,8 +908,15 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 + v = uint64(dAtA[iNdEx-8]) + v |= uint64(dAtA[iNdEx-7]) << 8 + v |= uint64(dAtA[iNdEx-6]) << 16 + v |= uint64(dAtA[iNdEx-5]) << 24 + v |= uint64(dAtA[iNdEx-4]) << 32 + v |= uint64(dAtA[iNdEx-3]) << 40 + v |= uint64(dAtA[iNdEx-2]) << 48 + v |= uint64(dAtA[iNdEx-1]) << 56 m.DefaultSamplingProbability = float64(math.Float64frombits(v)) case 2: if wireType != 1 { @@ -1197,8 +926,15 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 + v = uint64(dAtA[iNdEx-8]) + v |= uint64(dAtA[iNdEx-7]) << 8 + v |= uint64(dAtA[iNdEx-6]) << 16 + v |= uint64(dAtA[iNdEx-5]) << 24 + v |= uint64(dAtA[iNdEx-4]) << 32 + v |= uint64(dAtA[iNdEx-3]) << 40 + v |= uint64(dAtA[iNdEx-2]) << 48 + v |= uint64(dAtA[iNdEx-1]) << 56 m.DefaultLowerBoundTracesPerSecond = float64(math.Float64frombits(v)) case 3: if wireType != 2 { @@ -1207,7 +943,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1220,7 +956,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + msglen if postIndex > l { @@ -1239,17 +975,24 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 + v = uint64(dAtA[iNdEx-8]) + v |= uint64(dAtA[iNdEx-7]) << 8 + v |= uint64(dAtA[iNdEx-6]) << 16 + v |= uint64(dAtA[iNdEx-5]) << 24 + v |= uint64(dAtA[iNdEx-4]) << 32 + v |= uint64(dAtA[iNdEx-3]) << 40 + v |= uint64(dAtA[iNdEx-2]) << 48 + v |= uint64(dAtA[iNdEx-1]) << 56 m.DefaultUpperBoundTracesPerSecond = float64(math.Float64frombits(v)) default: iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) + skippy, err := skipSampling(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1271,7 +1014,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1299,7 +1042,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { m.StrategyType = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1318,7 +1061,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1331,7 +1074,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + msglen if postIndex > l { @@ -1351,7 +1094,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1364,7 +1107,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + msglen if postIndex > l { @@ -1384,7 +1127,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1397,7 +1140,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } } if msglen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + msglen if postIndex > l { @@ -1412,12 +1155,12 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) + skippy, err := skipSampling(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1439,7 +1182,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1467,7 +1210,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return ErrIntOverflowApiV2 + return ErrIntOverflowSampling } if iNdEx >= l { return io.ErrUnexpectedEOF @@ -1481,7 +1224,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { } intStringLen := int(stringLen) if intStringLen < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } postIndex := iNdEx + intStringLen if postIndex > l { @@ -1491,12 +1234,12 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { iNdEx = postIndex default: iNdEx = preIndex - skippy, err := skipApiV2(dAtA[iNdEx:]) + skippy, err := skipSampling(dAtA[iNdEx:]) if err != nil { return err } if skippy < 0 { - return ErrInvalidLengthApiV2 + return ErrInvalidLengthSampling } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF @@ -1510,14 +1253,14 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { } return nil } -func skipApiV2(dAtA []byte) (n int, err error) { +func skipSampling(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApiV2 + return 0, ErrIntOverflowSampling } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1534,7 +1277,7 @@ func skipApiV2(dAtA []byte) (n int, err error) { case 0: for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApiV2 + return 0, ErrIntOverflowSampling } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1552,7 +1295,7 @@ func skipApiV2(dAtA []byte) (n int, err error) { var length int for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApiV2 + return 0, ErrIntOverflowSampling } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1566,7 +1309,7 @@ func skipApiV2(dAtA []byte) (n int, err error) { } iNdEx += length if length < 0 { - return 0, ErrInvalidLengthApiV2 + return 0, ErrInvalidLengthSampling } return iNdEx, nil case 3: @@ -1575,7 +1318,7 @@ func skipApiV2(dAtA []byte) (n int, err error) { var start int = iNdEx for shift := uint(0); ; shift += 7 { if shift >= 64 { - return 0, ErrIntOverflowApiV2 + return 0, ErrIntOverflowSampling } if iNdEx >= l { return 0, io.ErrUnexpectedEOF @@ -1591,7 +1334,7 @@ func skipApiV2(dAtA []byte) (n int, err error) { if innerWireType == 4 { break } - next, err := skipApiV2(dAtA[start:]) + next, err := skipSampling(dAtA[start:]) if err != nil { return 0, err } @@ -1611,59 +1354,54 @@ func skipApiV2(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthApiV2 = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowApiV2 = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") ) -func init() { proto.RegisterFile("api_v2.proto", fileDescriptorApiV2) } -func init() { golang_proto.RegisterFile("api_v2.proto", fileDescriptorApiV2) } - -var fileDescriptorApiV2 = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0x66, 0x5b, 0x20, 0xe1, 0x15, 0xb4, 0x0c, 0x55, 0x6b, 0x03, 0xa5, 0x59, 0x0e, 0x60, 0x85, - 0x5d, 0x5c, 0xe3, 0x85, 0x18, 0x92, 0x16, 0x0d, 0x29, 0x29, 0xd0, 0x6c, 0xeb, 0x45, 0x0f, 0x38, - 0xdd, 0x8e, 0xdb, 0x35, 0xed, 0xce, 0x38, 0x33, 0x2d, 0x92, 0x78, 0x32, 0xf1, 0xea, 0x41, 0xcf, - 0x5e, 0xfc, 0x4b, 0x3c, 0x72, 0x34, 0xf1, 0xe6, 0xc1, 0x18, 0xf4, 0x0f, 0x31, 0x9d, 0x2e, 0xa5, - 0xdd, 0xfe, 0xe0, 0xe6, 0x69, 0xb7, 0xef, 0x7d, 0xf3, 0xbd, 0xef, 0x7d, 0xfb, 0xe6, 0x15, 0xe6, - 0x31, 0xf3, 0x4e, 0xda, 0x96, 0xc1, 0x38, 0x95, 0x14, 0x2d, 0xbc, 0xc6, 0xc4, 0x25, 0xdc, 0xe8, - 0x06, 0x53, 0xb1, 0x26, 0xad, 0x91, 0x46, 0x37, 0x97, 0x4a, 0xb8, 0xd4, 0xa5, 0xea, 0xd5, 0xec, - 0xbc, 0x05, 0xd1, 0x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x5b, 0x5d, 0x72, 0xec, 0x78, 0xbe, 0x1b, 0xfc, 0x3a, - 0xbf, 0x48, 0x6b, 0xdf, 0x2f, 0xd2, 0xda, 0xef, 0x8b, 0xb4, 0xf6, 0xed, 0x4f, 0x5a, 0x83, 0x3b, - 0x1e, 0x35, 0x06, 0x80, 0x81, 0xda, 0xe7, 0xb3, 0xdd, 0x67, 0x75, 0x56, 0xfd, 0x29, 0x3d, 0xfc, - 0x17, 0x00, 0x00, 0xff, 0xff, 0x6c, 0xba, 0x05, 0x5d, 0x22, 0x07, 0x00, 0x00, +func init() { proto.RegisterFile("model/proto/api_v2/sampling.proto", fileDescriptorSampling) } +func init() { golang_proto.RegisterFile("model/proto/api_v2/sampling.proto", fileDescriptorSampling) } + +var fileDescriptorSampling = []byte{ + // 645 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0x76, 0x5a, 0x21, 0xe1, 0x15, 0x14, 0x46, 0xd4, 0xda, 0x40, 0x53, 0x97, 0x03, 0x15, 0x61, + 0x57, 0x6b, 0xbc, 0x10, 0x43, 0xd2, 0x12, 0x43, 0x96, 0x14, 0x68, 0xb6, 0xf5, 0xa2, 0x07, 0x9c, + 0x6e, 0x9f, 0xc3, 0x98, 0xee, 0xce, 0x66, 0x76, 0x00, 0xb9, 0x9a, 0x78, 0xf5, 0xa0, 0x67, 0x2f, + 0xfe, 0x25, 0x1e, 0x3d, 0x9a, 0x78, 0xf3, 0x64, 0xd0, 0x3f, 0xc4, 0x74, 0xbb, 0x85, 0x76, 0xfb, + 0x83, 0x9b, 0xa7, 0xd9, 0x7d, 0xef, 0x7b, 0xdf, 0xfb, 0xde, 0x9b, 0x37, 0x0f, 0xee, 0x7b, 0xb2, + 0x85, 0x6d, 0x2b, 0x50, 0x52, 0x4b, 0x8b, 0x05, 0xe2, 0xf0, 0xa4, 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5c, 0xcd, 0x39, 0xa8, 0x94, 0x2b, 0x76, 0xd5, + 0xae, 0x37, 0xec, 0xed, 0xf9, 0x6b, 0x1d, 0x93, 0x53, 0x6e, 0x3c, 0x3f, 0xac, 0xda, 0x7b, 0x76, + 0xc3, 0xde, 0xdf, 0x99, 0x27, 0xa5, 0xaf, 0x04, 0x6e, 0xf6, 0xc2, 0xf7, 0x98, 0xcf, 0x38, 0x2a, + 0xfa, 0x91, 0xc0, 0xad, 0x1d, 0xd4, 0x43, 0x0b, 0xe1, 0xc1, 0x15, 0xd7, 0x7f, 0x29, 0x3b, 0xb7, + 0x7a, 0x05, 0xb4, 0x37, 0x68, 0xc6, 0xca, 0xfb, 0x9f, 0x7f, 0x3f, 0xa7, 0x96, 0x8d, 0x6c, 0xb4, + 0x65, 0xfb, 0x16, 0x75, 0x0f, 0xb9, 0x49, 0xd6, 0x2a, 0x27, 0x9f, 0xca, 0x15, 0x3a, 0x55, 0x4a, + 0x3f, 0x36, 0x1f, 0xad, 0xa5, 0x48, 0x4a, 0x3d, 0x05, 0xd8, 0x8d, 0xe8, 0x0b, 0xe5, 0x9a, 0x4d, + 0x57, 0x8f, 0xb4, 0x0e, 0xc2, 0x4d, 0xcb, 0xe2, 0x42, 0x1f, 0x1d, 0x37, 0x4d, 0x57, 0x7a, 0x56, + 0x37, 0xbb, 0x56, 0xcc, 0x15, 0x3e, 0x8f, 0xff, 0xbe, 0x9f, 0xe7, 0xc9, 0x8f, 0xf3, 0x3c, 0xf9, + 0x7d, 0x9e, 0x27, 0xdf, 0xfe, 0xe4, 0x09, 0xdc, 0x15, 0xd2, 0x1c, 0x00, 0xc6, 0x6a, 0x5f, 0x4e, + 0x77, 0xcf, 0xe6, 0x74, 0xb4, 0xbb, 0x9f, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x75, 0x18, + 0xac, 0x51, 0x06, 0x00, 0x00, } diff --git a/proto-gen/api_v2/sampling.pb.gw.go b/proto-gen/api_v2/sampling.pb.gw.go new file mode 100644 index 00000000000..5848d2629cd --- /dev/null +++ b/proto-gen/api_v2/sampling.pb.gw.go @@ -0,0 +1,112 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: model/proto/api_v2/sampling.proto + +/* +Package api_v2 is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package api_v2 + +import ( + "io" + "net/http" + + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "golang.org/x/net/context" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray + +func request_SamplingManager_GetSamplingStrategy_0(ctx context.Context, marshaler runtime.Marshaler, client SamplingManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq SamplingStrategyParameters + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetSamplingStrategy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +// RegisterSamplingManagerHandlerFromEndpoint is same as RegisterSamplingManagerHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterSamplingManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterSamplingManagerHandler(ctx, mux, conn) +} + +// RegisterSamplingManagerHandler registers the http handlers for service SamplingManager to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterSamplingManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + client := NewSamplingManagerClient(conn) + + mux.Handle("POST", pattern_SamplingManager_GetSamplingStrategy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(ctx) + defer cancel() + if cn, ok := w.(http.CloseNotifier); ok { + go func(done <-chan struct{}, closed <-chan bool) { + select { + case <-done: + case <-closed: + cancel() + } + }(ctx.Done(), cn.CloseNotify()) + } + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_SamplingManager_GetSamplingStrategy_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_SamplingManager_GetSamplingStrategy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_SamplingManager_GetSamplingStrategy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "samplingStrategy"}, "")) +) + +var ( + forward_SamplingManager_GetSamplingStrategy_0 = runtime.ForwardResponseMessage +) From 66043f01097b21593a7a8483ce4f305bfa6f19ae Mon Sep 17 00:00:00 2001 From: Annanay Date: Sun, 17 Mar 2019 17:48:41 +0530 Subject: [PATCH 3/8] Commit Makefile changes, run make protoc Signed-off-by: Annanay --- Makefile | 8 +- model/model.pb.go | 701 +++++++++++++++++++------- model/proto/api_v2/collector.proto | 4 +- model/proto/api_v2/sampling.proto | 2 +- model/prototest/model_test.pb.go | 27 +- proto-gen/api_v2/collector.pb.go | 234 +++++---- proto-gen/api_v2/collector.pb.gw.go | 33 +- proto-gen/api_v2/sampling.pb.go | 482 +++++++++++++----- proto-gen/api_v2/sampling.pb.gw.go | 33 +- proto-gen/openapi/api_v2.swagger.json | 2 +- 10 files changed, 1051 insertions(+), 475 deletions(-) diff --git a/Makefile b/Makefile index fe8f99ee49a..6c4f5ed7ee3 100644 --- a/Makefile +++ b/Makefile @@ -380,10 +380,10 @@ proto: $(PROTOC) \ $(PROTO_INCLUDES) \ - --gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/api_v2/ \ - --grpc-gateway_out=$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/api_v2/ \ - --swagger_out=$(PWD)/proto-gen/openapi/ \ - model/proto/api_v2.proto + --gogo_out=plugins=grpc,$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/ \ + --grpc-gateway_out=$(PROTO_GOGO_MAPPINGS):$(PWD)/proto-gen/ \ + --swagger_out=allow_merge=true:$(PWD)/proto-gen/openapi/ \ + model/proto/api_v2/*.proto $(PROTOC) \ -I model/proto \ diff --git a/model/model.pb.go b/model/model.pb.go index a2877bd5feb..31b5cfc32a6 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -1,40 +1,22 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. // source: model.proto -/* - Package model is a generated protocol buffer package. - - It is generated from these files: - model.proto - - It has these top-level messages: - KeyValue - Log - SpanRef - Process - Span - Trace - Batch -*/ package model -import proto "github.com/gogo/protobuf/proto" -import golang_proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" -import _ "github.com/gogo/googleapis/google/api" -import _ "github.com/gogo/protobuf/types" -import _ "github.com/gogo/protobuf/types" - -import time "time" - -import bytes "bytes" - -import binary "encoding/binary" -import types "github.com/gogo/protobuf/types" - -import io "io" +import ( + bytes "bytes" + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/gogo/googleapis/google/api" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + golang_proto "github.com/golang/protobuf/proto" + io "io" + math "math" + time "time" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -66,6 +48,7 @@ var ValueType_name = map[int32]string{ 3: "FLOAT64", 4: "BINARY", } + var ValueType_value = map[string]int32{ "STRING": 0, "BOOL": 1, @@ -77,7 +60,10 @@ var ValueType_value = map[string]int32{ func (x ValueType) String() string { return proto.EnumName(ValueType_name, int32(x)) } -func (ValueType) EnumDescriptor() ([]byte, []int) { return fileDescriptorModel, []int{0} } + +func (ValueType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{0} +} type SpanRefType int32 @@ -90,6 +76,7 @@ var SpanRefType_name = map[int32]string{ 0: "CHILD_OF", 1: "FOLLOWS_FROM", } + var SpanRefType_value = map[string]int32{ "CHILD_OF": 0, "FOLLOWS_FROM": 1, @@ -98,22 +85,56 @@ var SpanRefType_value = map[string]int32{ func (x SpanRefType) String() string { return proto.EnumName(SpanRefType_name, int32(x)) } -func (SpanRefType) EnumDescriptor() ([]byte, []int) { return fileDescriptorModel, []int{1} } + +func (SpanRefType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{1} +} type KeyValue struct { - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - VType ValueType `protobuf:"varint,2,opt,name=v_type,json=vType,proto3,enum=jaeger.api_v2.ValueType" json:"v_type,omitempty"` - VStr string `protobuf:"bytes,3,opt,name=v_str,json=vStr,proto3" json:"v_str,omitempty"` - VBool bool `protobuf:"varint,4,opt,name=v_bool,json=vBool,proto3" json:"v_bool,omitempty"` - VInt64 int64 `protobuf:"varint,5,opt,name=v_int64,json=vInt64,proto3" json:"v_int64,omitempty"` - VFloat64 float64 `protobuf:"fixed64,6,opt,name=v_float64,json=vFloat64,proto3" json:"v_float64,omitempty"` - VBinary []byte `protobuf:"bytes,7,opt,name=v_binary,json=vBinary,proto3" json:"v_binary,omitempty"` + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + VType ValueType `protobuf:"varint,2,opt,name=v_type,json=vType,proto3,enum=jaeger.api_v2.ValueType" json:"v_type,omitempty"` + VStr string `protobuf:"bytes,3,opt,name=v_str,json=vStr,proto3" json:"v_str,omitempty"` + VBool bool `protobuf:"varint,4,opt,name=v_bool,json=vBool,proto3" json:"v_bool,omitempty"` + VInt64 int64 `protobuf:"varint,5,opt,name=v_int64,json=vInt64,proto3" json:"v_int64,omitempty"` + VFloat64 float64 `protobuf:"fixed64,6,opt,name=v_float64,json=vFloat64,proto3" json:"v_float64,omitempty"` + VBinary []byte `protobuf:"bytes,7,opt,name=v_binary,json=vBinary,proto3" json:"v_binary,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *KeyValue) Reset() { *m = KeyValue{} } +func (m *KeyValue) String() string { return proto.CompactTextString(m) } +func (*KeyValue) ProtoMessage() {} +func (*KeyValue) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{0} +} +func (m *KeyValue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *KeyValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_KeyValue.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *KeyValue) XXX_Merge(src proto.Message) { + xxx_messageInfo_KeyValue.Merge(m, src) +} +func (m *KeyValue) XXX_Size() int { + return m.Size() +} +func (m *KeyValue) XXX_DiscardUnknown() { + xxx_messageInfo_KeyValue.DiscardUnknown(m) } -func (m *KeyValue) Reset() { *m = KeyValue{} } -func (m *KeyValue) String() string { return proto.CompactTextString(m) } -func (*KeyValue) ProtoMessage() {} -func (*KeyValue) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{0} } +var xxx_messageInfo_KeyValue proto.InternalMessageInfo func (m *KeyValue) GetKey() string { if m != nil { @@ -165,14 +186,45 @@ func (m *KeyValue) GetVBinary() []byte { } type Log struct { - Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,stdtime" json:"timestamp"` - Fields []KeyValue `protobuf:"bytes,2,rep,name=fields" json:"fields"` + Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` + Fields []KeyValue `protobuf:"bytes,2,rep,name=fields,proto3" json:"fields"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Log) Reset() { *m = Log{} } +func (m *Log) String() string { return proto.CompactTextString(m) } +func (*Log) ProtoMessage() {} +func (*Log) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{1} +} +func (m *Log) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Log) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Log.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Log) XXX_Merge(src proto.Message) { + xxx_messageInfo_Log.Merge(m, src) +} +func (m *Log) XXX_Size() int { + return m.Size() +} +func (m *Log) XXX_DiscardUnknown() { + xxx_messageInfo_Log.DiscardUnknown(m) } -func (m *Log) Reset() { *m = Log{} } -func (m *Log) String() string { return proto.CompactTextString(m) } -func (*Log) ProtoMessage() {} -func (*Log) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{1} } +var xxx_messageInfo_Log proto.InternalMessageInfo func (m *Log) GetTimestamp() time.Time { if m != nil { @@ -189,15 +241,46 @@ func (m *Log) GetFields() []KeyValue { } type SpanRef struct { - TraceID TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=TraceID" json:"trace_id"` - SpanID SpanID `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3,customtype=SpanID" json:"span_id"` - RefType SpanRefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=jaeger.api_v2.SpanRefType" json:"ref_type,omitempty"` + TraceID TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=TraceID" json:"trace_id"` + SpanID SpanID `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3,customtype=SpanID" json:"span_id"` + RefType SpanRefType `protobuf:"varint,3,opt,name=ref_type,json=refType,proto3,enum=jaeger.api_v2.SpanRefType" json:"ref_type,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SpanRef) Reset() { *m = SpanRef{} } +func (m *SpanRef) String() string { return proto.CompactTextString(m) } +func (*SpanRef) ProtoMessage() {} +func (*SpanRef) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{2} +} +func (m *SpanRef) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SpanRef) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpanRef.Merge(m, src) +} +func (m *SpanRef) XXX_Size() int { + return m.Size() +} +func (m *SpanRef) XXX_DiscardUnknown() { + xxx_messageInfo_SpanRef.DiscardUnknown(m) } -func (m *SpanRef) Reset() { *m = SpanRef{} } -func (m *SpanRef) String() string { return proto.CompactTextString(m) } -func (*SpanRef) ProtoMessage() {} -func (*SpanRef) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{2} } +var xxx_messageInfo_SpanRef proto.InternalMessageInfo func (m *SpanRef) GetRefType() SpanRefType { if m != nil { @@ -207,14 +290,45 @@ func (m *SpanRef) GetRefType() SpanRefType { } type Process struct { - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - Tags []KeyValue `protobuf:"bytes,2,rep,name=tags" json:"tags"` + ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` + Tags []KeyValue `protobuf:"bytes,2,rep,name=tags,proto3" json:"tags"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Process) Reset() { *m = Process{} } +func (m *Process) String() string { return proto.CompactTextString(m) } +func (*Process) ProtoMessage() {} +func (*Process) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{3} +} +func (m *Process) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Process) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Process.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Process) XXX_Merge(src proto.Message) { + xxx_messageInfo_Process.Merge(m, src) +} +func (m *Process) XXX_Size() int { + return m.Size() +} +func (m *Process) XXX_DiscardUnknown() { + xxx_messageInfo_Process.DiscardUnknown(m) } -func (m *Process) Reset() { *m = Process{} } -func (m *Process) String() string { return proto.CompactTextString(m) } -func (*Process) ProtoMessage() {} -func (*Process) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{3} } +var xxx_messageInfo_Process proto.InternalMessageInfo func (m *Process) GetServiceName() string { if m != nil { @@ -231,24 +345,55 @@ func (m *Process) GetTags() []KeyValue { } type Span struct { - TraceID TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=TraceID" json:"trace_id"` - SpanID SpanID `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3,customtype=SpanID" json:"span_id"` - OperationName string `protobuf:"bytes,3,opt,name=operation_name,json=operationName,proto3" json:"operation_name,omitempty"` - References []SpanRef `protobuf:"bytes,4,rep,name=references" json:"references"` - Flags Flags `protobuf:"varint,5,opt,name=flags,proto3,customtype=Flags" json:"flags"` - StartTime time.Time `protobuf:"bytes,6,opt,name=start_time,json=startTime,stdtime" json:"start_time"` - Duration time.Duration `protobuf:"bytes,7,opt,name=duration,stdduration" json:"duration"` - Tags []KeyValue `protobuf:"bytes,8,rep,name=tags" json:"tags"` - Logs []Log `protobuf:"bytes,9,rep,name=logs" json:"logs"` - Process *Process `protobuf:"bytes,10,opt,name=process" json:"process,omitempty"` - ProcessID string `protobuf:"bytes,11,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` - Warnings []string `protobuf:"bytes,12,rep,name=warnings" json:"warnings,omitempty"` -} - -func (m *Span) Reset() { *m = Span{} } -func (m *Span) String() string { return proto.CompactTextString(m) } -func (*Span) ProtoMessage() {} -func (*Span) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{4} } + TraceID TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=TraceID" json:"trace_id"` + SpanID SpanID `protobuf:"bytes,2,opt,name=span_id,json=spanId,proto3,customtype=SpanID" json:"span_id"` + OperationName string `protobuf:"bytes,3,opt,name=operation_name,json=operationName,proto3" json:"operation_name,omitempty"` + References []SpanRef `protobuf:"bytes,4,rep,name=references,proto3" json:"references"` + Flags Flags `protobuf:"varint,5,opt,name=flags,proto3,customtype=Flags" json:"flags"` + StartTime time.Time `protobuf:"bytes,6,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + Duration time.Duration `protobuf:"bytes,7,opt,name=duration,proto3,stdduration" json:"duration"` + Tags []KeyValue `protobuf:"bytes,8,rep,name=tags,proto3" json:"tags"` + Logs []Log `protobuf:"bytes,9,rep,name=logs,proto3" json:"logs"` + Process *Process `protobuf:"bytes,10,opt,name=process,proto3" json:"process,omitempty"` + ProcessID string `protobuf:"bytes,11,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` + Warnings []string `protobuf:"bytes,12,rep,name=warnings,proto3" json:"warnings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Span) Reset() { *m = Span{} } +func (m *Span) String() string { return proto.CompactTextString(m) } +func (*Span) ProtoMessage() {} +func (*Span) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{4} +} +func (m *Span) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Span) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Span.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Span) XXX_Merge(src proto.Message) { + xxx_messageInfo_Span.Merge(m, src) +} +func (m *Span) XXX_Size() int { + return m.Size() +} +func (m *Span) XXX_DiscardUnknown() { + xxx_messageInfo_Span.DiscardUnknown(m) +} + +var xxx_messageInfo_Span proto.InternalMessageInfo func (m *Span) GetOperationName() string { if m != nil { @@ -314,15 +459,46 @@ func (m *Span) GetWarnings() []string { } type Trace struct { - Spans []*Span `protobuf:"bytes,1,rep,name=spans" json:"spans,omitempty"` - ProcessMap []Trace_ProcessMapping `protobuf:"bytes,2,rep,name=process_map,json=processMap" json:"process_map"` - Warnings []string `protobuf:"bytes,3,rep,name=warnings" json:"warnings,omitempty"` + Spans []*Span `protobuf:"bytes,1,rep,name=spans,proto3" json:"spans,omitempty"` + ProcessMap []Trace_ProcessMapping `protobuf:"bytes,2,rep,name=process_map,json=processMap,proto3" json:"process_map"` + Warnings []string `protobuf:"bytes,3,rep,name=warnings,proto3" json:"warnings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Trace) Reset() { *m = Trace{} } +func (m *Trace) String() string { return proto.CompactTextString(m) } +func (*Trace) ProtoMessage() {} +func (*Trace) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{5} +} +func (m *Trace) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Trace) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Trace.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Trace) XXX_Merge(src proto.Message) { + xxx_messageInfo_Trace.Merge(m, src) +} +func (m *Trace) XXX_Size() int { + return m.Size() +} +func (m *Trace) XXX_DiscardUnknown() { + xxx_messageInfo_Trace.DiscardUnknown(m) } -func (m *Trace) Reset() { *m = Trace{} } -func (m *Trace) String() string { return proto.CompactTextString(m) } -func (*Trace) ProtoMessage() {} -func (*Trace) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{5} } +var xxx_messageInfo_Trace proto.InternalMessageInfo func (m *Trace) GetSpans() []*Span { if m != nil { @@ -346,14 +522,45 @@ func (m *Trace) GetWarnings() []string { } type Trace_ProcessMapping struct { - ProcessID string `protobuf:"bytes,1,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` - Process Process `protobuf:"bytes,2,opt,name=process" json:"process"` + ProcessID string `protobuf:"bytes,1,opt,name=process_id,json=processId,proto3" json:"process_id,omitempty"` + Process Process `protobuf:"bytes,2,opt,name=process,proto3" json:"process"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Trace_ProcessMapping) Reset() { *m = Trace_ProcessMapping{} } +func (m *Trace_ProcessMapping) String() string { return proto.CompactTextString(m) } +func (*Trace_ProcessMapping) ProtoMessage() {} +func (*Trace_ProcessMapping) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{5, 0} +} +func (m *Trace_ProcessMapping) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Trace_ProcessMapping) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Trace_ProcessMapping.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Trace_ProcessMapping) XXX_Merge(src proto.Message) { + xxx_messageInfo_Trace_ProcessMapping.Merge(m, src) +} +func (m *Trace_ProcessMapping) XXX_Size() int { + return m.Size() +} +func (m *Trace_ProcessMapping) XXX_DiscardUnknown() { + xxx_messageInfo_Trace_ProcessMapping.DiscardUnknown(m) } -func (m *Trace_ProcessMapping) Reset() { *m = Trace_ProcessMapping{} } -func (m *Trace_ProcessMapping) String() string { return proto.CompactTextString(m) } -func (*Trace_ProcessMapping) ProtoMessage() {} -func (*Trace_ProcessMapping) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{5, 0} } +var xxx_messageInfo_Trace_ProcessMapping proto.InternalMessageInfo func (m *Trace_ProcessMapping) GetProcessID() string { if m != nil { @@ -370,14 +577,45 @@ func (m *Trace_ProcessMapping) GetProcess() Process { } type Batch struct { - Spans []*Span `protobuf:"bytes,1,rep,name=spans" json:"spans,omitempty"` - Process *Process `protobuf:"bytes,2,opt,name=process" json:"process,omitempty"` + Spans []*Span `protobuf:"bytes,1,rep,name=spans,proto3" json:"spans,omitempty"` + Process *Process `protobuf:"bytes,2,opt,name=process,proto3" json:"process,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Batch) Reset() { *m = Batch{} } +func (m *Batch) String() string { return proto.CompactTextString(m) } +func (*Batch) ProtoMessage() {} +func (*Batch) Descriptor() ([]byte, []int) { + return fileDescriptor_4c16552f9fdb66d8, []int{6} +} +func (m *Batch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Batch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Batch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Batch) XXX_Merge(src proto.Message) { + xxx_messageInfo_Batch.Merge(m, src) +} +func (m *Batch) XXX_Size() int { + return m.Size() +} +func (m *Batch) XXX_DiscardUnknown() { + xxx_messageInfo_Batch.DiscardUnknown(m) } -func (m *Batch) Reset() { *m = Batch{} } -func (m *Batch) String() string { return proto.CompactTextString(m) } -func (*Batch) ProtoMessage() {} -func (*Batch) Descriptor() ([]byte, []int) { return fileDescriptorModel, []int{6} } +var xxx_messageInfo_Batch proto.InternalMessageInfo func (m *Batch) GetSpans() []*Span { if m != nil { @@ -394,6 +632,10 @@ func (m *Batch) GetProcess() *Process { } func init() { + proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) + golang_proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) + proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) + golang_proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) proto.RegisterType((*KeyValue)(nil), "jaeger.api_v2.KeyValue") golang_proto.RegisterType((*KeyValue)(nil), "jaeger.api_v2.KeyValue") proto.RegisterType((*Log)(nil), "jaeger.api_v2.Log") @@ -410,11 +652,72 @@ func init() { golang_proto.RegisterType((*Trace_ProcessMapping)(nil), "jaeger.api_v2.Trace.ProcessMapping") proto.RegisterType((*Batch)(nil), "jaeger.api_v2.Batch") golang_proto.RegisterType((*Batch)(nil), "jaeger.api_v2.Batch") - proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) - golang_proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) - proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) - golang_proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) } + +func init() { proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) } +func init() { golang_proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) } + +var fileDescriptor_4c16552f9fdb66d8 = []byte{ + // 905 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xde, 0x49, 0xec, 0xd8, 0x79, 0x49, 0x56, 0xd1, 0x14, 0x58, 0x37, 0xa0, 0x24, 0xa4, 0x42, + 0x0a, 0x55, 0x49, 0xda, 0xd0, 0xee, 0x01, 0x21, 0xa1, 0xba, 0x4b, 0xc0, 0x90, 0xdd, 0xa0, 0xd9, + 0x08, 0x04, 0x17, 0x6b, 0x36, 0x99, 0x18, 0x17, 0xc7, 0x63, 0xd9, 0x5e, 0xa3, 0xdc, 0xf8, 0x09, + 0x88, 0x13, 0x47, 0xb8, 0xf2, 0x2b, 0x38, 0xf6, 0xc8, 0x81, 0x13, 0x12, 0x0b, 0x0a, 0x97, 0xfe, + 0x0c, 0x34, 0xe3, 0x71, 0xb6, 0x1b, 0x2a, 0xd8, 0x5e, 0x38, 0x79, 0x66, 0xde, 0xf7, 0xde, 0x7c, + 0xef, 0x7b, 0x9f, 0x6d, 0xa8, 0xad, 0xf8, 0x82, 0x05, 0x83, 0x28, 0xe6, 0x29, 0xc7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09, 0x66, 0xe6, 0x9e, 0xf9, 0x21, 0x8d, 0xd7, 0x96, 0xd1, 0x45, 0xfd, + 0x3a, 0x31, 0x32, 0x5b, 0x6e, 0xdf, 0x31, 0x9f, 0xfe, 0xd0, 0x41, 0x4f, 0x7f, 0xec, 0xa0, 0xde, + 0x37, 0x08, 0xca, 0x13, 0xee, 0x61, 0x1b, 0xaa, 0x5b, 0x45, 0x64, 0x5f, 0xb5, 0x51, 0x6b, 0x90, + 0x4b, 0x32, 0x28, 0x24, 0x19, 0xcc, 0x0a, 0x84, 0x6d, 0x3e, 0xb9, 0xe8, 0xec, 0x7d, 0xfb, 0x47, + 0x07, 0x91, 0xcb, 0x34, 0xfc, 0x00, 0x2a, 0x4b, 0x9f, 0x05, 0x8b, 0xc4, 0x2a, 0x75, 0xcb, 0xfd, + 0xda, 0xe8, 0x60, 0x47, 0x83, 0x42, 0x3e, 0x5b, 0x13, 0xd9, 0x44, 0x81, 0x7b, 0x3f, 0x21, 0x30, + 0x4e, 0x23, 0x1a, 0x12, 0xb6, 0xc4, 0x0f, 0xc0, 0x4c, 0x63, 0x3a, 0x67, 0xae, 0xbf, 0x90, 0x2c, + 0xea, 0x76, 0x4b, 0x60, 0x7f, 0xbb, 0xe8, 0x18, 0x33, 0x71, 0xee, 0x1c, 0x6d, 0x2e, 0x97, 0xc4, + 0x90, 0x58, 0x67, 0x81, 0xef, 0x81, 0x91, 0x44, 0x34, 0x14, 0x59, 0x25, 0x99, 0x65, 0xa9, 0xac, + 0x8a, 0x28, 0x2c, 0x93, 0xd4, 0x8a, 0x54, 0x04, 0xd0, 0x59, 0x88, 0x9b, 0x62, 0xb6, 0xcc, 0x47, + 0x56, 0x96, 0x23, 0x6b, 0xed, 0xd0, 0x55, 0x9c, 0xe4, 0xd0, 0x8c, 0x38, 0x5f, 0xf4, 0x5c, 0x30, + 0x3e, 0x89, 0xf9, 0x9c, 0x25, 0x09, 0x7e, 0x1d, 0xea, 0x09, 0x8b, 0x33, 0x7f,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xa8, 0x8f, 0xa7, 0x93, 0xc9, 0xf4, 0xb3, 0x53, + 0x77, 0x4c, 0xa6, 0xc7, 0x4d, 0x64, 0xdf, 0x7d, 0xb2, 0x69, 0xa3, 0x5f, 0x36, 0x6d, 0xf4, 0xe7, + 0xa6, 0x8d, 0x7e, 0xfe, 0xab, 0x8d, 0xe0, 0xc0, 0xe7, 0x8a, 0xb0, 0xf8, 0x74, 0xf8, 0xa1, 0xa7, + 0x78, 0x7f, 0xa1, 0xcb, 0x5f, 0xef, 0x59, 0x45, 0xbe, 0x2c, 0x6f, 0xff, 0x1d, 0x00, 0x00, 0xff, + 0xff, 0xc9, 0x46, 0x02, 0x11, 0x8a, 0x07, 0x00, 0x00, +} + func (this *KeyValue) Compare(that interface{}) int { if that == nil { if this == nil { @@ -479,14 +782,14 @@ func (this *KeyValue) Compare(that interface{}) int { if c := bytes.Compare(this.VBinary, that1.VBinary); c != 0 { return c } + if c := bytes.Compare(this.XXX_unrecognized, that1.XXX_unrecognized); c != 0 { + return c + } return 0 } func (this *KeyValue) Equal(that interface{}) bool { if that == nil { - if this == nil { - return true - } - return false + return this == nil } that1, ok := that.(*KeyValue) @@ -499,10 +802,7 @@ func (this *KeyValue) Equal(that interface{}) bool { } } if that1 == nil { - if this == nil { - return true - } - return false + return this == nil } else if this == nil { return false } @@ -527,6 +827,9 @@ func (this *KeyValue) Equal(that interface{}) bool { if !bytes.Equal(this.VBinary, that1.VBinary) { return false } + if !bytes.Equal(this.XXX_unrecognized, that1.XXX_unrecognized) { + return false + } return true } func (m *KeyValue) Marshal() (dAtA []byte, err error) { @@ -579,7 +882,7 @@ func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { if m.VFloat64 != 0 { dAtA[i] = 0x31 i++ - binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) i += 8 } if len(m.VBinary) > 0 { @@ -588,6 +891,9 @@ func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintModel(dAtA, i, uint64(len(m.VBinary))) i += copy(dAtA[i:], m.VBinary) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -608,8 +914,8 @@ func (m *Log) MarshalTo(dAtA []byte) (int, error) { _ = l dAtA[i] = 0xa i++ - i = encodeVarintModel(dAtA, i, uint64(types.SizeOfStdTime(m.Timestamp))) - n1, err := types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) + i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) + n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) if err != nil { return 0, err } @@ -626,6 +932,9 @@ func (m *Log) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -665,6 +974,9 @@ func (m *SpanRef) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintModel(dAtA, i, uint64(m.RefType)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -701,6 +1013,9 @@ func (m *Process) MarshalTo(dAtA []byte) (int, error) { i += n } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -760,16 +1075,16 @@ func (m *Span) MarshalTo(dAtA []byte) (int, error) { } dAtA[i] = 0x32 i++ - i = encodeVarintModel(dAtA, i, uint64(types.SizeOfStdTime(m.StartTime))) - n6, err := types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) + i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime))) + n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i:]) if err != nil { return 0, err } i += n6 dAtA[i] = 0x3a i++ - i = encodeVarintModel(dAtA, i, uint64(types.SizeOfStdDuration(m.Duration))) - n7, err := types.StdDurationMarshalTo(m.Duration, dAtA[i:]) + i = encodeVarintModel(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration))) + n7, err := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i:]) if err != nil { return 0, err } @@ -829,6 +1144,9 @@ func (m *Span) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -886,6 +1204,9 @@ func (m *Trace) MarshalTo(dAtA []byte) (int, error) { i += copy(dAtA[i:], s) } } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -918,6 +1239,9 @@ func (m *Trace_ProcessMapping) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n9 + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -958,6 +1282,9 @@ func (m *Batch) MarshalTo(dAtA []byte) (int, error) { } i += n10 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -971,6 +1298,9 @@ func encodeVarintModel(dAtA []byte, offset int, v uint64) int { return offset + 1 } func (m *KeyValue) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Key) @@ -997,13 +1327,19 @@ func (m *KeyValue) Size() (n int) { if l > 0 { n += 1 + l + sovModel(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Log) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l - l = types.SizeOfStdTime(m.Timestamp) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) n += 1 + l + sovModel(uint64(l)) if len(m.Fields) > 0 { for _, e := range m.Fields { @@ -1011,10 +1347,16 @@ func (m *Log) Size() (n int) { n += 1 + l + sovModel(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *SpanRef) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = m.TraceID.Size() @@ -1024,10 +1366,16 @@ func (m *SpanRef) Size() (n int) { if m.RefType != 0 { n += 1 + sovModel(uint64(m.RefType)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Process) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ServiceName) @@ -1040,10 +1388,16 @@ func (m *Process) Size() (n int) { n += 1 + l + sovModel(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Span) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = m.TraceID.Size() @@ -1063,9 +1417,9 @@ func (m *Span) Size() (n int) { if m.Flags != 0 { n += 1 + sovModel(uint64(m.Flags)) } - l = types.SizeOfStdTime(m.StartTime) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) n += 1 + l + sovModel(uint64(l)) - l = types.SizeOfStdDuration(m.Duration) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration) n += 1 + l + sovModel(uint64(l)) if len(m.Tags) > 0 { for _, e := range m.Tags { @@ -1093,10 +1447,16 @@ func (m *Span) Size() (n int) { n += 1 + l + sovModel(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Trace) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Spans) > 0 { @@ -1117,10 +1477,16 @@ func (m *Trace) Size() (n int) { n += 1 + l + sovModel(uint64(l)) } } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Trace_ProcessMapping) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ProcessID) @@ -1129,10 +1495,16 @@ func (m *Trace_ProcessMapping) Size() (n int) { } l = m.Process.Size() n += 1 + l + sovModel(uint64(l)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *Batch) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if len(m.Spans) > 0 { @@ -1145,6 +1517,9 @@ func (m *Batch) Size() (n int) { l = m.Process.Size() n += 1 + l + sovModel(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -1314,7 +1689,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(binary.LittleEndian.Uint64(dAtA[iNdEx:])) + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.VFloat64 = float64(math.Float64frombits(v)) case 7: @@ -1360,6 +1735,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1424,7 +1800,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1471,6 +1847,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1600,6 +1977,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1710,6 +2088,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1913,7 +2292,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1943,7 +2322,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2112,6 +2491,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2253,6 +2633,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2362,6 +2743,7 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2476,6 +2858,7 @@ func (m *Batch) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -2589,67 +2972,3 @@ var ( ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("model.proto", fileDescriptorModel) } -func init() { golang_proto.RegisterFile("model.proto", fileDescriptorModel) } - -var fileDescriptorModel = []byte{ - // 905 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x8f, 0xdb, 0x44, - 0x14, 0xde, 0x49, 0xec, 0xd8, 0x79, 0x49, 0x56, 0xd1, 0x14, 0x58, 0x37, 0xa0, 0x24, 0xa4, 0x42, - 0x0a, 0x55, 0x49, 0xda, 0xd0, 0xee, 0x01, 0x21, 0xa1, 0xba, 0x4b, 0xc0, 0x90, 0xdd, 0xa0, 0xd9, - 0x08, 0x04, 0x17, 0x6b, 0x36, 0x99, 0x18, 0x17, 0xc7, 0x63, 0xd9, 0x5e, 0xa3, 0xdc, 0xf8, 0x09, - 0x88, 0x13, 0x47, 0xb8, 0xf2, 0x2b, 0x38, 0xf6, 0xc8, 0x81, 0x13, 0x12, 0x0b, 0x0a, 0x97, 0xfe, - 0x0c, 0x34, 0xe3, 0x71, 0xb6, 0x1b, 0x2a, 0xd8, 0x5e, 0x38, 0x79, 0x66, 0xde, 0xf7, 0xde, 0x7c, - 0xef, 0x7b, 0x9f, 0x6d, 0xa8, 0xad, 0xf8, 0x82, 0x05, 0x83, 0x28, 0xe6, 0x29, 0xc7, 0x8d, 0xc7, - 0x94, 0x79, 0x2c, 0x1e, 0xd0, 0xc8, 0x77, 0xb3, 0x51, 0xeb, 0x25, 0x8f, 0x7b, 0x5c, 0x46, 0x86, - 0x62, 0x95, 0x83, 0x5a, 0xaf, 0x79, 0x9c, 0x7b, 0x01, 0x1b, 0xd2, 0xc8, 0x1f, 0xd2, 0x30, 0xe4, - 0x29, 0x4d, 0x7d, 0x1e, 0x26, 0x2a, 0xda, 0x51,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0x7f, 0xa1, 0xcb, 0x5f, 0xef, 0x59, 0x45, 0xbe, 0x2c, 0x6f, 0xff, 0x1d, 0x00, 0x00, 0xff, - 0xff, 0xc9, 0x46, 0x02, 0x11, 0x8a, 0x07, 0x00, 0x00, -} diff --git a/model/proto/api_v2/collector.proto b/model/proto/api_v2/collector.proto index c6c4c17ee79..e897a043cd6 100644 --- a/model/proto/api_v2/collector.proto +++ b/model/proto/api_v2/collector.proto @@ -1,5 +1,5 @@ -// Copyright (c) 2018 Uber Technologies, Inc. // Copyright (c) 2019 The Jaeger Authors. +// Copyright (c) 2018 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ syntax="proto3"; package jaeger.api_v2; -import "model/proto/model.proto"; +import "model.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "protoc-gen-swagger/options/annotations.proto"; diff --git a/model/proto/api_v2/sampling.proto b/model/proto/api_v2/sampling.proto index 4fe6a40a6b6..918699d662f 100644 --- a/model/proto/api_v2/sampling.proto +++ b/model/proto/api_v2/sampling.proto @@ -1,5 +1,5 @@ -// Copyright (c) 2018 Uber Technologies, Inc. // Copyright (c) 2019 The Jaeger Authors. +// Copyright (c) 2018 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/model/prototest/model_test.pb.go b/model/prototest/model_test.pb.go index a4c7ea3b120..875c6f03cf2 100644 --- a/model/prototest/model_test.pb.go +++ b/model/prototest/model_test.pb.go @@ -3,9 +3,11 @@ package prototest -import proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -16,7 +18,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package type SpanRefType int32 @@ -29,6 +31,7 @@ var SpanRefType_name = map[int32]string{ 0: "CHILD_OF", 1: "FOLLOWS_FROM", } + var SpanRefType_value = map[string]int32{ "CHILD_OF": 0, "FOLLOWS_FROM": 1, @@ -37,8 +40,9 @@ var SpanRefType_value = map[string]int32{ func (x SpanRefType) String() string { return proto.EnumName(SpanRefType_name, int32(x)) } + func (SpanRefType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_model_test_74918b92027939ce, []int{0} + return fileDescriptor_7d019f60590a05da, []int{0} } type SpanRef struct { @@ -54,16 +58,17 @@ func (m *SpanRef) Reset() { *m = SpanRef{} } func (m *SpanRef) String() string { return proto.CompactTextString(m) } func (*SpanRef) ProtoMessage() {} func (*SpanRef) Descriptor() ([]byte, []int) { - return fileDescriptor_model_test_74918b92027939ce, []int{0} + return fileDescriptor_7d019f60590a05da, []int{0} } + func (m *SpanRef) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SpanRef.Unmarshal(m, b) } func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) } -func (dst *SpanRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanRef.Merge(dst, src) +func (m *SpanRef) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpanRef.Merge(m, src) } func (m *SpanRef) XXX_Size() int { return xxx_messageInfo_SpanRef.Size(m) @@ -96,13 +101,13 @@ func (m *SpanRef) GetRefType() SpanRefType { } func init() { - proto.RegisterType((*SpanRef)(nil), "prototest.SpanRef") proto.RegisterEnum("prototest.SpanRefType", SpanRefType_name, SpanRefType_value) + proto.RegisterType((*SpanRef)(nil), "prototest.SpanRef") } -func init() { proto.RegisterFile("model_test.proto", fileDescriptor_model_test_74918b92027939ce) } +func init() { proto.RegisterFile("model_test.proto", fileDescriptor_7d019f60590a05da) } -var fileDescriptor_model_test_74918b92027939ce = []byte{ +var fileDescriptor_7d019f60590a05da = []byte{ // 178 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcd, 0x4f, 0x49, 0xcd, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x04, 0x53, diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index 7f6ef1bc881..6ef1708bd2d 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -1,41 +1,22 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: model/proto/api_v2/collector.proto - -/* - Package api_v2 is a generated protocol buffer package. - - It is generated from these files: - model/proto/api_v2/collector.proto - model/proto/api_v2/sampling.proto - - It has these top-level messages: - PostSpansRequest - PostSpansResponse - ProbabilisticSamplingStrategy - RateLimitingSamplingStrategy - OperationSamplingStrategy - PerOperationSamplingStrategies - SamplingStrategyResponse - SamplingStrategyParameters -*/ -package api_v2 +// source: api_v2/collector.proto -import proto "github.com/gogo/protobuf/proto" -import golang_proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import jaeger_api_v2 "github.com/jaegertracing/jaeger/model/proto" -import _ "github.com/gogo/protobuf/gogoproto" -import _ "github.com/gogo/googleapis/google/api" -import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" +package api_v2 import ( - context "golang.org/x/net/context" + context "context" + fmt "fmt" + _ "github.com/gogo/googleapis/google/api" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + golang_proto "github.com/golang/protobuf/proto" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" + model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = golang_proto.Marshal @@ -49,28 +30,90 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package type PostSpansRequest struct { - Batch jaeger_api_v2.Batch `protobuf:"bytes,1,opt,name=batch" json:"batch"` + Batch model.Batch `protobuf:"bytes,1,opt,name=batch,proto3" json:"batch"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PostSpansRequest) Reset() { *m = PostSpansRequest{} } +func (m *PostSpansRequest) String() string { return proto.CompactTextString(m) } +func (*PostSpansRequest) ProtoMessage() {} +func (*PostSpansRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_495529cb13d121cf, []int{0} +} +func (m *PostSpansRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PostSpansRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PostSpansRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PostSpansRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_PostSpansRequest.Merge(m, src) +} +func (m *PostSpansRequest) XXX_Size() int { + return m.Size() +} +func (m *PostSpansRequest) XXX_DiscardUnknown() { + xxx_messageInfo_PostSpansRequest.DiscardUnknown(m) } -func (m *PostSpansRequest) Reset() { *m = PostSpansRequest{} } -func (m *PostSpansRequest) String() string { return proto.CompactTextString(m) } -func (*PostSpansRequest) ProtoMessage() {} -func (*PostSpansRequest) Descriptor() ([]byte, []int) { return fileDescriptorCollector, []int{0} } +var xxx_messageInfo_PostSpansRequest proto.InternalMessageInfo -func (m *PostSpansRequest) GetBatch() jaeger_api_v2.Batch { +func (m *PostSpansRequest) GetBatch() model.Batch { if m != nil { return m.Batch } - return jaeger_api_v2.Batch{} + return model.Batch{} } type PostSpansResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PostSpansResponse) Reset() { *m = PostSpansResponse{} } +func (m *PostSpansResponse) String() string { return proto.CompactTextString(m) } +func (*PostSpansResponse) ProtoMessage() {} +func (*PostSpansResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_495529cb13d121cf, []int{1} +} +func (m *PostSpansResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PostSpansResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PostSpansResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PostSpansResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_PostSpansResponse.Merge(m, src) +} +func (m *PostSpansResponse) XXX_Size() int { + return m.Size() +} +func (m *PostSpansResponse) XXX_DiscardUnknown() { + xxx_messageInfo_PostSpansResponse.DiscardUnknown(m) } -func (m *PostSpansResponse) Reset() { *m = PostSpansResponse{} } -func (m *PostSpansResponse) String() string { return proto.CompactTextString(m) } -func (*PostSpansResponse) ProtoMessage() {} -func (*PostSpansResponse) Descriptor() ([]byte, []int) { return fileDescriptorCollector, []int{1} } +var xxx_messageInfo_PostSpansResponse proto.InternalMessageInfo func init() { proto.RegisterType((*PostSpansRequest)(nil), "jaeger.api_v2.PostSpansRequest") @@ -79,6 +122,34 @@ func init() { golang_proto.RegisterType((*PostSpansResponse)(nil), "jaeger.api_v2.PostSpansResponse") } +func init() { proto.RegisterFile("api_v2/collector.proto", fileDescriptor_495529cb13d121cf) } +func init() { golang_proto.RegisterFile("api_v2/collector.proto", fileDescriptor_495529cb13d121cf) } + +var fileDescriptor_495529cb13d121cf = []byte{ + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x31, 0x4f, 0xc2, 0x40, + 0x14, 0xc7, 0x3d, 0x14, 0x12, 0x8f, 0x90, 0x60, 0x25, 0x4a, 0x88, 0x29, 0xa4, 0x8b, 0x86, 0x48, + 0x0f, 0x6b, 0x5c, 0xd8, 0xa8, 0x2e, 0x3a, 0x11, 0xd8, 0x5c, 0xcc, 0x51, 0x2f, 0xd7, 0x9a, 0x72, + 0xef, 0xbc, 0x3b, 0xea, 0xe2, 0xe4, 0x47, 0xd0, 0x2f, 0xe4, 0xc8, 0x68, 0xe2, 0x6e, 0x0c, 0xfa, + 0x41, 0x0c, 0x6d, 0x35, 0x82, 0x71, 0x7a, 0xef, 0xee, 0xff, 0xcb, 0xff, 0xfd, 0xdf, 0xc3, 0x3b, + 0x54, 0x46, 0x57, 0x89, 0x47, 0x02, 0x88, 0x63, 0x16, 0x18, 0x50, 0xae, 0x54, 0x60, 0xc0, 0xaa, + 0xdc, 0x50, 0xc6, 0x99, 0x72, 0x33, 0xb9, 0x51, 0x9e, 0xc0, 0x35, 0x8b, 0x33, 0xad, 0x51, 0xe3, + 0xc0, 0x21, 0x6d, 0xc9, 0xa2, 0xcb, 0x7f, 0xf7, 0x38, 0x00, 0x8f, 0x19, 0xa1, 0x32, 0x22, 0x54, + 0x08, 0x30, 0xd4, 0x44, 0x20, 0x74, 0xae, 0x1e, 0xa6, 0x25, 0xe8, 0x70, 0x26, 0x3a, 0xfa, 0x8e, + 0x72, 0xce, 0x14, 0x01, 0x99, 0x12, 0x7f, 0x69, 0xe7, 0x0c, 0x57, 0x07, 0xa0, 0xcd, 0x48, 0x52, + 0xa1, 0x87, 0xec, 0x76, 0xca, 0xb4, 0xb1, 0xba, 0xb8, 0x38, 0xa6, 0x26, 0x08, 0xeb, 0xa8, 0x85, + 0x0e, 0xca, 0x5e, 0xcd, 0x5d, 0x4a, 0xe8, 0xfa, 0x0b, 0xcd, 0xdf, 0x98, 0xbd, 0x35, 0xd7, 0x86, + 0x19, 0xe8, 0x6c, 0xe3, 0xad, 0x5f, 0x2e, 0x5a, 0x82, 0xd0, 0xcc, 0xbb, 0xc7, 0xd5, 0xd3, 0xef, + 0x5d, 0x47, 0x4c, 0x25, 0x51, 0xc0, 0xac, 0x10, 0x6f, 0xfe, 0x80, 0x56, 0x73, 0xc5, 0x78, 0x35, + 0x48, 0xa3, 0xf5, 0x3f, 0x90, 0xcd, 0x70, 0xea, 0x0f, 0xaf, 0x9f, 0x4f, 0x05, 0xcb, 0xa9, 0xa4, + 0xc7, 0x48, 0x3c, 0xa2, 0x17, 0x72, 0x0f, 0xb5, 0xfd, 0xe4, 0xb1, 0xef, 0x5b, 0x45, 0x6f, 0xfd, + 0xc8, 0xed, 0xb6, 0x0b, 0xa8, 0xa0, 0x4e, 0x30, 0xbe, 0x48, 0xcd, 0x5a, 0xfd, 0xc1, 0xb9, 0xb5, + 0x1f, 0x1a, 0x23, 0x75, 0x8f, 0x10, 0x1e, 0x99, 0x70, 0x3a, 0x76, 0x03, 0x98, 0x90, 0x6c, 0x96, + 0x51, 0x34, 0x88, 0x04, 0xcf, 0x5f, 0xb3, 0xb9, 0x8d, 0x5e, 0xe6, 0x36, 0x7a, 0x9f, 0xdb, 0xe8, + 0xf9, 0xc3, 0x46, 0x78, 0x37, 0x02, 0x77, 0x09, 0xcc, 0xb3, 0x5d, 0x96, 0xb2, 0x3a, 0x2e, 0xa5, + 0x77, 0x3d, 0xfe, 0x0a, 0x00, 0x00, 0xff, 0xff, 0x5b, 0xe8, 0xa6, 0x4c, 0xef, 0x01, 0x00, 0x00, +} + // Reference imports to suppress errors if they are not otherwise used. var _ context.Context var _ grpc.ClientConn @@ -87,8 +158,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for CollectorService service - +// CollectorServiceClient is the client API for CollectorService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type CollectorServiceClient interface { PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) } @@ -103,15 +175,14 @@ func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { func (c *collectorServiceClient) PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) { out := new(PostSpansResponse) - err := grpc.Invoke(ctx, "/jaeger.api_v2.CollectorService/PostSpans", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/jaeger.api_v2.CollectorService/PostSpans", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for CollectorService service - +// CollectorServiceServer is the server API for CollectorService service. type CollectorServiceServer interface { PostSpans(context.Context, *PostSpansRequest) (*PostSpansResponse, error) } @@ -148,7 +219,7 @@ var _CollectorService_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "model/proto/api_v2/collector.proto", + Metadata: "api_v2/collector.proto", } func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { @@ -174,6 +245,9 @@ func (m *PostSpansRequest) MarshalTo(dAtA []byte) (int, error) { return 0, err } i += n1 + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -192,27 +266,12 @@ func (m *PostSpansResponse) MarshalTo(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } -func encodeFixed64Collector(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Collector(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -223,16 +282,28 @@ func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { return offset + 1 } func (m *PostSpansRequest) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = m.Batch.Size() n += 1 + l + sovCollector(uint64(l)) + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *PostSpansResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -320,6 +391,7 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -370,6 +442,7 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -483,32 +556,3 @@ var ( ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("model/proto/api_v2/collector.proto", fileDescriptorCollector) } -func init() { golang_proto.RegisterFile("model/proto/api_v2/collector.proto", fileDescriptorCollector) } - -var fileDescriptorCollector = []byte{ - // 344 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0xc1, 0x4e, 0xea, 0x40, - 0x14, 0x86, 0xef, 0x70, 0x2f, 0x24, 0x77, 0x0c, 0x09, 0x56, 0x12, 0x08, 0x31, 0x85, 0x74, 0xa3, - 0x21, 0xd2, 0xc1, 0x1a, 0x37, 0xec, 0xa8, 0x6e, 0x74, 0x45, 0x60, 0xe7, 0xc6, 0x0c, 0x75, 0x32, - 0xad, 0x29, 0x3d, 0x75, 0x66, 0xa8, 0x1b, 0x57, 0x3e, 0x82, 0xbe, 0x90, 0x4b, 0x96, 0x26, 0xee, - 0x8d, 0x41, 0x1f, 0xc4, 0x74, 0xa6, 0x1a, 0xc0, 0xb8, 0x3a, 0xa7, 0xe7, 0xff, 0xfa, 0x9f, 0x7f, - 0x0e, 0x76, 0x66, 0x70, 0xc5, 0x62, 0x92, 0x0a, 0x50, 0x40, 0x68, 0x1a, 0x5d, 0x66, 0x1e, 0x09, - 0x20, 0x8e, 0x59, 0xa0, 0x40, 0xb8, 0x7a, 0x6c, 0x55, 0xaf, 0x29, 0xe3, 0x4c, 0xb8, 0x46, 0x6e, - 0x35, 0x56, 0x7f, 0xd1, 0xbd, 0xe1, 0x5a, 0x75, 0x0e, 0x1c, 0xcc, 0x38, 0xef, 0x8a, 0xe9, 0x2e, - 0x07, 0xe0, 0x31, 0xcb, 0xcd, 0x09, 0x4d, 0x12, 0x50, 0x54, 0x45, 0x90, 0xc8, 0x42, 0x3d, 0xd0, - 0x25, 0xe8, 0x71, 0x96, 0xf4, 0xe4, 0x2d, 0xe5, 0x9c, 0x09, 0x02, 0xa9, 0x26, 0x7e, 0xd2, 0xce, - 0x29, 0xae, 0x8d, 0x40, 0xaa, 0x49, 0x4a, 0x13, 0x39, 0x66, 0x37, 0x73, 0x26, 0x95, 0xd5, 0xc7, - 0xe5, 0x29, 0x55, 0x41, 0xd8, 0x44, 0x1d, 0xb4, 0xbf, 0xe5, 0xd5, 0xdd, 0xb5, 0xb4, 0xae, 0x9f, - 0x6b, 0xfe, 0xbf, 0xc5, 0x6b, 0xfb, 0xcf, 0xd8, 0x80, 0xce, 0x0e, 0xde, 0x5e, 0x71, 0x91, 0x29, - 0x24, 0x92, 0x79, 0x77, 0xb8, 0x76, 0xf2, 0xf5, 0xee, 0x09, 0x13, 0x59, 0x14, 0x30, 0x2b, 0xc4, - 0xff, 0xbf, 0x41, 0xab, 0xbd, 0x61, 0xbc, 0x19, 0xa4, 0xd5, 0xf9, 0x1d, 0x30, 0x3b, 0x9c, 0xe6, - 0xfd, 0xcb, 0xc7, 0x63, 0xc9, 0x72, 0xaa, 0xfa, 0x18, 0x99, 0x47, 0x64, 0x2e, 0x0f, 0x50, 0xd7, - 0xcf, 0x1e, 0x86, 0xbe, 0x55, 0xf6, 0xfe, 0x1e, 0xba, 0xfd, 0x6e, 0x09, 0x95, 0xc4, 0x31, 0xc6, - 0xe7, 0xda, 0xac, 0x33, 0x1c, 0x9d, 0x59, 0x7b, 0xa1, 0x52, 0xa9, 0x1c, 0x10, 0xc2, 0x23, 0x15, - 0xce, 0xa7, 0x6e, 0x00, 0x33, 0x62, 0x76, 0x29, 0x41, 0x83, 0x28, 0xe1, 0xc5, 0xd7, 0x62, 0x69, - 0xa3, 0xe7, 0xa5, 0x8d, 0xde, 0x96, 0x36, 0x7a, 0x7a, 0xb7, 0x11, 0x6e, 0x44, 0xe0, 0xae, 0x81, - 0x45, 0xb6, 0x8b, 0x8a, 0xa9, 0xd3, 0x8a, 0xbe, 0xeb, 0xd1, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, - 0x45, 0xdb, 0x7c, 0x7d, 0x07, 0x02, 0x00, 0x00, -} diff --git a/proto-gen/api_v2/collector.pb.gw.go b/proto-gen/api_v2/collector.pb.gw.go index cc253e09c11..5b6ca10d111 100644 --- a/proto-gen/api_v2/collector.pb.gw.go +++ b/proto-gen/api_v2/collector.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: model/proto/api_v2/collector.proto +// source: api_v2/collector.proto /* Package api_v2 is a reverse proxy. @@ -32,7 +32,11 @@ func request_CollectorService_PostSpans_0(ctx context.Context, marshaler runtime var protoReq PostSpansRequest var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -51,14 +55,14 @@ func RegisterCollectorServiceHandlerFromEndpoint(ctx context.Context, mux *runti defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) } }() }() @@ -69,20 +73,19 @@ func RegisterCollectorServiceHandlerFromEndpoint(ctx context.Context, mux *runti // RegisterCollectorServiceHandler registers the http handlers for service CollectorService to "mux". // The handlers forward requests to the grpc endpoint over "conn". func RegisterCollectorServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - client := NewCollectorServiceClient(conn) + return RegisterCollectorServiceHandlerClient(ctx, mux, NewCollectorServiceClient(conn)) +} + +// RegisterCollectorServiceHandlerClient registers the http handlers for service CollectorService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CollectorServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CollectorServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "CollectorServiceClient" to call the correct interceptors. +func RegisterCollectorServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CollectorServiceClient) error { mux.Handle("POST", pattern_CollectorService_PostSpans_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) defer cancel() - if cn, ok := w.(http.CloseNotifier); ok { - go func(done <-chan struct{}, closed <-chan bool) { - select { - case <-done: - case <-closed: - cancel() - } - }(ctx.Done(), cn.CloseNotify()) - } inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateContext(ctx, mux, req) if err != nil { diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index 13412008a45..deb0f9f2ace 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -1,29 +1,34 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: model/proto/api_v2/sampling.proto +// source: api_v2/sampling.proto package api_v2 -import proto "github.com/gogo/protobuf/proto" -import golang_proto "github.com/golang/protobuf/proto" -import fmt "fmt" -import math "math" -import _ "github.com/gogo/protobuf/gogoproto" -import _ "github.com/gogo/googleapis/google/api" -import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - import ( - context "golang.org/x/net/context" + context "context" + encoding_binary "encoding/binary" + fmt "fmt" + _ "github.com/gogo/googleapis/google/api" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + golang_proto "github.com/golang/protobuf/proto" + _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" grpc "google.golang.org/grpc" + io "io" + math "math" ) -import io "io" - // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = golang_proto.Marshal var _ = fmt.Errorf var _ = math.Inf +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package + type SamplingStrategyType int32 const ( @@ -35,6 +40,7 @@ var SamplingStrategyType_name = map[int32]string{ 0: "PROBABILISTIC", 1: "RATE_LIMITING", } + var SamplingStrategyType_value = map[string]int32{ "PROBABILISTIC": 0, "RATE_LIMITING": 1, @@ -43,19 +49,51 @@ var SamplingStrategyType_value = map[string]int32{ func (x SamplingStrategyType) String() string { return proto.EnumName(SamplingStrategyType_name, int32(x)) } -func (SamplingStrategyType) EnumDescriptor() ([]byte, []int) { return fileDescriptorSampling, []int{0} } + +func (SamplingStrategyType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_80fcbf09c149c4e3, []int{0} +} type ProbabilisticSamplingStrategy struct { - SamplingRate float64 `protobuf:"fixed64,1,opt,name=samplingRate,proto3" json:"samplingRate,omitempty"` + SamplingRate float64 `protobuf:"fixed64,1,opt,name=samplingRate,proto3" json:"samplingRate,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *ProbabilisticSamplingStrategy) Reset() { *m = ProbabilisticSamplingStrategy{} } func (m *ProbabilisticSamplingStrategy) String() string { return proto.CompactTextString(m) } func (*ProbabilisticSamplingStrategy) ProtoMessage() {} func (*ProbabilisticSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptorSampling, []int{0} + return fileDescriptor_80fcbf09c149c4e3, []int{0} +} +func (m *ProbabilisticSamplingStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProbabilisticSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProbabilisticSamplingStrategy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProbabilisticSamplingStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProbabilisticSamplingStrategy.Merge(m, src) +} +func (m *ProbabilisticSamplingStrategy) XXX_Size() int { + return m.Size() +} +func (m *ProbabilisticSamplingStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_ProbabilisticSamplingStrategy.DiscardUnknown(m) } +var xxx_messageInfo_ProbabilisticSamplingStrategy proto.InternalMessageInfo + func (m *ProbabilisticSamplingStrategy) GetSamplingRate() float64 { if m != nil { return m.SamplingRate @@ -64,16 +102,45 @@ func (m *ProbabilisticSamplingStrategy) GetSamplingRate() float64 { } type RateLimitingSamplingStrategy struct { - MaxTracesPerSecond int32 `protobuf:"varint,1,opt,name=maxTracesPerSecond,proto3" json:"maxTracesPerSecond,omitempty"` + MaxTracesPerSecond int32 `protobuf:"varint,1,opt,name=maxTracesPerSecond,proto3" json:"maxTracesPerSecond,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *RateLimitingSamplingStrategy) Reset() { *m = RateLimitingSamplingStrategy{} } func (m *RateLimitingSamplingStrategy) String() string { return proto.CompactTextString(m) } func (*RateLimitingSamplingStrategy) ProtoMessage() {} func (*RateLimitingSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptorSampling, []int{1} + return fileDescriptor_80fcbf09c149c4e3, []int{1} +} +func (m *RateLimitingSamplingStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimitingSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RateLimitingSamplingStrategy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RateLimitingSamplingStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimitingSamplingStrategy.Merge(m, src) +} +func (m *RateLimitingSamplingStrategy) XXX_Size() int { + return m.Size() +} +func (m *RateLimitingSamplingStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimitingSamplingStrategy.DiscardUnknown(m) } +var xxx_messageInfo_RateLimitingSamplingStrategy proto.InternalMessageInfo + func (m *RateLimitingSamplingStrategy) GetMaxTracesPerSecond() int32 { if m != nil { return m.MaxTracesPerSecond @@ -83,16 +150,45 @@ func (m *RateLimitingSamplingStrategy) GetMaxTracesPerSecond() int32 { type OperationSamplingStrategy struct { Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"` - ProbabilisticSampling *ProbabilisticSamplingStrategy `protobuf:"bytes,2,opt,name=probabilisticSampling" json:"probabilisticSampling,omitempty"` + ProbabilisticSampling *ProbabilisticSamplingStrategy `protobuf:"bytes,2,opt,name=probabilisticSampling,proto3" json:"probabilisticSampling,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *OperationSamplingStrategy) Reset() { *m = OperationSamplingStrategy{} } func (m *OperationSamplingStrategy) String() string { return proto.CompactTextString(m) } func (*OperationSamplingStrategy) ProtoMessage() {} func (*OperationSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptorSampling, []int{2} + return fileDescriptor_80fcbf09c149c4e3, []int{2} +} +func (m *OperationSamplingStrategy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OperationSamplingStrategy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OperationSamplingStrategy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OperationSamplingStrategy) XXX_Merge(src proto.Message) { + xxx_messageInfo_OperationSamplingStrategy.Merge(m, src) +} +func (m *OperationSamplingStrategy) XXX_Size() int { + return m.Size() +} +func (m *OperationSamplingStrategy) XXX_DiscardUnknown() { + xxx_messageInfo_OperationSamplingStrategy.DiscardUnknown(m) } +var xxx_messageInfo_OperationSamplingStrategy proto.InternalMessageInfo + func (m *OperationSamplingStrategy) GetOperation() string { if m != nil { return m.Operation @@ -110,17 +206,46 @@ func (m *OperationSamplingStrategy) GetProbabilisticSampling() *ProbabilisticSam type PerOperationSamplingStrategies struct { DefaultSamplingProbability float64 `protobuf:"fixed64,1,opt,name=defaultSamplingProbability,proto3" json:"defaultSamplingProbability,omitempty"` DefaultLowerBoundTracesPerSecond float64 `protobuf:"fixed64,2,opt,name=defaultLowerBoundTracesPerSecond,proto3" json:"defaultLowerBoundTracesPerSecond,omitempty"` - PerOperationStrategies []*OperationSamplingStrategy `protobuf:"bytes,3,rep,name=perOperationStrategies" json:"perOperationStrategies,omitempty"` + PerOperationStrategies []*OperationSamplingStrategy `protobuf:"bytes,3,rep,name=perOperationStrategies,proto3" json:"perOperationStrategies,omitempty"` DefaultUpperBoundTracesPerSecond float64 `protobuf:"fixed64,4,opt,name=defaultUpperBoundTracesPerSecond,proto3" json:"defaultUpperBoundTracesPerSecond,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *PerOperationSamplingStrategies) Reset() { *m = PerOperationSamplingStrategies{} } func (m *PerOperationSamplingStrategies) String() string { return proto.CompactTextString(m) } func (*PerOperationSamplingStrategies) ProtoMessage() {} func (*PerOperationSamplingStrategies) Descriptor() ([]byte, []int) { - return fileDescriptorSampling, []int{3} + return fileDescriptor_80fcbf09c149c4e3, []int{3} +} +func (m *PerOperationSamplingStrategies) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PerOperationSamplingStrategies) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PerOperationSamplingStrategies.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PerOperationSamplingStrategies) XXX_Merge(src proto.Message) { + xxx_messageInfo_PerOperationSamplingStrategies.Merge(m, src) +} +func (m *PerOperationSamplingStrategies) XXX_Size() int { + return m.Size() +} +func (m *PerOperationSamplingStrategies) XXX_DiscardUnknown() { + xxx_messageInfo_PerOperationSamplingStrategies.DiscardUnknown(m) } +var xxx_messageInfo_PerOperationSamplingStrategies proto.InternalMessageInfo + func (m *PerOperationSamplingStrategies) GetDefaultSamplingProbability() float64 { if m != nil { return m.DefaultSamplingProbability @@ -151,15 +276,46 @@ func (m *PerOperationSamplingStrategies) GetDefaultUpperBoundTracesPerSecond() f type SamplingStrategyResponse struct { StrategyType SamplingStrategyType `protobuf:"varint,1,opt,name=strategyType,proto3,enum=jaeger.api_v2.SamplingStrategyType" json:"strategyType,omitempty"` - ProbabilisticSampling *ProbabilisticSamplingStrategy `protobuf:"bytes,2,opt,name=probabilisticSampling" json:"probabilisticSampling,omitempty"` - RateLimitingSampling *RateLimitingSamplingStrategy `protobuf:"bytes,3,opt,name=rateLimitingSampling" json:"rateLimitingSampling,omitempty"` - OperationSampling *PerOperationSamplingStrategies `protobuf:"bytes,4,opt,name=operationSampling" json:"operationSampling,omitempty"` + ProbabilisticSampling *ProbabilisticSamplingStrategy `protobuf:"bytes,2,opt,name=probabilisticSampling,proto3" json:"probabilisticSampling,omitempty"` + RateLimitingSampling *RateLimitingSamplingStrategy `protobuf:"bytes,3,opt,name=rateLimitingSampling,proto3" json:"rateLimitingSampling,omitempty"` + OperationSampling *PerOperationSamplingStrategies `protobuf:"bytes,4,opt,name=operationSampling,proto3" json:"operationSampling,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SamplingStrategyResponse) Reset() { *m = SamplingStrategyResponse{} } +func (m *SamplingStrategyResponse) String() string { return proto.CompactTextString(m) } +func (*SamplingStrategyResponse) ProtoMessage() {} +func (*SamplingStrategyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_80fcbf09c149c4e3, []int{4} +} +func (m *SamplingStrategyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SamplingStrategyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SamplingStrategyResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SamplingStrategyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SamplingStrategyResponse.Merge(m, src) +} +func (m *SamplingStrategyResponse) XXX_Size() int { + return m.Size() +} +func (m *SamplingStrategyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SamplingStrategyResponse.DiscardUnknown(m) } -func (m *SamplingStrategyResponse) Reset() { *m = SamplingStrategyResponse{} } -func (m *SamplingStrategyResponse) String() string { return proto.CompactTextString(m) } -func (*SamplingStrategyResponse) ProtoMessage() {} -func (*SamplingStrategyResponse) Descriptor() ([]byte, []int) { return fileDescriptorSampling, []int{4} } +var xxx_messageInfo_SamplingStrategyResponse proto.InternalMessageInfo func (m *SamplingStrategyResponse) GetStrategyType() SamplingStrategyType { if m != nil { @@ -190,15 +346,44 @@ func (m *SamplingStrategyResponse) GetOperationSampling() *PerOperationSamplingS } type SamplingStrategyParameters struct { - ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` + ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *SamplingStrategyParameters) Reset() { *m = SamplingStrategyParameters{} } func (m *SamplingStrategyParameters) String() string { return proto.CompactTextString(m) } func (*SamplingStrategyParameters) ProtoMessage() {} func (*SamplingStrategyParameters) Descriptor() ([]byte, []int) { - return fileDescriptorSampling, []int{5} + return fileDescriptor_80fcbf09c149c4e3, []int{5} +} +func (m *SamplingStrategyParameters) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SamplingStrategyParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SamplingStrategyParameters.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalTo(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SamplingStrategyParameters) XXX_Merge(src proto.Message) { + xxx_messageInfo_SamplingStrategyParameters.Merge(m, src) +} +func (m *SamplingStrategyParameters) XXX_Size() int { + return m.Size() } +func (m *SamplingStrategyParameters) XXX_DiscardUnknown() { + xxx_messageInfo_SamplingStrategyParameters.DiscardUnknown(m) +} + +var xxx_messageInfo_SamplingStrategyParameters proto.InternalMessageInfo func (m *SamplingStrategyParameters) GetServiceName() string { if m != nil { @@ -208,6 +393,8 @@ func (m *SamplingStrategyParameters) GetServiceName() string { } func init() { + proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) + golang_proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) proto.RegisterType((*ProbabilisticSamplingStrategy)(nil), "jaeger.api_v2.ProbabilisticSamplingStrategy") golang_proto.RegisterType((*ProbabilisticSamplingStrategy)(nil), "jaeger.api_v2.ProbabilisticSamplingStrategy") proto.RegisterType((*RateLimitingSamplingStrategy)(nil), "jaeger.api_v2.RateLimitingSamplingStrategy") @@ -220,8 +407,53 @@ func init() { golang_proto.RegisterType((*SamplingStrategyResponse)(nil), "jaeger.api_v2.SamplingStrategyResponse") proto.RegisterType((*SamplingStrategyParameters)(nil), "jaeger.api_v2.SamplingStrategyParameters") golang_proto.RegisterType((*SamplingStrategyParameters)(nil), "jaeger.api_v2.SamplingStrategyParameters") - proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) - golang_proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) +} + +func init() { proto.RegisterFile("api_v2/sampling.proto", fileDescriptor_80fcbf09c149c4e3) } +func init() { golang_proto.RegisterFile("api_v2/sampling.proto", fileDescriptor_80fcbf09c149c4e3) } + +var fileDescriptor_80fcbf09c149c4e3 = []byte{ + // 639 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcf, 0x4f, 0x13, 0x41, + 0x14, 0x76, 0x5a, 0x21, 0xe1, 0x15, 0x14, 0x46, 0xd0, 0xda, 0x40, 0xd3, 0x2c, 0x07, 0x2a, 0xc2, + 0xae, 0xae, 0xf1, 0x42, 0x0c, 0x49, 0x4b, 0x0c, 0x59, 0x52, 0xa0, 0xd9, 0xd6, 0x8b, 0x1e, 0x70, + 0xba, 0x8c, 0xc3, 0x98, 0x76, 0x67, 0x32, 0x3b, 0x80, 0x5c, 0x4d, 0xbc, 0x7a, 0xd0, 0xb3, 0x17, + 0xff, 0x12, 0x8f, 0x1e, 0x4d, 0xbc, 0x79, 0x32, 0xe8, 0x1f, 0x62, 0x3a, 0xdd, 0x42, 0xbb, 0xfd, + 0x75, 0xf3, 0x34, 0xbb, 0xef, 0x7d, 0xef, 0x7b, 0xdf, 0x7b, 0xf3, 0xe6, 0xc1, 0x12, 0x91, 0xfc, + 0xe8, 0xcc, 0x75, 0x22, 0xd2, 0x92, 0x4d, 0x1e, 0x32, 0x5b, 0x2a, 0xa1, 0x05, 0x9e, 0x7b, 0x4b, + 0x28, 0xa3, 0xca, 0xee, 0x78, 0x73, 0x8b, 0x4c, 0x30, 0x61, 0x3c, 0x4e, 0xfb, 0xab, 0x03, 0xca, + 0x2d, 0x33, 0x21, 0x58, 0x93, 0x3a, 0x44, 0x72, 0x87, 0x84, 0xa1, 0xd0, 0x44, 0x73, 0x11, 0x46, + 0xb1, 0x77, 0xc3, 0x1c, 0xc1, 0x26, 0xa3, 0xe1, 0x66, 0x74, 0x4e, 0x18, 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0x6b, 0x13, 0xa0, 0xdd, 0x41, 0xb3, + 0x56, 0xdf, 0xff, 0xfc, 0xfb, 0x39, 0xb5, 0x62, 0x65, 0xcd, 0x96, 0xed, 0x59, 0xd4, 0x5d, 0xe4, + 0x16, 0x5a, 0x2f, 0x9f, 0x7d, 0x2a, 0x95, 0xf1, 0x94, 0x9b, 0x7e, 0x6c, 0x3f, 0x5a, 0x4f, 0xa1, + 0x94, 0x7a, 0x0a, 0xb0, 0x67, 0xe8, 0x0b, 0xa5, 0xaa, 0x87, 0xd7, 0x4e, 0xb4, 0x96, 0xd1, 0x96, + 0xe3, 0x30, 0xae, 0x4f, 0x4e, 0x1b, 0x76, 0x20, 0x5a, 0x4e, 0x27, 0xbb, 0x56, 0x24, 0xe0, 0x21, + 0x8b, 0xff, 0xbe, 0x5f, 0xe6, 0xd1, 0x8f, 0xcb, 0x3c, 0xfa, 0x7d, 0x99, 0x47, 0xdf, 0xfe, 0xe4, + 0x11, 0xdc, 0xe3, 0xc2, 0xee, 0x03, 0xc6, 0x6a, 0x5f, 0x4e, 0x77, 0xce, 0xc6, 0xb4, 0xd9, 0xdd, + 0x4f, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0x72, 0x2d, 0x65, 0xb7, 0x45, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -232,8 +464,9 @@ var _ grpc.ClientConn // is compatible with the grpc package it is being compiled against. const _ = grpc.SupportPackageIsVersion4 -// Client API for SamplingManager service - +// SamplingManagerClient is the client API for SamplingManager service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type SamplingManagerClient interface { GetSamplingStrategy(ctx context.Context, in *SamplingStrategyParameters, opts ...grpc.CallOption) (*SamplingStrategyResponse, error) } @@ -248,15 +481,14 @@ func NewSamplingManagerClient(cc *grpc.ClientConn) SamplingManagerClient { func (c *samplingManagerClient) GetSamplingStrategy(ctx context.Context, in *SamplingStrategyParameters, opts ...grpc.CallOption) (*SamplingStrategyResponse, error) { out := new(SamplingStrategyResponse) - err := grpc.Invoke(ctx, "/jaeger.api_v2.SamplingManager/GetSamplingStrategy", in, out, c.cc, opts...) + err := c.cc.Invoke(ctx, "/jaeger.api_v2.SamplingManager/GetSamplingStrategy", in, out, opts...) if err != nil { return nil, err } return out, nil } -// Server API for SamplingManager service - +// SamplingManagerServer is the server API for SamplingManager service. type SamplingManagerServer interface { GetSamplingStrategy(context.Context, *SamplingStrategyParameters) (*SamplingStrategyResponse, error) } @@ -293,7 +525,7 @@ var _SamplingManager_serviceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "model/proto/api_v2/sampling.proto", + Metadata: "api_v2/sampling.proto", } func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { @@ -314,7 +546,11 @@ func (m *ProbabilisticSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { if m.SamplingRate != 0 { dAtA[i] = 0x9 i++ - i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.SamplingRate)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SamplingRate)))) + i += 8 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } @@ -339,6 +575,9 @@ func (m *RateLimitingSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { i++ i = encodeVarintSampling(dAtA, i, uint64(m.MaxTracesPerSecond)) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -373,6 +612,9 @@ func (m *OperationSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { } i += n1 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -394,12 +636,14 @@ func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { if m.DefaultSamplingProbability != 0 { dAtA[i] = 0x9 i++ - i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) + i += 8 } if m.DefaultLowerBoundTracesPerSecond != 0 { dAtA[i] = 0x11 i++ - i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) + i += 8 } if len(m.PerOperationStrategies) > 0 { for _, msg := range m.PerOperationStrategies { @@ -416,7 +660,11 @@ func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { if m.DefaultUpperBoundTracesPerSecond != 0 { dAtA[i] = 0x21 i++ - i = encodeFixed64Sampling(dAtA, i, uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) + i += 8 + } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) } return i, nil } @@ -471,6 +719,9 @@ func (m *SamplingStrategyResponse) MarshalTo(dAtA []byte) (int, error) { } i += n4 } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } @@ -495,27 +746,12 @@ func (m *SamplingStrategyParameters) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintSampling(dAtA, i, uint64(len(m.ServiceName))) i += copy(dAtA[i:], m.ServiceName) } + if m.XXX_unrecognized != nil { + i += copy(dAtA[i:], m.XXX_unrecognized) + } return i, nil } -func encodeFixed64Sampling(dAtA []byte, offset int, v uint64) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - dAtA[offset+4] = uint8(v >> 32) - dAtA[offset+5] = uint8(v >> 40) - dAtA[offset+6] = uint8(v >> 48) - dAtA[offset+7] = uint8(v >> 56) - return offset + 8 -} -func encodeFixed32Sampling(dAtA []byte, offset int, v uint32) int { - dAtA[offset] = uint8(v) - dAtA[offset+1] = uint8(v >> 8) - dAtA[offset+2] = uint8(v >> 16) - dAtA[offset+3] = uint8(v >> 24) - return offset + 4 -} func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) @@ -526,24 +762,39 @@ func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { return offset + 1 } func (m *ProbabilisticSamplingStrategy) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.SamplingRate != 0 { n += 9 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *RateLimitingSamplingStrategy) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.MaxTracesPerSecond != 0 { n += 1 + sovSampling(uint64(m.MaxTracesPerSecond)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *OperationSamplingStrategy) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.Operation) @@ -554,10 +805,16 @@ func (m *OperationSamplingStrategy) Size() (n int) { l = m.ProbabilisticSampling.Size() n += 1 + l + sovSampling(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *PerOperationSamplingStrategies) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.DefaultSamplingProbability != 0 { @@ -575,10 +832,16 @@ func (m *PerOperationSamplingStrategies) Size() (n int) { if m.DefaultUpperBoundTracesPerSecond != 0 { n += 9 } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *SamplingStrategyResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l if m.StrategyType != 0 { @@ -596,16 +859,25 @@ func (m *SamplingStrategyResponse) Size() (n int) { l = m.OperationSampling.Size() n += 1 + l + sovSampling(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } func (m *SamplingStrategyParameters) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = len(m.ServiceName) if l > 0 { n += 1 + l + sovSampling(uint64(l)) } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } return n } @@ -659,15 +931,8 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 m.SamplingRate = float64(math.Float64frombits(v)) default: iNdEx = preIndex @@ -681,6 +946,7 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -750,6 +1016,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -862,6 +1129,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -908,15 +1176,8 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 m.DefaultSamplingProbability = float64(math.Float64frombits(v)) case 2: if wireType != 1 { @@ -926,15 +1187,8 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 m.DefaultLowerBoundTracesPerSecond = float64(math.Float64frombits(v)) case 3: if wireType != 2 { @@ -975,15 +1229,8 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - v = uint64(dAtA[iNdEx-8]) - v |= uint64(dAtA[iNdEx-7]) << 8 - v |= uint64(dAtA[iNdEx-6]) << 16 - v |= uint64(dAtA[iNdEx-5]) << 24 - v |= uint64(dAtA[iNdEx-4]) << 32 - v |= uint64(dAtA[iNdEx-3]) << 40 - v |= uint64(dAtA[iNdEx-2]) << 48 - v |= uint64(dAtA[iNdEx-1]) << 56 m.DefaultUpperBoundTracesPerSecond = float64(math.Float64frombits(v)) default: iNdEx = preIndex @@ -997,6 +1244,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1165,6 +1413,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1244,6 +1493,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) iNdEx += skippy } } @@ -1357,51 +1607,3 @@ var ( ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") ) - -func init() { proto.RegisterFile("model/proto/api_v2/sampling.proto", fileDescriptorSampling) } -func init() { golang_proto.RegisterFile("model/proto/api_v2/sampling.proto", fileDescriptorSampling) } - -var fileDescriptorSampling = []byte{ - // 645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0x76, 0x5a, 0x21, 0xe1, 0x15, 0x14, 0x46, 0xd4, 0xda, 0x40, 0x53, 0x97, 0x03, 0x15, 0x61, - 0x57, 0x6b, 0xbc, 0x10, 0x43, 0xd2, 0x12, 0x43, 0x96, 0x14, 0x68, 0xb6, 0xf5, 0xa2, 0x07, 0x9c, - 0x6e, 0x9f, 0xc3, 0x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3e, 0x8f, 0xff, 0xbe, 0x9f, 0xe7, 0xc9, 0x8f, 0xf3, 0x3c, 0xf9, - 0x7d, 0x9e, 0x27, 0xdf, 0xfe, 0xe4, 0x09, 0xdc, 0x15, 0xd2, 0x1c, 0x00, 0xc6, 0x6a, 0x5f, 0x4e, - 0x77, 0xcf, 0xe6, 0x74, 0xb4, 0xbb, 0x9f, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x75, 0x18, - 0xac, 0x51, 0x06, 0x00, 0x00, -} diff --git a/proto-gen/api_v2/sampling.pb.gw.go b/proto-gen/api_v2/sampling.pb.gw.go index 5848d2629cd..48249f3cef9 100644 --- a/proto-gen/api_v2/sampling.pb.gw.go +++ b/proto-gen/api_v2/sampling.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: model/proto/api_v2/sampling.proto +// source: api_v2/sampling.proto /* Package api_v2 is a reverse proxy. @@ -32,7 +32,11 @@ func request_SamplingManager_GetSamplingStrategy_0(ctx context.Context, marshale var protoReq SamplingStrategyParameters var metadata runtime.ServerMetadata - if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil { + newReader, berr := utilities.IOReaderFactory(req.Body) + if berr != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) + } + if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -51,14 +55,14 @@ func RegisterSamplingManagerHandlerFromEndpoint(ctx context.Context, mux *runtim defer func() { if err != nil { if cerr := conn.Close(); cerr != nil { - grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) } return } go func() { <-ctx.Done() if cerr := conn.Close(); cerr != nil { - grpclog.Printf("Failed to close conn to %s: %v", endpoint, cerr) + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) } }() }() @@ -69,20 +73,19 @@ func RegisterSamplingManagerHandlerFromEndpoint(ctx context.Context, mux *runtim // RegisterSamplingManagerHandler registers the http handlers for service SamplingManager to "mux". // The handlers forward requests to the grpc endpoint over "conn". func RegisterSamplingManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - client := NewSamplingManagerClient(conn) + return RegisterSamplingManagerHandlerClient(ctx, mux, NewSamplingManagerClient(conn)) +} + +// RegisterSamplingManagerHandlerClient registers the http handlers for service SamplingManager +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SamplingManagerClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SamplingManagerClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "SamplingManagerClient" to call the correct interceptors. +func RegisterSamplingManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SamplingManagerClient) error { mux.Handle("POST", pattern_SamplingManager_GetSamplingStrategy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := context.WithCancel(req.Context()) defer cancel() - if cn, ok := w.(http.CloseNotifier); ok { - go func(done <-chan struct{}, closed <-chan bool) { - select { - case <-done: - case <-closed: - cancel() - } - }(ctx.Done(), cn.CloseNotify()) - } inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) rctx, err := runtime.AnnotateContext(ctx, mux, req) if err != nil { diff --git a/proto-gen/openapi/api_v2.swagger.json b/proto-gen/openapi/api_v2.swagger.json index d46c61234e8..907013b8659 100644 --- a/proto-gen/openapi/api_v2.swagger.json +++ b/proto-gen/openapi/api_v2.swagger.json @@ -1,7 +1,7 @@ { "swagger": "2.0", "info": { - "title": "model/proto/api_v2/sampling.proto", + "title": "api_v2/collector.proto", "version": "1.0" }, "schemes": [ From 2b5f262d0ed2e4bb0a917f597bcdc5404eef71a4 Mon Sep 17 00:00:00 2001 From: Annanay Date: Mon, 25 Mar 2019 01:48:20 +0530 Subject: [PATCH 4/8] Fix dependency in gopkg.toml Signed-off-by: Annanay --- Gopkg.lock | 5 +++-- Gopkg.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 7687d36c5da..38397d3abb2 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -278,7 +278,7 @@ revision = "b23578765ee54ff6bceff57f397d833bf4ca6869" [[projects]] - digest = "1:a7ca1a547447a4baef3c16479b5ba2d90967e9615e371a1205b7fc8c8fdcbfe7" + digest = "1:2d91858167615bbc9f642045d8f7e38a16b346fcc2523f9dc75b6da4d8b3397c" name = "github.com/gogo/protobuf" packages = [ "gogoproto", @@ -303,6 +303,7 @@ "protoc-gen-gogo", "protoc-gen-gogo/descriptor", "protoc-gen-gogo/generator", + "protoc-gen-gogo/generator/internal/remap", "protoc-gen-gogo/grpc", "protoc-gen-gogo/plugin", "sortkeys", @@ -311,7 +312,7 @@ "vanity/command", ] pruneopts = "UT" - revision = "fd9a4790f3963525fb889cc00e0a8f828e0b3a29" + revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c" [[projects]] digest = "1:1ba1d79f2810270045c328ae5d674321db34e3aae468eb4233883b473c5c0467" diff --git a/Gopkg.toml b/Gopkg.toml index 42f843f2b00..baece65950b 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -113,7 +113,7 @@ required = [ [[constraint]] name = "github.com/gogo/protobuf" - revision = "fd9a4790f3963525fb889cc00e0a8f828e0b3a29" + revision = "ba06b47c162d49f2af050fb4c75bcbc86a159d5c" [prune] go-tests = true From b1c8f345ebba081ff2067b212630badf1c08ebda Mon Sep 17 00:00:00 2001 From: Annanay Date: Mon, 25 Mar 2019 09:44:00 +0530 Subject: [PATCH 5/8] Corrected rebase Signed-off-by: Annanay --- proto-gen/api_v2/api_v2.pb.gw.go | 201 ------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 proto-gen/api_v2/api_v2.pb.gw.go diff --git a/proto-gen/api_v2/api_v2.pb.gw.go b/proto-gen/api_v2/api_v2.pb.gw.go deleted file mode 100644 index a9621ecda40..00000000000 --- a/proto-gen/api_v2/api_v2.pb.gw.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: api_v2.proto - -/* -Package api_v2 is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package api_v2 - -import ( - "io" - "net/http" - - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "golang.org/x/net/context" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray - -func request_CollectorService_PostSpans_0(ctx context.Context, marshaler runtime.Marshaler, client CollectorServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq PostSpansRequest - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.PostSpans(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func request_SamplingManager_GetSamplingStrategy_0(ctx context.Context, marshaler runtime.Marshaler, client SamplingManagerClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq SamplingStrategyParameters - var metadata runtime.ServerMetadata - - newReader, berr := utilities.IOReaderFactory(req.Body) - if berr != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr) - } - if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.GetSamplingStrategy(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -// RegisterCollectorServiceHandlerFromEndpoint is same as RegisterCollectorServiceHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterCollectorServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterCollectorServiceHandler(ctx, mux, conn) -} - -// RegisterCollectorServiceHandler registers the http handlers for service CollectorService to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterCollectorServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterCollectorServiceHandlerClient(ctx, mux, NewCollectorServiceClient(conn)) -} - -// RegisterCollectorServiceHandlerClient registers the http handlers for service CollectorService -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "CollectorServiceClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "CollectorServiceClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "CollectorServiceClient" to call the correct interceptors. -func RegisterCollectorServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CollectorServiceClient) error { - - mux.Handle("POST", pattern_CollectorService_PostSpans_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_CollectorService_PostSpans_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_CollectorService_PostSpans_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_CollectorService_PostSpans_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "spans"}, "")) -) - -var ( - forward_CollectorService_PostSpans_0 = runtime.ForwardResponseMessage -) - -// RegisterSamplingManagerHandlerFromEndpoint is same as RegisterSamplingManagerHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterSamplingManagerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterSamplingManagerHandler(ctx, mux, conn) -} - -// RegisterSamplingManagerHandler registers the http handlers for service SamplingManager to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterSamplingManagerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterSamplingManagerHandlerClient(ctx, mux, NewSamplingManagerClient(conn)) -} - -// RegisterSamplingManagerHandlerClient registers the http handlers for service SamplingManager -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SamplingManagerClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SamplingManagerClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "SamplingManagerClient" to call the correct interceptors. -func RegisterSamplingManagerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SamplingManagerClient) error { - - mux.Handle("POST", pattern_SamplingManager_GetSamplingStrategy_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_SamplingManager_GetSamplingStrategy_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_SamplingManager_GetSamplingStrategy_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_SamplingManager_GetSamplingStrategy_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"api", "v2", "samplingStrategy"}, "")) -) - -var ( - forward_SamplingManager_GetSamplingStrategy_0 = runtime.ForwardResponseMessage -) From 353fdc7893dd739f3d7b057f4fd3e13f45915b74 Mon Sep 17 00:00:00 2001 From: Annanay Date: Tue, 26 Mar 2019 18:53:23 +0530 Subject: [PATCH 6/8] Install the right proto bin versions Signed-off-by: Annanay --- model/model.pb.go | 193 ++++++++++++++++++++++++------- model/prototest/model_test.pb.go | 27 ++--- proto-gen/api_v2/collector.pb.go | 23 +++- proto-gen/api_v2/sampling.pb.go | 77 +++++++++--- 4 files changed, 243 insertions(+), 77 deletions(-) diff --git a/model/model.pb.go b/model/model.pb.go index 31b5cfc32a6..48005005910 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -1551,7 +1551,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1579,7 +1579,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1589,6 +1589,9 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1608,7 +1611,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VType |= (ValueType(b) & 0x7F) << shift + m.VType |= ValueType(b&0x7F) << shift if b < 0x80 { break } @@ -1627,7 +1630,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1637,6 +1640,9 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1656,7 +1662,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - v |= (int(b) & 0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1676,7 +1682,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.VInt64 |= (int64(b) & 0x7F) << shift + m.VInt64 |= int64(b&0x7F) << shift if b < 0x80 { break } @@ -1706,7 +1712,7 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1715,6 +1721,9 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1732,6 +1741,9 @@ func (m *KeyValue) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1760,7 +1772,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1788,7 +1800,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1797,6 +1809,9 @@ func (m *Log) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1818,7 +1833,7 @@ func (m *Log) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1827,6 +1842,9 @@ func (m *Log) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1844,6 +1862,9 @@ func (m *Log) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1872,7 +1893,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1900,7 +1921,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1909,6 +1930,9 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1930,7 +1954,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1939,6 +1963,9 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1960,7 +1987,7 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RefType |= (SpanRefType(b) & 0x7F) << shift + m.RefType |= SpanRefType(b&0x7F) << shift if b < 0x80 { break } @@ -1974,6 +2001,9 @@ func (m *SpanRef) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2002,7 +2032,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2030,7 +2060,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2040,6 +2070,9 @@ func (m *Process) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2059,7 +2092,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2068,6 +2101,9 @@ func (m *Process) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2085,6 +2121,9 @@ func (m *Process) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2113,7 +2152,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2141,7 +2180,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2150,6 +2189,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2171,7 +2213,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= (int(b) & 0x7F) << shift + byteLen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2180,6 +2222,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2201,7 +2246,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2211,6 +2256,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2230,7 +2278,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2239,6 +2287,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2261,7 +2312,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Flags |= (Flags(b) & 0x7F) << shift + m.Flags |= Flags(b&0x7F) << shift if b < 0x80 { break } @@ -2280,7 +2331,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2289,6 +2340,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2310,7 +2364,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2319,6 +2373,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2340,7 +2397,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2349,6 +2406,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2371,7 +2431,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2380,6 +2440,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2402,7 +2465,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2411,6 +2474,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2435,7 +2501,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2445,6 +2511,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2464,7 +2533,7 @@ func (m *Span) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2474,6 +2543,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2488,6 +2560,9 @@ func (m *Span) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2516,7 +2591,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2544,7 +2619,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2553,6 +2628,9 @@ func (m *Trace) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2575,7 +2653,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2584,6 +2662,9 @@ func (m *Trace) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2606,7 +2687,7 @@ func (m *Trace) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2616,6 +2697,9 @@ func (m *Trace) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2630,6 +2714,9 @@ func (m *Trace) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2658,7 +2745,7 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2686,7 +2773,7 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2696,6 +2783,9 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2715,7 +2805,7 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2724,6 +2814,9 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2740,6 +2833,9 @@ func (m *Trace_ProcessMapping) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2768,7 +2864,7 @@ func (m *Batch) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -2796,7 +2892,7 @@ func (m *Batch) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2805,6 +2901,9 @@ func (m *Batch) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2827,7 +2926,7 @@ func (m *Batch) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -2836,6 +2935,9 @@ func (m *Batch) Unmarshal(dAtA []byte) error { return ErrInvalidLengthModel } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthModel + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -2855,6 +2957,9 @@ func (m *Batch) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthModel } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthModel + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -2922,10 +3027,13 @@ func skipModel(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthModel } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthModel + } return iNdEx, nil case 3: for { @@ -2954,6 +3062,9 @@ func skipModel(dAtA []byte) (n int, err error) { return 0, err } iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthModel + } } return iNdEx, nil case 4: diff --git a/model/prototest/model_test.pb.go b/model/prototest/model_test.pb.go index 875c6f03cf2..a4c7ea3b120 100644 --- a/model/prototest/model_test.pb.go +++ b/model/prototest/model_test.pb.go @@ -3,11 +3,9 @@ package prototest -import ( - fmt "fmt" - proto "github.com/golang/protobuf/proto" - math "math" -) +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -18,7 +16,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package type SpanRefType int32 @@ -31,7 +29,6 @@ var SpanRefType_name = map[int32]string{ 0: "CHILD_OF", 1: "FOLLOWS_FROM", } - var SpanRefType_value = map[string]int32{ "CHILD_OF": 0, "FOLLOWS_FROM": 1, @@ -40,9 +37,8 @@ var SpanRefType_value = map[string]int32{ func (x SpanRefType) String() string { return proto.EnumName(SpanRefType_name, int32(x)) } - func (SpanRefType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_7d019f60590a05da, []int{0} + return fileDescriptor_model_test_74918b92027939ce, []int{0} } type SpanRef struct { @@ -58,17 +54,16 @@ func (m *SpanRef) Reset() { *m = SpanRef{} } func (m *SpanRef) String() string { return proto.CompactTextString(m) } func (*SpanRef) ProtoMessage() {} func (*SpanRef) Descriptor() ([]byte, []int) { - return fileDescriptor_7d019f60590a05da, []int{0} + return fileDescriptor_model_test_74918b92027939ce, []int{0} } - func (m *SpanRef) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SpanRef.Unmarshal(m, b) } func (m *SpanRef) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SpanRef.Marshal(b, m, deterministic) } -func (m *SpanRef) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpanRef.Merge(m, src) +func (dst *SpanRef) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpanRef.Merge(dst, src) } func (m *SpanRef) XXX_Size() int { return xxx_messageInfo_SpanRef.Size(m) @@ -101,13 +96,13 @@ func (m *SpanRef) GetRefType() SpanRefType { } func init() { - proto.RegisterEnum("prototest.SpanRefType", SpanRefType_name, SpanRefType_value) proto.RegisterType((*SpanRef)(nil), "prototest.SpanRef") + proto.RegisterEnum("prototest.SpanRefType", SpanRefType_name, SpanRefType_value) } -func init() { proto.RegisterFile("model_test.proto", fileDescriptor_7d019f60590a05da) } +func init() { proto.RegisterFile("model_test.proto", fileDescriptor_model_test_74918b92027939ce) } -var fileDescriptor_7d019f60590a05da = []byte{ +var fileDescriptor_model_test_74918b92027939ce = []byte{ // 178 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc8, 0xcd, 0x4f, 0x49, 0xcd, 0x89, 0x2f, 0x49, 0x2d, 0x2e, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x04, 0x53, diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index 6ef1708bd2d..7aad7a6247f 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -335,7 +335,7 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -363,7 +363,7 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -372,6 +372,9 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { return ErrInvalidLengthCollector } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthCollector + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -388,6 +391,9 @@ func (m *PostSpansRequest) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthCollector } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCollector + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -416,7 +422,7 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -439,6 +445,9 @@ func (m *PostSpansResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthCollector } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthCollector + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -506,10 +515,13 @@ func skipCollector(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthCollector } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthCollector + } return iNdEx, nil case 3: for { @@ -538,6 +550,9 @@ func skipCollector(dAtA []byte) (n int, err error) { return 0, err } iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthCollector + } } return iNdEx, nil case 4: diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index deb0f9f2ace..8f40c58c7a4 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -909,7 +909,7 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -943,6 +943,9 @@ func (m *ProbabilisticSamplingStrategy) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSampling } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSampling + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -971,7 +974,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -999,7 +1002,7 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.MaxTracesPerSecond |= (int32(b) & 0x7F) << shift + m.MaxTracesPerSecond |= int32(b&0x7F) << shift if b < 0x80 { break } @@ -1013,6 +1016,9 @@ func (m *RateLimitingSamplingStrategy) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSampling } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSampling + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1041,7 +1047,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1069,7 +1075,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1079,6 +1085,9 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1098,7 +1107,7 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1107,6 +1116,9 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1126,6 +1138,9 @@ func (m *OperationSamplingStrategy) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSampling } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSampling + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1154,7 +1169,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1204,7 +1219,7 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1213,6 +1228,9 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1241,6 +1259,9 @@ func (m *PerOperationSamplingStrategies) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSampling } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSampling + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1269,7 +1290,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1297,7 +1318,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.StrategyType |= (SamplingStrategyType(b) & 0x7F) << shift + m.StrategyType |= SamplingStrategyType(b&0x7F) << shift if b < 0x80 { break } @@ -1316,7 +1337,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1325,6 +1346,9 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1349,7 +1373,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1358,6 +1382,9 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1382,7 +1409,7 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= (int(b) & 0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } @@ -1391,6 +1418,9 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1410,6 +1440,9 @@ func (m *SamplingStrategyResponse) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSampling } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSampling + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1438,7 +1471,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - wire |= (uint64(b) & 0x7F) << shift + wire |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1466,7 +1499,7 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= (uint64(b) & 0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } @@ -1476,6 +1509,9 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { return ErrInvalidLengthSampling } postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSampling + } if postIndex > l { return io.ErrUnexpectedEOF } @@ -1490,6 +1526,9 @@ func (m *SamplingStrategyParameters) Unmarshal(dAtA []byte) error { if skippy < 0 { return ErrInvalidLengthSampling } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSampling + } if (iNdEx + skippy) > l { return io.ErrUnexpectedEOF } @@ -1557,10 +1596,13 @@ func skipSampling(dAtA []byte) (n int, err error) { break } } - iNdEx += length if length < 0 { return 0, ErrInvalidLengthSampling } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthSampling + } return iNdEx, nil case 3: for { @@ -1589,6 +1631,9 @@ func skipSampling(dAtA []byte) (n int, err error) { return 0, err } iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthSampling + } } return iNdEx, nil case 4: From f521962b391ca566bb1f0c9a4e1ab1e9c326803f Mon Sep 17 00:00:00 2001 From: Annanay Date: Tue, 26 Mar 2019 23:02:25 +0530 Subject: [PATCH 7/8] Run make fmt Signed-off-by: Annanay --- model/model.pb.go | 7 ++++--- proto-gen/api_v2/collector.pb.go | 8 +++++--- proto-gen/api_v2/sampling.pb.go | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/model/model.pb.go b/model/model.pb.go index 48005005910..03bd8282d28 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -7,15 +7,16 @@ import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" + io "io" + math "math" + time "time" + _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" golang_proto "github.com/golang/protobuf/proto" - io "io" - math "math" - time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index 7aad7a6247f..a49e20d8ce7 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -6,15 +6,17 @@ package api_v2 import ( context "context" fmt "fmt" + io "io" + math "math" + _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" - io "io" - math "math" + + model "github.com/jaegertracing/jaeger/model" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index 8f40c58c7a4..2dfd32e6783 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -7,14 +7,15 @@ import ( context "context" encoding_binary "encoding/binary" fmt "fmt" + io "io" + math "math" + _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" grpc "google.golang.org/grpc" - io "io" - math "math" ) // Reference imports to suppress errors if they are not otherwise used. From ff927c1b7b613db1d5c81c8ace366f7fec359134 Mon Sep 17 00:00:00 2001 From: Annanay Date: Wed, 27 Mar 2019 12:20:21 +0530 Subject: [PATCH 8/8] Revert make fmt changes Signed-off-by: Annanay --- model/model.pb.go | 7 +++---- proto-gen/api_v2/collector.pb.go | 8 +++----- proto-gen/api_v2/sampling.pb.go | 5 ++--- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/model/model.pb.go b/model/model.pb.go index 03bd8282d28..48005005910 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -7,16 +7,15 @@ import ( bytes "bytes" encoding_binary "encoding/binary" fmt "fmt" - io "io" - math "math" - time "time" - _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" golang_proto "github.com/golang/protobuf/proto" + io "io" + math "math" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index a49e20d8ce7..7aad7a6247f 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -6,17 +6,15 @@ package api_v2 import ( context "context" fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" - grpc "google.golang.org/grpc" - model "github.com/jaegertracing/jaeger/model" + grpc "google.golang.org/grpc" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used. diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index 2dfd32e6783..8f40c58c7a4 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -7,15 +7,14 @@ import ( context "context" encoding_binary "encoding/binary" fmt "fmt" - io "io" - math "math" - _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" golang_proto "github.com/golang/protobuf/proto" _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger/options" grpc "google.golang.org/grpc" + io "io" + math "math" ) // Reference imports to suppress errors if they are not otherwise used.