From b73fbad2231472da9143eed47d9716e8781b2185 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 00:42:48 +0200 Subject: [PATCH 01/11] feat: convert models to alias jaegerIdlModel Signed-off-by: nabil salah --- go.mod | 1 + go.sum | 2 + model/dependencies.go | 9 - model/flags.go | 48 +- model/hash.go | 7 +- model/ids.go | 151 +- model/keyvalue.go | 177 +- model/model.pb.go | 3142 +--------------------------- model/process.go | 20 - model/span.go | 114 +- model/trace.go | 18 - proto-gen/api_v2/collector.pb.go | 321 +-- proto-gen/api_v2/query.pb.go | 3277 +----------------------------- proto-gen/api_v2/sampling.pb.go | 1395 +------------ 14 files changed, 140 insertions(+), 8542 deletions(-) diff --git a/go.mod b/go.mod index ba33e6aae2d..ec2503fce3a 100644 --- a/go.mod +++ b/go.mod @@ -161,6 +161,7 @@ require ( github.com/hashicorp/hcl v1.0.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/jaegertracing/jaeger-idl v0.0.0-20250122172554-3e525d710892 github.com/jcmturner/aescts/v2 v2.0.0 // indirect github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect github.com/jcmturner/gofork v1.7.6 // indirect diff --git a/go.sum b/go.sum index e00f58d47f8..b26222cca98 100644 --- a/go.sum +++ b/go.sum @@ -329,6 +329,8 @@ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2 github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/ionos-cloud/sdk-go/v6 v6.1.11 h1:J/uRN4UWO3wCyGOeDdMKv8LWRzKu6UIkLEaes38Kzh8= github.com/ionos-cloud/sdk-go/v6 v6.1.11/go.mod h1:EzEgRIDxBELvfoa/uBN0kOQaqovLjUWEB7iW4/Q+t4k= +github.com/jaegertracing/jaeger-idl v0.0.0-20250122172554-3e525d710892 h1:wDzNPLnnHOGCvGpLGn78gPo6Cqxpdil5TkS9dKfT2cE= +github.com/jaegertracing/jaeger-idl v0.0.0-20250122172554-3e525d710892/go.mod h1:TimiEKGlMAcMZsKSHJkXNo0I0Q39iaENPswLXA1I2XY= github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= diff --git a/model/dependencies.go b/model/dependencies.go index 8a0f2745b1f..992af93e8fe 100644 --- a/model/dependencies.go +++ b/model/dependencies.go @@ -8,12 +8,3 @@ const ( // JaegerDependencyLinkSource describes a dependency diagram that was generated from Jaeger traces. JaegerDependencyLinkSource = "jaeger" ) - -// ApplyDefaults applies defaults to the DependencyLink. -func (d DependencyLink) ApplyDefaults() DependencyLink { - dd := d - if dd.Source == "" { - dd.Source = JaegerDependencyLinkSource - } - return dd -} diff --git a/model/flags.go b/model/flags.go index e3e587f3a02..e3d6721586c 100644 --- a/model/flags.go +++ b/model/flags.go @@ -4,6 +4,10 @@ package model +import ( + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" +) + const ( // SampledFlag is the bit set in Flags in order to define a span as a sampled span SampledFlag = Flags(1) @@ -14,46 +18,4 @@ const ( ) // Flags is a bit map of flags for a span -type Flags uint32 - -// ------- Flags ------- - -// SetSampled sets the Flags as sampled -func (f *Flags) SetSampled() { - f.setFlags(SampledFlag) -} - -// SetDebug set the Flags as sampled -func (f *Flags) SetDebug() { - f.setFlags(DebugFlag) -} - -// SetFirehose set the Flags as firehose enabled -func (f *Flags) SetFirehose() { - f.setFlags(FirehoseFlag) -} - -func (f *Flags) setFlags(bit Flags) { - *f |= bit -} - -// IsSampled returns true if the Flags denote sampling -func (f Flags) IsSampled() bool { - return f.checkFlags(SampledFlag) -} - -// IsDebug returns true if the Flags denote debugging -// Debugging can be useful in testing tracing availability or correctness -func (f Flags) IsDebug() bool { - return f.checkFlags(DebugFlag) -} - -// IsFirehoseEnabled returns true if firehose is enabled -// Firehose is used to decide whether to index a span or not -func (f Flags) IsFirehoseEnabled() bool { - return f.checkFlags(FirehoseFlag) -} - -func (f Flags) checkFlags(bit Flags) bool { - return f&bit == bit -} +type Flags = jaegerIdlModel.Flags diff --git a/model/hash.go b/model/hash.go index 5b4a4dc442a..733d60b9833 100644 --- a/model/hash.go +++ b/model/hash.go @@ -6,14 +6,13 @@ package model import ( "hash/fnv" - "io" + + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) // Hashable interface is for type that can participate in a hash computation // by writing their data into io.Writer, which is usually an instance of hash.Hash. -type Hashable interface { - Hash(w io.Writer) error -} +type Hashable = jaegerIdlModel.Hashable // HashCode calculates a FNV-1a hash code for a Hashable object. func HashCode(o Hashable) (uint64, error) { diff --git a/model/ids.go b/model/ids.go index 27c7d3846b0..eeef8cf4613 100644 --- a/model/ids.go +++ b/model/ids.go @@ -5,13 +5,12 @@ package model import ( - "encoding/base64" "encoding/binary" "errors" "fmt" "strconv" - "github.com/gogo/protobuf/jsonpb" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) const ( @@ -22,13 +21,10 @@ const ( ) // TraceID is a random 128bit identifier for a trace -type TraceID struct { - Low uint64 `json:"lo"` - High uint64 `json:"hi"` -} +type TraceID = jaegerIdlModel.TraceID // SpanID is a random 64bit identifier for a span -type SpanID uint64 +type SpanID = jaegerIdlModel.SpanID // ------- TraceID ------- @@ -37,13 +33,6 @@ func NewTraceID(high, low uint64) TraceID { return TraceID{High: high, Low: low} } -func (t TraceID) String() string { - if t.High == 0 { - return fmt.Sprintf("%016x", t.Low) - } - return fmt.Sprintf("%016x%016x", t.High, t.Low) -} - // TraceIDFromString creates a TraceID from a hexadecimal string func TraceIDFromString(s string) (TraceID, error) { var hi, lo uint64 @@ -82,68 +71,6 @@ func TraceIDFromBytes(data []byte) (TraceID, error) { return t, nil } -// MarshalText is called by encoding/json, which we do not want people to use. -func (TraceID) MarshalText() ([]byte, error) { - return nil, errors.New("unsupported method TraceID.MarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") -} - -// UnmarshalText is called by encoding/json, which we do not want people to use. -func (*TraceID) UnmarshalText([]byte /* text */) error { - return errors.New("unsupported method TraceID.UnmarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") -} - -// Size returns the size of this datum in protobuf. It is always 16 bytes. -func (*TraceID) Size() int { - return 16 -} - -// MarshalTo converts trace ID into a binary representation. Called by protobuf serialization. -func (t *TraceID) MarshalTo(data []byte) (n int, err error) { - var b [16]byte - binary.BigEndian.PutUint64(b[:8], uint64(t.High)) - binary.BigEndian.PutUint64(b[8:], uint64(t.Low)) - return marshalBytes(data, b[:]) -} - -// Unmarshal inflates this trace ID from binary representation. Called by protobuf serialization. -func (t *TraceID) Unmarshal(data []byte) error { - var err error - *t, err = TraceIDFromBytes(data) - return err -} - -func marshalBytes(dst []byte, src []byte) (n int, err error) { - if len(dst) < len(src) { - return 0, errors.New("buffer is too short") - } - return copy(dst, src), nil -} - -// MarshalJSON converts trace id into a base64 string enclosed in quotes. -// Used by protobuf JSON serialization. -// Example: {high:2, low:1} => "AAAAAAAAAAIAAAAAAAAAAQ==". -func (t TraceID) MarshalJSON() ([]byte, error) { - var b [16]byte - t.MarshalTo(b[:]) // can only error on incorrect buffer size - s := make([]byte, 24+2) - base64.StdEncoding.Encode(s[1:25], b[:]) - s[0], s[25] = '"', '"' - return s, nil -} - -// UnmarshalJSON inflates trace id from base64 string, possibly enclosed in quotes. -// Used by protobuf JSON serialization. -func (t *TraceID) UnmarshalJSON(data []byte) error { - s := string(data) - if l := len(s); l > 2 && s[0] == '"' && s[l-1] == '"' { - s = s[1 : l-1] - } - b, err := base64.StdEncoding.DecodeString(s) - if err != nil { - return fmt.Errorf("cannot unmarshal TraceID from string '%s': %w", string(data), err) - } - return t.Unmarshal(b) -} // ------- SpanID ------- @@ -152,10 +79,6 @@ func NewSpanID(v uint64) SpanID { return SpanID(v) } -func (s SpanID) String() string { - return fmt.Sprintf("%016x", uint64(s)) -} - // SpanIDFromString creates a SpanID from a hexadecimal string func SpanIDFromString(s string) (SpanID, error) { if len(s) > 16 { @@ -175,71 +98,3 @@ func SpanIDFromBytes(data []byte) (SpanID, error) { } return NewSpanID(binary.BigEndian.Uint64(data)), nil } - -// MarshalText is called by encoding/json, which we do not want people to use. -func (SpanID) MarshalText() ([]byte, error) { - return nil, errors.New("unsupported method SpanID.MarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") -} - -// UnmarshalText is called by encoding/json, which we do not want people to use. -func (*SpanID) UnmarshalText([]byte /* text */) error { - return errors.New("unsupported method SpanID.UnmarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") -} - -// Size returns the size of this datum in protobuf. It is always 8 bytes. -func (*SpanID) Size() int { - return 8 -} - -// MarshalTo converts span ID into a binary representation. Called by protobuf serialization. -func (s *SpanID) MarshalTo(data []byte) (n int, err error) { - var b [8]byte - binary.BigEndian.PutUint64(b[:], uint64(*s)) - return marshalBytes(data, b[:]) -} - -// Unmarshal inflates span ID from a binary representation. Called by protobuf serialization. -func (s *SpanID) Unmarshal(data []byte) error { - var err error - *s, err = SpanIDFromBytes(data) - return err -} - -// MarshalJSON converts span id into a base64 string enclosed in quotes. -// Used by protobuf JSON serialization. -// Example: {1} => "AAAAAAAAAAE=". -func (s SpanID) MarshalJSON() ([]byte, error) { - var b [8]byte - s.MarshalTo(b[:]) // can only error on incorrect buffer size - v := make([]byte, 12+2) - base64.StdEncoding.Encode(v[1:13], b[:]) - v[0], v[13] = '"', '"' - return v, nil -} - -// UnmarshalJSON inflates span id from base64 string, possibly enclosed in quotes. -// User by protobuf JSON serialization. -// -// There appears to be a bug in gogoproto, as this function is only called for numeric values. -// https://github.com/gogo/protobuf/issues/411#issuecomment-393856837 -func (s *SpanID) UnmarshalJSON(data []byte) error { - str := string(data) - if l := len(str); l > 2 && str[0] == '"' && str[l-1] == '"' { - str = str[1 : l-1] - } - b, err := base64.StdEncoding.DecodeString(str) - if err != nil { - return fmt.Errorf("cannot unmarshal SpanID from string '%s': %w", string(data), err) - } - return s.Unmarshal(b) -} - -// UnmarshalJSONPB inflates span id from base64 string, possibly enclosed in quotes. -// User by protobuf JSON serialization. -// -// TODO: can be removed once this ticket is fixed: -// -// https://github.com/gogo/protobuf/issues/411#issuecomment-393856837 -func (s *SpanID) UnmarshalJSONPB(_ *jsonpb.Unmarshaler, b []byte) error { - return s.UnmarshalJSON(b) -} diff --git a/model/keyvalue.go b/model/keyvalue.go index 72304eeee91..b017418ba7b 100644 --- a/model/keyvalue.go +++ b/model/keyvalue.go @@ -5,12 +5,9 @@ package model import ( - "encoding/binary" - "encoding/hex" "fmt" - "io" - "sort" - "strconv" + + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) // These constants are kept mostly for backwards compatibility. @@ -31,7 +28,7 @@ const ( SamplerParamKey = "sampler.param" ) -type SpanKind string +type SpanKind = jaegerIdlModel.SpanKind const ( SpanKindClient SpanKind = "client" @@ -52,7 +49,7 @@ func SpanKindFromString(kind string) (SpanKind, error) { } // KeyValues is a type alias that exposes convenience functions like Sort, FindByKey. -type KeyValues []KeyValue +type KeyValues = jaegerIdlModel.KeyValues // String creates a String-typed KeyValue func String(key string, value string) KeyValue { @@ -78,169 +75,3 @@ func Float64(key string, value float64) KeyValue { func Binary(key string, value []byte) KeyValue { return KeyValue{Key: key, VType: BinaryType, VBinary: value} } - -// Bool returns the Boolean value stored in this KeyValue or false if it stores a different type. -// The caller must check VType before using this method. -func (kv *KeyValue) Bool() bool { - if kv.VType == BoolType { - return kv.VBool - } - return false -} - -// Int64 returns the Int64 value stored in this KeyValue or 0 if it stores a different type. -// The caller must check VType before using this method. -func (kv *KeyValue) Int64() int64 { - if kv.VType == Int64Type { - return kv.VInt64 - } - return 0 -} - -// Float64 returns the Float64 value stored in this KeyValue or 0 if it stores a different type. -// The caller must check VType before using this method. -func (kv *KeyValue) Float64() float64 { - if kv.VType == Float64Type { - return kv.VFloat64 - } - return 0 -} - -// Binary returns the blob ([]byte) value stored in this KeyValue or nil if it stores a different type. -// The caller must check VType before using this method. -func (kv *KeyValue) Binary() []byte { - if kv.VType == BinaryType { - return kv.VBinary - } - return nil -} - -// Value returns typed values stored in KeyValue as any. -func (kv *KeyValue) Value() any { - switch kv.VType { - case StringType: - return kv.VStr - case BoolType: - return kv.VBool - case Int64Type: - return kv.VInt64 - case Float64Type: - return kv.VFloat64 - case BinaryType: - return kv.VBinary - default: - return fmt.Errorf("unknown type %d", kv.VType) - } -} - -// AsStringLossy returns a potentially lossy string representation of the value. -func (kv *KeyValue) AsStringLossy() string { - return kv.asString(true) -} - -// AsString returns a string representation of the value. -func (kv *KeyValue) AsString() string { - return kv.asString(false) -} - -func (kv *KeyValue) asString(truncate bool) string { - switch kv.VType { - case StringType: - return kv.VStr - case BoolType: - if kv.Bool() { - return "true" - } - return "false" - case Int64Type: - return strconv.FormatInt(kv.Int64(), 10) - case Float64Type: - return strconv.FormatFloat(kv.Float64(), 'g', 10, 64) - case BinaryType: - if truncate && len(kv.VBinary) > 256 { - return hex.EncodeToString(kv.VBinary[0:256]) + "..." - } - return hex.EncodeToString(kv.VBinary) - default: - return fmt.Sprintf("unknown type %d", kv.VType) - } -} - -// IsLess compares KeyValue object with another KeyValue. -// The order is based first on the keys, then on type, and finally on the value. -func (kv *KeyValue) IsLess(two *KeyValue) bool { - return kv.Compare(two) < 0 -} - -func (kvs KeyValues) Len() int { return len(kvs) } -func (kvs KeyValues) Swap(i, j int) { kvs[i], kvs[j] = kvs[j], kvs[i] } -func (kvs KeyValues) Less(i, j int) bool { - return kvs[i].IsLess(&kvs[j]) -} - -// Sort does in-place sorting of KeyValues, then by value type, then by value. -func (kvs KeyValues) Sort() { - sort.Sort(kvs) -} - -// FindByKey scans the list of key-values searching for the first one with the given key. -// Returns found tag and a boolean flag indicating if the search was successful. -func (kvs KeyValues) FindByKey(key string) (KeyValue, bool) { - for _, kv := range kvs { - if kv.Key == key { - return kv, true - } - } - return KeyValue{}, false -} - -// Equal compares KeyValues with another list. Both lists must be already sorted. -func (kvs KeyValues) Equal(other KeyValues) bool { - l1, l2 := len(kvs), len(other) - if l1 != l2 { - return false - } - for i := 0; i < l1; i++ { - if !kvs[i].Equal(&other[i]) { - return false - } - } - return true -} - -// Hash implements Hash from Hashable. -func (kvs KeyValues) Hash(w io.Writer) error { - for i := range kvs { - if err := kvs[i].Hash(w); err != nil { - return err - } - } - return nil -} - -// Hash implements Hash from Hashable. -func (kv KeyValue) Hash(w io.Writer) error { - if _, err := w.Write([]byte(kv.Key)); err != nil { - return err - } - //nolint: gosec // G115 - if err := binary.Write(w, binary.BigEndian, uint16(kv.VType)); err != nil { - return err - } - var err error - switch kv.VType { - case StringType: - _, err = w.Write([]byte(kv.VStr)) - case BoolType: - err = binary.Write(w, binary.BigEndian, kv.VBool) - case Int64Type: - err = binary.Write(w, binary.BigEndian, kv.VInt64) - case Float64Type: - err = binary.Write(w, binary.BigEndian, kv.VFloat64) - case BinaryType: - _, err = w.Write(kv.VBinary) - default: - err = fmt.Errorf("unknown type %d", kv.VType) - } - return err -} diff --git a/model/model.pb.go b/model/model.pb.go index 42290c9cce5..71aabd62425 100644 --- a/model/model.pb.go +++ b/model/model.pb.go @@ -4,17 +4,16 @@ package model import ( - bytes "bytes" - encoding_binary "encoding/binary" + fmt "fmt" _ "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" io "io" math "math" math_bits "math/bits" time "time" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) // Reference imports to suppress errors if they are not otherwise used. @@ -29,7 +28,7 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type ValueType int32 +type ValueType = jaegerIdlModel.ValueType const ( ValueType_STRING ValueType = 0 @@ -55,15 +54,8 @@ var ValueType_value = map[string]int32{ "BINARY": 4, } -func (x ValueType) String() string { - return proto.EnumName(ValueType_name, int32(x)) -} - -func (ValueType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4c16552f9fdb66d8, []int{0} -} -type SpanRefType int32 +type SpanRefType = jaegerIdlModel.SpanRefType const ( SpanRefType_CHILD_OF SpanRefType = 0 @@ -80,499 +72,62 @@ var SpanRefType_value = map[string]int32{ "FOLLOWS_FROM": 1, } -func (x SpanRefType) String() string { - return proto.EnumName(SpanRefType_name, int32(x)) -} -func (SpanRefType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_4c16552f9fdb66d8, []int{1} -} +type KeyValue = jaegerIdlModel.KeyValue -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"` - 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.MarshalToSizedBuffer(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) -} var xxx_messageInfo_KeyValue proto.InternalMessageInfo -func (m *KeyValue) GetKey() string { - if m != nil { - return m.Key - } - return "" -} - -func (m *KeyValue) GetVType() ValueType { - if m != nil { - return m.VType - } - return ValueType_STRING -} - -func (m *KeyValue) GetVStr() string { - if m != nil { - return m.VStr - } - return "" -} - -func (m *KeyValue) GetVBool() bool { - if m != nil { - return m.VBool - } - return false -} - -func (m *KeyValue) GetVInt64() int64 { - if m != nil { - return m.VInt64 - } - return 0 -} -func (m *KeyValue) GetVFloat64() float64 { - if m != nil { - return m.VFloat64 - } - return 0 -} -func (m *KeyValue) GetVBinary() []byte { - if m != nil { - return m.VBinary - } - return nil -} +type Log = jaegerIdlModel.Log -type Log struct { - 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.MarshalToSizedBuffer(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) -} var xxx_messageInfo_Log proto.InternalMessageInfo -func (m *Log) GetTimestamp() time.Time { - if m != nil { - return m.Timestamp - } - return time.Time{} -} - -func (m *Log) GetFields() []KeyValue { - if m != nil { - return m.Fields - } - return nil -} - -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"` - 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.MarshalToSizedBuffer(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) -} -var xxx_messageInfo_SpanRef proto.InternalMessageInfo +type SpanRef = jaegerIdlModel.SpanRef -func (m *SpanRef) GetRefType() SpanRefType { - if m != nil { - return m.RefType - } - return SpanRefType_CHILD_OF -} -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,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.MarshalToSizedBuffer(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) -} +var xxx_messageInfo_SpanRef proto.InternalMessageInfo -var xxx_messageInfo_Process proto.InternalMessageInfo -func (m *Process) GetServiceName() string { - if m != nil { - return m.ServiceName - } - return "" -} -func (m *Process) GetTags() []KeyValue { - if m != nil { - return m.Tags - } - return nil -} +type Process = jaegerIdlModel.Process -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,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.MarshalToSizedBuffer(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 +var xxx_messageInfo_Process proto.InternalMessageInfo -func (m *Span) GetOperationName() string { - if m != nil { - return m.OperationName - } - return "" -} -func (m *Span) GetReferences() []SpanRef { - if m != nil { - return m.References - } - return nil -} -func (m *Span) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} +type Span = jaegerIdlModel.Span -func (m *Span) GetDuration() time.Duration { - if m != nil { - return m.Duration - } - return 0 -} -func (m *Span) GetTags() []KeyValue { - if m != nil { - return m.Tags - } - return nil -} -func (m *Span) GetLogs() []Log { - if m != nil { - return m.Logs - } - return nil -} +var xxx_messageInfo_Span proto.InternalMessageInfo -func (m *Span) GetProcess() *Process { - if m != nil { - return m.Process - } - return nil -} -func (m *Span) GetProcessID() string { - if m != nil { - return m.ProcessID - } - return "" -} -func (m *Span) GetWarnings() []string { - if m != nil { - return m.Warnings - } - return nil -} +type Trace = jaegerIdlModel.Trace -type Trace struct { - 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.MarshalToSizedBuffer(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) -} var xxx_messageInfo_Trace proto.InternalMessageInfo -func (m *Trace) GetSpans() []*Span { - if m != nil { - return m.Spans - } - return nil -} -func (m *Trace) GetProcessMap() []Trace_ProcessMapping { - if m != nil { - return m.ProcessMap - } - return nil -} -func (m *Trace) GetWarnings() []string { - if m != nil { - return m.Warnings - } - return nil -} +type Trace_ProcessMapping = jaegerIdlModel.Trace_ProcessMapping -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,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.MarshalToSizedBuffer(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) -} var xxx_messageInfo_Trace_ProcessMapping proto.InternalMessageInfo -func (m *Trace_ProcessMapping) GetProcessID() string { - if m != nil { - return m.ProcessID - } - return "" -} -func (m *Trace_ProcessMapping) GetProcess() Process { - if m != nil { - return m.Process - } - return Process{} -} // Note that both Span and Batch may contain a Process. // This is different from the Thrift model which was only used @@ -583,135 +138,25 @@ func (m *Trace_ProcessMapping) GetProcess() Process { // semantics, both Batch and Spans in the same message may contain // their own instances of Process, with span.Process taking priority // over batch.Process. -type Batch struct { - 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:"-"` -} +type Batch = jaegerIdlModel.Batch -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.MarshalToSizedBuffer(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) -} -var xxx_messageInfo_Batch proto.InternalMessageInfo -func (m *Batch) GetSpans() []*Span { - if m != nil { - return m.Spans - } - return nil -} +var xxx_messageInfo_Batch proto.InternalMessageInfo -func (m *Batch) GetProcess() *Process { - if m != nil { - return m.Process - } - return nil -} -type DependencyLink struct { - Parent string `protobuf:"bytes,1,opt,name=parent,proto3" json:"parent,omitempty"` - Child string `protobuf:"bytes,2,opt,name=child,proto3" json:"child,omitempty"` - CallCount uint64 `protobuf:"varint,3,opt,name=call_count,json=callCount,proto3" json:"call_count,omitempty"` - Source string `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} -func (m *DependencyLink) Reset() { *m = DependencyLink{} } -func (m *DependencyLink) String() string { return proto.CompactTextString(m) } -func (*DependencyLink) ProtoMessage() {} -func (*DependencyLink) Descriptor() ([]byte, []int) { - return fileDescriptor_4c16552f9fdb66d8, []int{7} -} -func (m *DependencyLink) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *DependencyLink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_DependencyLink.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *DependencyLink) XXX_Merge(src proto.Message) { - xxx_messageInfo_DependencyLink.Merge(m, src) -} -func (m *DependencyLink) XXX_Size() int { - return m.Size() -} -func (m *DependencyLink) XXX_DiscardUnknown() { - xxx_messageInfo_DependencyLink.DiscardUnknown(m) -} +type DependencyLink = jaegerIdlModel.DependencyLink -var xxx_messageInfo_DependencyLink proto.InternalMessageInfo -func (m *DependencyLink) GetParent() string { - if m != nil { - return m.Parent - } - return "" -} -func (m *DependencyLink) GetChild() string { - if m != nil { - return m.Child - } - return "" -} +var xxx_messageInfo_DependencyLink proto.InternalMessageInfo -func (m *DependencyLink) GetCallCount() uint64 { - if m != nil { - return m.CallCount - } - return 0 -} -func (m *DependencyLink) GetSource() string { - if m != nil { - return m.Source - } - return "" -} func init() { - proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) - proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) + //proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) + //proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) proto.RegisterType((*KeyValue)(nil), "jaeger.api_v2.KeyValue") proto.RegisterType((*Log)(nil), "jaeger.api_v2.Log") proto.RegisterType((*SpanRef)(nil), "jaeger.api_v2.SpanRef") @@ -789,2551 +234,30 @@ var fileDescriptor_4c16552f9fdb66d8 = []byte{ 0x02, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x45, 0x11, 0xa2, 0xdf, 0x07, 0x00, 0x00, } -func (this *KeyValue) Compare(that interface{}) int { - if that == nil { - if this == nil { - return 0 - } - return 1 - } - - that1, ok := that.(*KeyValue) - if !ok { - that2, ok := that.(KeyValue) - if ok { - that1 = &that2 - } else { - return 1 - } - } - if that1 == nil { - if this == nil { - return 0 - } - return 1 - } else if this == nil { - return -1 - } - if this.Key != that1.Key { - if this.Key < that1.Key { - return -1 - } - return 1 - } - if this.VType != that1.VType { - if this.VType < that1.VType { - return -1 - } - return 1 - } - if this.VStr != that1.VStr { - if this.VStr < that1.VStr { - return -1 - } - return 1 - } - if this.VBool != that1.VBool { - if !this.VBool { - return -1 - } - return 1 - } - if this.VInt64 != that1.VInt64 { - if this.VInt64 < that1.VInt64 { - return -1 - } - return 1 - } - if this.VFloat64 != that1.VFloat64 { - if this.VFloat64 < that1.VFloat64 { - return -1 - } - return 1 - } - 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 { - return this == nil - } - - that1, ok := that.(*KeyValue) - if !ok { - that2, ok := that.(KeyValue) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Key != that1.Key { - return false - } - if this.VType != that1.VType { - return false - } - if this.VStr != that1.VStr { - return false - } - if this.VBool != that1.VBool { - return false - } - if this.VInt64 != that1.VInt64 { - return false - } - if this.VFloat64 != that1.VFloat64 { - return false - } - 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) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *KeyValue) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *KeyValue) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.VBinary) > 0 { - i -= len(m.VBinary) - copy(dAtA[i:], m.VBinary) - i = encodeVarintModel(dAtA, i, uint64(len(m.VBinary))) - i-- - dAtA[i] = 0x3a - } - if m.VFloat64 != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.VFloat64)))) - i-- - dAtA[i] = 0x31 - } - if m.VInt64 != 0 { - i = encodeVarintModel(dAtA, i, uint64(m.VInt64)) - i-- - dAtA[i] = 0x28 - } - if m.VBool { - i-- - if m.VBool { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - if len(m.VStr) > 0 { - i -= len(m.VStr) - copy(dAtA[i:], m.VStr) - i = encodeVarintModel(dAtA, i, uint64(len(m.VStr))) - i-- - dAtA[i] = 0x1a - } - if m.VType != 0 { - i = encodeVarintModel(dAtA, i, uint64(m.VType)) - i-- - dAtA[i] = 0x10 - } - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintModel(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *Log) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} -func (m *Log) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *Log) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Fields) > 0 { - for iNdEx := len(m.Fields) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Fields[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintModel(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *SpanRef) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintModel(dAtA []byte, offset int, v uint64) int { + offset -= sovModel(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *SpanRef) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } -func (m *SpanRef) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RefType != 0 { - i = encodeVarintModel(dAtA, i, uint64(m.RefType)) - i-- - dAtA[i] = 0x18 - } - { - size := m.SpanID.Size() - i -= size - if _, err := m.SpanID.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.TraceID.Size() - i -= size - if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *Process) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func sovModel(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } - -func (m *Process) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func sozModel(x uint64) (n int) { + return sovModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Process) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Tags) > 0 { - for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.ServiceName) > 0 { - i -= len(m.ServiceName) - copy(dAtA[i:], m.ServiceName) - i = encodeVarintModel(dAtA, i, uint64(len(m.ServiceName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Span) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Span) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Span) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintModel(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x62 - } - } - if len(m.ProcessID) > 0 { - i -= len(m.ProcessID) - copy(dAtA[i:], m.ProcessID) - i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) - i-- - dAtA[i] = 0x5a - } - if m.Process != nil { - { - size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } - if len(m.Logs) > 0 { - for iNdEx := len(m.Logs) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Logs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x4a - } - } - if len(m.Tags) > 0 { - for iNdEx := len(m.Tags) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Tags[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 - } - } - n3, err3 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.Duration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.Duration):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintModel(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x3a - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintModel(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x32 - if m.Flags != 0 { - i = encodeVarintModel(dAtA, i, uint64(m.Flags)) - i-- - dAtA[i] = 0x28 - } - if len(m.References) > 0 { - for iNdEx := len(m.References) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.References[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.OperationName) > 0 { - i -= len(m.OperationName) - copy(dAtA[i:], m.OperationName) - i = encodeVarintModel(dAtA, i, uint64(len(m.OperationName))) - i-- - dAtA[i] = 0x1a - } - { - size := m.SpanID.Size() - i -= size - if _, err := m.SpanID.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size := m.TraceID.Size() - i -= size - if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *Trace) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Trace) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Trace) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Warnings) > 0 { - for iNdEx := len(m.Warnings) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Warnings[iNdEx]) - copy(dAtA[i:], m.Warnings[iNdEx]) - i = encodeVarintModel(dAtA, i, uint64(len(m.Warnings[iNdEx]))) - i-- - dAtA[i] = 0x1a - } - } - if len(m.ProcessMap) > 0 { - for iNdEx := len(m.ProcessMap) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.ProcessMap[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.Spans) > 0 { - for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *Trace_ProcessMapping) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Trace_ProcessMapping) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Trace_ProcessMapping) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - { - size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.ProcessID) > 0 { - i -= len(m.ProcessID) - copy(dAtA[i:], m.ProcessID) - i = encodeVarintModel(dAtA, i, uint64(len(m.ProcessID))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Batch) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Batch) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Batch) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Process != nil { - { - size, err := m.Process.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Spans) > 0 { - for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintModel(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *DependencyLink) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *DependencyLink) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *DependencyLink) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Source) > 0 { - i -= len(m.Source) - copy(dAtA[i:], m.Source) - i = encodeVarintModel(dAtA, i, uint64(len(m.Source))) - i-- - dAtA[i] = 0x22 - } - if m.CallCount != 0 { - i = encodeVarintModel(dAtA, i, uint64(m.CallCount)) - i-- - dAtA[i] = 0x18 - } - if len(m.Child) > 0 { - i -= len(m.Child) - copy(dAtA[i:], m.Child) - i = encodeVarintModel(dAtA, i, uint64(len(m.Child))) - i-- - dAtA[i] = 0x12 - } - if len(m.Parent) > 0 { - i -= len(m.Parent) - copy(dAtA[i:], m.Parent) - i = encodeVarintModel(dAtA, i, uint64(len(m.Parent))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintModel(dAtA []byte, offset int, v uint64) int { - offset -= sovModel(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *KeyValue) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if m.VType != 0 { - n += 1 + sovModel(uint64(m.VType)) - } - l = len(m.VStr) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if m.VBool { - n += 2 - } - if m.VInt64 != 0 { - n += 1 + sovModel(uint64(m.VInt64)) - } - if m.VFloat64 != 0 { - n += 9 - } - l = len(m.VBinary) - 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 = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp) - n += 1 + l + sovModel(uint64(l)) - if len(m.Fields) > 0 { - for _, e := range m.Fields { - l = e.Size() - 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() - n += 1 + l + sovModel(uint64(l)) - l = m.SpanID.Size() - n += 1 + l + sovModel(uint64(l)) - 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) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if len(m.Tags) > 0 { - for _, e := range m.Tags { - l = e.Size() - 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() - n += 1 + l + sovModel(uint64(l)) - l = m.SpanID.Size() - n += 1 + l + sovModel(uint64(l)) - l = len(m.OperationName) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if len(m.References) > 0 { - for _, e := range m.References { - l = e.Size() - n += 1 + l + sovModel(uint64(l)) - } - } - if m.Flags != 0 { - n += 1 + sovModel(uint64(m.Flags)) - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovModel(uint64(l)) - 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 { - l = e.Size() - n += 1 + l + sovModel(uint64(l)) - } - } - if len(m.Logs) > 0 { - for _, e := range m.Logs { - l = e.Size() - n += 1 + l + sovModel(uint64(l)) - } - } - if m.Process != nil { - l = m.Process.Size() - n += 1 + l + sovModel(uint64(l)) - } - l = len(m.ProcessID) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - l = len(s) - 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 { - for _, e := range m.Spans { - l = e.Size() - n += 1 + l + sovModel(uint64(l)) - } - } - if len(m.ProcessMap) > 0 { - for _, e := range m.ProcessMap { - l = e.Size() - n += 1 + l + sovModel(uint64(l)) - } - } - if len(m.Warnings) > 0 { - for _, s := range m.Warnings { - l = len(s) - 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) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - 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 { - for _, e := range m.Spans { - l = e.Size() - n += 1 + l + sovModel(uint64(l)) - } - } - if m.Process != nil { - l = m.Process.Size() - n += 1 + l + sovModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *DependencyLink) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Parent) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - l = len(m.Child) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if m.CallCount != 0 { - n += 1 + sovModel(uint64(m.CallCount)) - } - l = len(m.Source) - if l > 0 { - n += 1 + l + sovModel(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovModel(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozModel(x uint64) (n int) { - return sovModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *KeyValue) 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 ErrIntOverflowModel - } - 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: KeyValue: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: KeyValue: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VType", wireType) - } - m.VType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VType |= ValueType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VStr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VStr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VBool", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.VBool = bool(v != 0) - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field VInt64", wireType) - } - m.VInt64 = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.VInt64 |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field VFloat64", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.VFloat64 = float64(math.Float64frombits(v)) - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VBinary", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.VBinary = append(m.VBinary[:0], dAtA[iNdEx:postIndex]...) - if m.VBinary == nil { - m.VBinary = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Log) 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 ErrIntOverflowModel - } - 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: Log: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Log: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fields", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Fields = append(m.Fields, KeyValue{}) - if err := m.Fields[len(m.Fields)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SpanRef) 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 ErrIntOverflowModel - } - 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: SpanRef: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpanRef: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TraceID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpanID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SpanID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RefType", wireType) - } - m.RefType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.RefType |= SpanRefType(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Process) 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 ErrIntOverflowModel - } - 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: Process: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Process: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tags = append(m.Tags, KeyValue{}) - if err := m.Tags[len(m.Tags)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Span) 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 ErrIntOverflowModel - } - 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: Span: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Span: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TraceID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpanID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.SpanID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperationName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperationName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field References", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.References = append(m.References, SpanRef{}) - if err := m.References[len(m.References)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Flags", wireType) - } - m.Flags = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Flags |= Flags(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.Duration, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Tags = append(m.Tags, KeyValue{}) - if err := m.Tags[len(m.Tags)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 9: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Logs", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Logs = append(m.Logs, Log{}) - if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Process == nil { - m.Process = &Process{} - } - if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 11: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 12: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Trace) 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 ErrIntOverflowModel - } - 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: Trace: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Trace: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Spans = append(m.Spans, &Span{}) - if err := m.Spans[len(m.Spans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessMap", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessMap = append(m.ProcessMap, Trace_ProcessMapping{}) - if err := m.ProcessMap[len(m.ProcessMap)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Warnings", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Warnings = append(m.Warnings, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Trace_ProcessMapping) 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 ErrIntOverflowModel - } - 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: ProcessMapping: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProcessMapping: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProcessID", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ProcessID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Batch) 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 ErrIntOverflowModel - } - 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: Batch: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Batch: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Spans = append(m.Spans, &Span{}) - if err := m.Spans[len(m.Spans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Process", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Process == nil { - m.Process = &Process{} - } - if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *DependencyLink) 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 ErrIntOverflowModel - } - 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: DependencyLink: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: DependencyLink: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Parent = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Child", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Child = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CallCount", wireType) - } - m.CallCount = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.CallCount |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Source", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowModel - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthModel - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthModel - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Source = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipModel(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthModel - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipModel(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/model/process.go b/model/process.go index f2a73151886..00ea40ba04a 100644 --- a/model/process.go +++ b/model/process.go @@ -4,10 +4,6 @@ package model -import ( - "io" -) - // NewProcess creates a new Process for given serviceName and tags. // The tags are sorted in place and kept in the same array/slice, // in order to store the Process in a canonical form that is relied @@ -17,19 +13,3 @@ func NewProcess(serviceName string, tags []KeyValue) *Process { typedTags.Sort() return &Process{ServiceName: serviceName, Tags: typedTags} } - -// Equal compares Process object with another Process. -func (p *Process) Equal(other *Process) bool { - if p.ServiceName != other.ServiceName { - return false - } - return KeyValues(p.Tags).Equal(other.Tags) -} - -// Hash implements Hash from Hashable. -func (p *Process) Hash(w io.Writer) (err error) { - if _, err := w.Write([]byte(p.ServiceName)); err != nil { - return err - } - return KeyValues(p.Tags).Hash(w) -} diff --git a/model/span.go b/model/span.go index 1e5d4aa9265..06d01c1ba2b 100644 --- a/model/span.go +++ b/model/span.go @@ -5,11 +5,10 @@ package model import ( - "encoding/gob" - "io" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) -type SamplerType int +type SamplerType = jaegerIdlModel.SamplerType const ( SamplerTypeUnrecognized SamplerType = iota @@ -27,115 +26,6 @@ var toSamplerType = map[string]SamplerType{ "const": SamplerTypeConst, } -func (s SamplerType) String() string { - switch s { - case SamplerTypeUnrecognized: - return "unrecognized" - case SamplerTypeProbabilistic: - return "probabilistic" - case SamplerTypeLowerBound: - return "lowerbound" - case SamplerTypeRateLimiting: - return "ratelimiting" - case SamplerTypeConst: - return "const" - default: - return "" - } -} - func SpanKindTag(kind SpanKind) KeyValue { return String(SpanKindKey, string(kind)) } - -// Hash implements Hash from Hashable. -func (s *Span) Hash(w io.Writer) (err error) { - // gob is not the most efficient way, but it ensures we don't miss any fields. - // See BenchmarkSpanHash in span_test.go - enc := gob.NewEncoder(w) - return enc.Encode(s) -} - -// HasSpanKind returns true if the span has a `span.kind` tag set to `kind`. -func (s *Span) HasSpanKind(kind SpanKind) bool { - if tag, ok := KeyValues(s.Tags).FindByKey(SpanKindKey); ok { - return tag.AsString() == string(kind) - } - return false -} - -// GetSpanKind returns value of `span.kind` tag and whether the tag can be found -func (s *Span) GetSpanKind() (spanKind SpanKind, found bool) { - if tag, ok := KeyValues(s.Tags).FindByKey(SpanKindKey); ok { - if kind, err := SpanKindFromString(tag.AsString()); err == nil { - return kind, true - } - } - return SpanKindUnspecified, false -} - -// GetSamplerType returns the sampler type for span -func (s *Span) GetSamplerType() SamplerType { - // There's no corresponding opentelemetry tag label corresponding to sampler.type - if tag, ok := KeyValues(s.Tags).FindByKey(SamplerTypeKey); ok { - if s, ok := toSamplerType[tag.VStr]; ok { - return s - } - } - return SamplerTypeUnrecognized -} - -// IsRPCClient returns true if the span represents a client side of an RPC, -// as indicated by the `span.kind` tag set to `client`. -func (s *Span) IsRPCClient() bool { - return s.HasSpanKind(SpanKindClient) -} - -// IsRPCServer returns true if the span represents a server side of an RPC, -// as indicated by the `span.kind` tag set to `server`. -func (s *Span) IsRPCServer() bool { - return s.HasSpanKind(SpanKindServer) -} - -// NormalizeTimestamps changes all timestamps in this span to UTC. -func (s *Span) NormalizeTimestamps() { - s.StartTime = s.StartTime.UTC() - for i := range s.Logs { - s.Logs[i].Timestamp = s.Logs[i].Timestamp.UTC() - } -} - -// ParentSpanID returns ID of a parent span if it exists. -// It searches for the first child-of or follows-from reference pointing to the same trace ID. -func (s *Span) ParentSpanID() SpanID { - var followsFromRef *SpanRef - for i := range s.References { - ref := &s.References[i] - if ref.TraceID != s.TraceID { - continue - } - if ref.RefType == ChildOf { - return ref.SpanID - } - if followsFromRef == nil && ref.RefType == FollowsFrom { - followsFromRef = ref - } - } - if followsFromRef != nil { - return followsFromRef.SpanID - } - return SpanID(0) -} - -// ReplaceParentID replaces span ID in the parent span reference. -// See also ParentSpanID. -func (s *Span) ReplaceParentID(newParentID SpanID) { - oldParentID := s.ParentSpanID() - for i := range s.References { - if s.References[i].SpanID == oldParentID && s.References[i].TraceID == s.TraceID { - s.References[i].SpanID = newParentID - return - } - } - s.References = MaybeAddParentSpanID(s.TraceID, newParentID, s.References) -} diff --git a/model/trace.go b/model/trace.go index 234e2adb143..682cb6a5bff 100644 --- a/model/trace.go +++ b/model/trace.go @@ -3,21 +3,3 @@ // SPDX-License-Identifier: Apache-2.0 package model - -// FindSpanByID looks for a span with given span ID and returns the first one -// it finds (search order is unspecified), or nil if no spans have that ID. -func (t *Trace) FindSpanByID(id SpanID) *Span { - for _, span := range t.Spans { - if id == span.SpanID { - return span - } - } - return nil -} - -// NormalizeTimestamps changes all timestamps in this trace to UTC. -func (t *Trace) NormalizeTimestamps() { - for _, span := range t.Spans { - span.NormalizeTimestamps() - } -} diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.pb.go index b15329cc1ca..1b10bc6e803 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.pb.go @@ -9,12 +9,10 @@ import ( _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" math_bits "math/bits" ) @@ -29,89 +27,17 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type PostSpansRequest struct { - Batch model.Batch `protobuf:"bytes,1,opt,name=batch,proto3" json:"batch"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type PostSpansRequest = jaegerIdlModel.PostSpansRequest + -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_9305884a292fdf82, []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.MarshalToSizedBuffer(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) -} var xxx_messageInfo_PostSpansRequest proto.InternalMessageInfo -func (m *PostSpansRequest) GetBatch() model.Batch { - if m != nil { - return m.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_9305884a292fdf82, []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.MarshalToSizedBuffer(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) -} +type PostSpansResponse = jaegerIdlModel.PostSpansResponse + + var xxx_messageInfo_PostSpansResponse proto.InternalMessageInfo @@ -154,9 +80,7 @@ const _ = grpc.SupportPackageIsVersion4 // 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) -} +type CollectorServiceClient = jaegerIdlModel.CollectorServiceClient type collectorServiceClient struct { cc *grpc.ClientConn @@ -176,17 +100,12 @@ func (c *collectorServiceClient) PostSpans(ctx context.Context, in *PostSpansReq } // CollectorServiceServer is the server API for CollectorService service. -type CollectorServiceServer interface { - PostSpans(context.Context, *PostSpansRequest) (*PostSpansResponse, error) -} +type CollectorServiceServer = jaegerIdlModel.CollectorServiceServer // UnimplementedCollectorServiceServer can be embedded to have forward compatible implementations. -type UnimplementedCollectorServiceServer struct { -} +type UnimplementedCollectorServiceServer = jaegerIdlModel.UnimplementedCollectorServiceServer + -func (*UnimplementedCollectorServiceServer) PostSpans(ctx context.Context, req *PostSpansRequest) (*PostSpansResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method PostSpans not implemented") -} func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { s.RegisterService(&_CollectorService_serviceDesc, srv) @@ -223,69 +142,7 @@ var _CollectorService_serviceDesc = grpc.ServiceDesc{ Metadata: "collector.proto", } -func (m *PostSpansRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PostSpansRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PostSpansRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - { - size, err := m.Batch.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintCollector(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *PostSpansResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} -func (m *PostSpansResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PostSpansResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { offset -= sovCollector(v) @@ -298,31 +155,7 @@ func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -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 -} func sovCollector(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 @@ -330,141 +163,7 @@ func sovCollector(x uint64) (n int) { 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 < 0 { - return ErrInvalidLengthCollector - } - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCollector - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - 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) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthCollector - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipCollector(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto-gen/api_v2/query.pb.go b/proto-gen/api_v2/query.pb.go index 311b5c0cd46..118a84962e6 100644 --- a/proto-gen/api_v2/query.pb.go +++ b/proto-gen/api_v2/query.pb.go @@ -10,16 +10,13 @@ import ( _ "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" - github_com_jaegertracing_jaeger_model "github.com/jaegertracing/jaeger/model" - model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + io "io" math "math" math_bits "math/bits" time "time" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) // Reference imports to suppress errors if they are not otherwise used. @@ -34,216 +31,36 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type GetTraceRequest struct { - TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` - // Optional. The start time to search trace ID. - StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` - // Optional. The end time to search trace ID. - EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` - // Optional. If set to true, the response will not include any - // enrichments to the trace, such as clock skew adjustment. - // Instead, the trace will be returned exactly as stored. - RawTraces bool `protobuf:"varint,4,opt,name=raw_traces,json=rawTraces,proto3" json:"raw_traces,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type GetTraceRequest = jaegerIdlModel.GetTraceRequest + + -func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } -func (m *GetTraceRequest) String() string { return proto.CompactTextString(m) } -func (*GetTraceRequest) ProtoMessage() {} -func (*GetTraceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{0} -} -func (m *GetTraceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetTraceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetTraceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTraceRequest.Merge(m, src) -} -func (m *GetTraceRequest) XXX_Size() int { - return m.Size() -} -func (m *GetTraceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTraceRequest.DiscardUnknown(m) -} var xxx_messageInfo_GetTraceRequest proto.InternalMessageInfo -func (m *GetTraceRequest) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} -func (m *GetTraceRequest) GetEndTime() time.Time { - if m != nil { - return m.EndTime - } - return time.Time{} -} -func (m *GetTraceRequest) GetRawTraces() bool { - if m != nil { - return m.RawTraces - } - return false -} +type SpansResponseChunk = jaegerIdlModel.SpansResponseChunk + -type SpansResponseChunk struct { - Spans []model.Span `protobuf:"bytes,1,rep,name=spans,proto3" json:"spans"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} -func (m *SpansResponseChunk) Reset() { *m = SpansResponseChunk{} } -func (m *SpansResponseChunk) String() string { return proto.CompactTextString(m) } -func (*SpansResponseChunk) ProtoMessage() {} -func (*SpansResponseChunk) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{1} -} -func (m *SpansResponseChunk) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SpansResponseChunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_SpansResponseChunk.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *SpansResponseChunk) XXX_Merge(src proto.Message) { - xxx_messageInfo_SpansResponseChunk.Merge(m, src) -} -func (m *SpansResponseChunk) XXX_Size() int { - return m.Size() -} -func (m *SpansResponseChunk) XXX_DiscardUnknown() { - xxx_messageInfo_SpansResponseChunk.DiscardUnknown(m) -} var xxx_messageInfo_SpansResponseChunk proto.InternalMessageInfo -func (m *SpansResponseChunk) GetSpans() []model.Span { - if m != nil { - return m.Spans - } - return nil -} -type ArchiveTraceRequest struct { - TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` - // Optional. The start time to search trace ID. - StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` - // Optional. The end time to search trace ID. - EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} -func (m *ArchiveTraceRequest) Reset() { *m = ArchiveTraceRequest{} } -func (m *ArchiveTraceRequest) String() string { return proto.CompactTextString(m) } -func (*ArchiveTraceRequest) ProtoMessage() {} -func (*ArchiveTraceRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{2} -} -func (m *ArchiveTraceRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ArchiveTraceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ArchiveTraceRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ArchiveTraceRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_ArchiveTraceRequest.Merge(m, src) -} -func (m *ArchiveTraceRequest) XXX_Size() int { - return m.Size() -} -func (m *ArchiveTraceRequest) XXX_DiscardUnknown() { - xxx_messageInfo_ArchiveTraceRequest.DiscardUnknown(m) -} +type ArchiveTraceRequest = jaegerIdlModel.ArchiveTraceRequest + + var xxx_messageInfo_ArchiveTraceRequest proto.InternalMessageInfo -func (m *ArchiveTraceRequest) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} -func (m *ArchiveTraceRequest) GetEndTime() time.Time { - if m != nil { - return m.EndTime - } - return time.Time{} -} -type ArchiveTraceResponse struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type ArchiveTraceResponse = jaegerIdlModel.ArchiveTraceResponse + + -func (m *ArchiveTraceResponse) Reset() { *m = ArchiveTraceResponse{} } -func (m *ArchiveTraceResponse) String() string { return proto.CompactTextString(m) } -func (*ArchiveTraceResponse) ProtoMessage() {} -func (*ArchiveTraceResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{3} -} -func (m *ArchiveTraceResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ArchiveTraceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ArchiveTraceResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ArchiveTraceResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_ArchiveTraceResponse.Merge(m, src) -} -func (m *ArchiveTraceResponse) XXX_Size() int { - return m.Size() -} -func (m *ArchiveTraceResponse) XXX_DiscardUnknown() { - xxx_messageInfo_ArchiveTraceResponse.DiscardUnknown(m) -} var xxx_messageInfo_ArchiveTraceResponse proto.InternalMessageInfo @@ -259,519 +76,73 @@ var xxx_messageInfo_ArchiveTraceResponse proto.InternalMessageInfo // // Note: some storage implementations do not guarantee the correct implementation of all parameters. // -type TraceQueryParameters struct { - ServiceName string `protobuf:"bytes,1,opt,name=service_name,json=serviceName,proto3" json:"service_name,omitempty"` - OperationName string `protobuf:"bytes,2,opt,name=operation_name,json=operationName,proto3" json:"operation_name,omitempty"` - Tags map[string]string `protobuf:"bytes,3,rep,name=tags,proto3" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StartTimeMin time.Time `protobuf:"bytes,4,opt,name=start_time_min,json=startTimeMin,proto3,stdtime" json:"start_time_min"` - StartTimeMax time.Time `protobuf:"bytes,5,opt,name=start_time_max,json=startTimeMax,proto3,stdtime" json:"start_time_max"` - DurationMin time.Duration `protobuf:"bytes,6,opt,name=duration_min,json=durationMin,proto3,stdduration" json:"duration_min"` - DurationMax time.Duration `protobuf:"bytes,7,opt,name=duration_max,json=durationMax,proto3,stdduration" json:"duration_max"` - SearchDepth int32 `protobuf:"varint,8,opt,name=search_depth,json=searchDepth,proto3" json:"search_depth,omitempty"` - // Optional. If set to true, the response will not include any - // enrichments to the trace, such as clock skew adjustment. - // Instead, the trace will be returned exactly as stored. - RawTraces bool `protobuf:"varint,9,opt,name=raw_traces,json=rawTraces,proto3" json:"raw_traces,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *TraceQueryParameters) Reset() { *m = TraceQueryParameters{} } -func (m *TraceQueryParameters) String() string { return proto.CompactTextString(m) } -func (*TraceQueryParameters) ProtoMessage() {} -func (*TraceQueryParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{4} -} -func (m *TraceQueryParameters) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TraceQueryParameters) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TraceQueryParameters.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *TraceQueryParameters) XXX_Merge(src proto.Message) { - xxx_messageInfo_TraceQueryParameters.Merge(m, src) -} -func (m *TraceQueryParameters) XXX_Size() int { - return m.Size() -} -func (m *TraceQueryParameters) XXX_DiscardUnknown() { - xxx_messageInfo_TraceQueryParameters.DiscardUnknown(m) -} - -var xxx_messageInfo_TraceQueryParameters proto.InternalMessageInfo +type TraceQueryParameters = jaegerIdlModel.TraceQueryParameters -func (m *TraceQueryParameters) GetServiceName() string { - if m != nil { - return m.ServiceName - } - return "" -} -func (m *TraceQueryParameters) GetOperationName() string { - if m != nil { - return m.OperationName - } - return "" -} -func (m *TraceQueryParameters) GetTags() map[string]string { - if m != nil { - return m.Tags - } - return nil -} -func (m *TraceQueryParameters) GetStartTimeMin() time.Time { - if m != nil { - return m.StartTimeMin - } - return time.Time{} -} +var xxx_messageInfo_TraceQueryParameters proto.InternalMessageInfo -func (m *TraceQueryParameters) GetStartTimeMax() time.Time { - if m != nil { - return m.StartTimeMax - } - return time.Time{} -} -func (m *TraceQueryParameters) GetDurationMin() time.Duration { - if m != nil { - return m.DurationMin - } - return 0 -} -func (m *TraceQueryParameters) GetDurationMax() time.Duration { - if m != nil { - return m.DurationMax - } - return 0 -} +type FindTracesRequest = jaegerIdlModel.FindTracesRequest -func (m *TraceQueryParameters) GetSearchDepth() int32 { - if m != nil { - return m.SearchDepth - } - return 0 -} -func (m *TraceQueryParameters) GetRawTraces() bool { - if m != nil { - return m.RawTraces - } - return false -} -type FindTracesRequest struct { - Query *TraceQueryParameters `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +var xxx_messageInfo_FindTracesRequest proto.InternalMessageInfo -func (m *FindTracesRequest) Reset() { *m = FindTracesRequest{} } -func (m *FindTracesRequest) String() string { return proto.CompactTextString(m) } -func (*FindTracesRequest) ProtoMessage() {} -func (*FindTracesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{5} -} -func (m *FindTracesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FindTracesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FindTracesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FindTracesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FindTracesRequest.Merge(m, src) -} -func (m *FindTracesRequest) XXX_Size() int { - return m.Size() -} -func (m *FindTracesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FindTracesRequest.DiscardUnknown(m) -} -var xxx_messageInfo_FindTracesRequest proto.InternalMessageInfo +type GetServicesRequest = jaegerIdlModel.GetServicesRequest -func (m *FindTracesRequest) GetQuery() *TraceQueryParameters { - if m != nil { - return m.Query - } - return nil -} -type GetServicesRequest struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} -func (m *GetServicesRequest) Reset() { *m = GetServicesRequest{} } -func (m *GetServicesRequest) String() string { return proto.CompactTextString(m) } -func (*GetServicesRequest) ProtoMessage() {} -func (*GetServicesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{6} -} -func (m *GetServicesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetServicesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetServicesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetServicesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServicesRequest.Merge(m, src) -} -func (m *GetServicesRequest) XXX_Size() int { - return m.Size() -} -func (m *GetServicesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetServicesRequest.DiscardUnknown(m) -} var xxx_messageInfo_GetServicesRequest proto.InternalMessageInfo -type GetServicesResponse struct { - Services []string `protobuf:"bytes,1,rep,name=services,proto3" json:"services,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type GetServicesResponse = jaegerIdlModel.GetServicesResponse -func (m *GetServicesResponse) Reset() { *m = GetServicesResponse{} } -func (m *GetServicesResponse) String() string { return proto.CompactTextString(m) } -func (*GetServicesResponse) ProtoMessage() {} -func (*GetServicesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{7} -} -func (m *GetServicesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetServicesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetServicesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetServicesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetServicesResponse.Merge(m, src) -} -func (m *GetServicesResponse) XXX_Size() int { - return m.Size() -} -func (m *GetServicesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetServicesResponse.DiscardUnknown(m) -} -var xxx_messageInfo_GetServicesResponse proto.InternalMessageInfo -func (m *GetServicesResponse) GetServices() []string { - if m != nil { - return m.Services - } - return nil -} -type GetOperationsRequest struct { - Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` - SpanKind string `protobuf:"bytes,2,opt,name=span_kind,json=spanKind,proto3" json:"span_kind,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type GetOperationsRequest = jaegerIdlModel.GetOperationsRequest + -func (m *GetOperationsRequest) Reset() { *m = GetOperationsRequest{} } -func (m *GetOperationsRequest) String() string { return proto.CompactTextString(m) } -func (*GetOperationsRequest) ProtoMessage() {} -func (*GetOperationsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{8} -} -func (m *GetOperationsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetOperationsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetOperationsRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetOperationsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetOperationsRequest.Merge(m, src) -} -func (m *GetOperationsRequest) XXX_Size() int { - return m.Size() -} -func (m *GetOperationsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetOperationsRequest.DiscardUnknown(m) -} var xxx_messageInfo_GetOperationsRequest proto.InternalMessageInfo -func (m *GetOperationsRequest) GetService() string { - if m != nil { - return m.Service - } - return "" -} -func (m *GetOperationsRequest) GetSpanKind() string { - if m != nil { - return m.SpanKind - } - return "" -} -type Operation struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - SpanKind string `protobuf:"bytes,2,opt,name=span_kind,json=spanKind,proto3" json:"span_kind,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type Operation = jaegerIdlModel.Operation + -func (m *Operation) Reset() { *m = Operation{} } -func (m *Operation) String() string { return proto.CompactTextString(m) } -func (*Operation) ProtoMessage() {} -func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{9} -} -func (m *Operation) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Operation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Operation.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Operation) XXX_Merge(src proto.Message) { - xxx_messageInfo_Operation.Merge(m, src) -} -func (m *Operation) XXX_Size() int { - return m.Size() -} -func (m *Operation) XXX_DiscardUnknown() { - xxx_messageInfo_Operation.DiscardUnknown(m) -} var xxx_messageInfo_Operation proto.InternalMessageInfo -func (m *Operation) GetName() string { - if m != nil { - return m.Name - } - return "" -} -func (m *Operation) GetSpanKind() string { - if m != nil { - return m.SpanKind - } - return "" -} -type GetOperationsResponse struct { - OperationNames []string `protobuf:"bytes,1,rep,name=operationNames,proto3" json:"operationNames,omitempty"` - Operations []*Operation `protobuf:"bytes,2,rep,name=operations,proto3" json:"operations,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type GetOperationsResponse = jaegerIdlModel.GetOperationsResponse + -func (m *GetOperationsResponse) Reset() { *m = GetOperationsResponse{} } -func (m *GetOperationsResponse) String() string { return proto.CompactTextString(m) } -func (*GetOperationsResponse) ProtoMessage() {} -func (*GetOperationsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{10} -} -func (m *GetOperationsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetOperationsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetOperationsResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetOperationsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetOperationsResponse.Merge(m, src) -} -func (m *GetOperationsResponse) XXX_Size() int { - return m.Size() -} -func (m *GetOperationsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetOperationsResponse.DiscardUnknown(m) -} var xxx_messageInfo_GetOperationsResponse proto.InternalMessageInfo -func (m *GetOperationsResponse) GetOperationNames() []string { - if m != nil { - return m.OperationNames - } - return nil -} -func (m *GetOperationsResponse) GetOperations() []*Operation { - if m != nil { - return m.Operations - } - return nil -} -type GetDependenciesRequest struct { - StartTime time.Time `protobuf:"bytes,1,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` - EndTime time.Time `protobuf:"bytes,2,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type GetDependenciesRequest = jaegerIdlModel.GetDependenciesRequest + -func (m *GetDependenciesRequest) Reset() { *m = GetDependenciesRequest{} } -func (m *GetDependenciesRequest) String() string { return proto.CompactTextString(m) } -func (*GetDependenciesRequest) ProtoMessage() {} -func (*GetDependenciesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{11} -} -func (m *GetDependenciesRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetDependenciesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetDependenciesRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetDependenciesRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDependenciesRequest.Merge(m, src) -} -func (m *GetDependenciesRequest) XXX_Size() int { - return m.Size() -} -func (m *GetDependenciesRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetDependenciesRequest.DiscardUnknown(m) -} var xxx_messageInfo_GetDependenciesRequest proto.InternalMessageInfo -func (m *GetDependenciesRequest) GetStartTime() time.Time { - if m != nil { - return m.StartTime - } - return time.Time{} -} -func (m *GetDependenciesRequest) GetEndTime() time.Time { - if m != nil { - return m.EndTime - } - return time.Time{} -} -type GetDependenciesResponse struct { - Dependencies []model.DependencyLink `protobuf:"bytes,1,rep,name=dependencies,proto3" json:"dependencies"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type GetDependenciesResponse = jaegerIdlModel.GetDependenciesResponse + -func (m *GetDependenciesResponse) Reset() { *m = GetDependenciesResponse{} } -func (m *GetDependenciesResponse) String() string { return proto.CompactTextString(m) } -func (*GetDependenciesResponse) ProtoMessage() {} -func (*GetDependenciesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_5c6ac9b241082464, []int{12} -} -func (m *GetDependenciesResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GetDependenciesResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GetDependenciesResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GetDependenciesResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetDependenciesResponse.Merge(m, src) -} -func (m *GetDependenciesResponse) XXX_Size() int { - return m.Size() -} -func (m *GetDependenciesResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetDependenciesResponse.DiscardUnknown(m) -} var xxx_messageInfo_GetDependenciesResponse proto.InternalMessageInfo -func (m *GetDependenciesResponse) GetDependencies() []model.DependencyLink { - if m != nil { - return m.Dependencies - } - return nil -} + func init() { proto.RegisterType((*GetTraceRequest)(nil), "jaeger.api_v2.GetTraceRequest") @@ -870,14 +241,8 @@ const _ = grpc.SupportPackageIsVersion4 // QueryServiceClient is the client API for QueryService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryServiceClient interface { - GetTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (QueryService_GetTraceClient, error) - ArchiveTrace(ctx context.Context, in *ArchiveTraceRequest, opts ...grpc.CallOption) (*ArchiveTraceResponse, error) - FindTraces(ctx context.Context, in *FindTracesRequest, opts ...grpc.CallOption) (QueryService_FindTracesClient, error) - GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesResponse, error) - GetOperations(ctx context.Context, in *GetOperationsRequest, opts ...grpc.CallOption) (*GetOperationsResponse, error) - GetDependencies(ctx context.Context, in *GetDependenciesRequest, opts ...grpc.CallOption) (*GetDependenciesResponse, error) -} +type QueryServiceClient = jaegerIdlModel.QueryServiceClient + type queryServiceClient struct { cc *grpc.ClientConn @@ -902,10 +267,7 @@ func (c *queryServiceClient) GetTrace(ctx context.Context, in *GetTraceRequest, return x, nil } -type QueryService_GetTraceClient interface { - Recv() (*SpansResponseChunk, error) - grpc.ClientStream -} +type QueryService_GetTraceClient = jaegerIdlModel.QueryService_GetTraceClient type queryServiceGetTraceClient struct { grpc.ClientStream @@ -943,10 +305,7 @@ func (c *queryServiceClient) FindTraces(ctx context.Context, in *FindTracesReque return x, nil } -type QueryService_FindTracesClient interface { - Recv() (*SpansResponseChunk, error) - grpc.ClientStream -} +type QueryService_FindTracesClient = jaegerIdlModel.QueryService_FindTracesClient type queryServiceFindTracesClient struct { grpc.ClientStream @@ -988,37 +347,14 @@ func (c *queryServiceClient) GetDependencies(ctx context.Context, in *GetDepende } // QueryServiceServer is the server API for QueryService service. -type QueryServiceServer interface { - GetTrace(*GetTraceRequest, QueryService_GetTraceServer) error - ArchiveTrace(context.Context, *ArchiveTraceRequest) (*ArchiveTraceResponse, error) - FindTraces(*FindTracesRequest, QueryService_FindTracesServer) error - GetServices(context.Context, *GetServicesRequest) (*GetServicesResponse, error) - GetOperations(context.Context, *GetOperationsRequest) (*GetOperationsResponse, error) - GetDependencies(context.Context, *GetDependenciesRequest) (*GetDependenciesResponse, error) -} +type QueryServiceServer = jaegerIdlModel.QueryServiceServer + // UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServiceServer struct { -} +type UnimplementedQueryServiceServer = jaegerIdlModel.UnimplementedQueryServiceServer + + -func (*UnimplementedQueryServiceServer) GetTrace(req *GetTraceRequest, srv QueryService_GetTraceServer) error { - return status.Errorf(codes.Unimplemented, "method GetTrace not implemented") -} -func (*UnimplementedQueryServiceServer) ArchiveTrace(ctx context.Context, req *ArchiveTraceRequest) (*ArchiveTraceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ArchiveTrace not implemented") -} -func (*UnimplementedQueryServiceServer) FindTraces(req *FindTracesRequest, srv QueryService_FindTracesServer) error { - return status.Errorf(codes.Unimplemented, "method FindTraces not implemented") -} -func (*UnimplementedQueryServiceServer) GetServices(ctx context.Context, req *GetServicesRequest) (*GetServicesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetServices not implemented") -} -func (*UnimplementedQueryServiceServer) GetOperations(ctx context.Context, req *GetOperationsRequest) (*GetOperationsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetOperations not implemented") -} -func (*UnimplementedQueryServiceServer) GetDependencies(ctx context.Context, req *GetDependenciesRequest) (*GetDependenciesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDependencies not implemented") -} func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { s.RegisterService(&_QueryService_serviceDesc, srv) @@ -1032,10 +368,8 @@ func _QueryService_GetTrace_Handler(srv interface{}, stream grpc.ServerStream) e return srv.(QueryServiceServer).GetTrace(m, &queryServiceGetTraceServer{stream}) } -type QueryService_GetTraceServer interface { - Send(*SpansResponseChunk) error - grpc.ServerStream -} +type QueryService_GetTraceServer = jaegerIdlModel.QueryService_GetTraceServer + type queryServiceGetTraceServer struct { grpc.ServerStream @@ -1071,10 +405,7 @@ func _QueryService_FindTraces_Handler(srv interface{}, stream grpc.ServerStream) return srv.(QueryServiceServer).FindTraces(m, &queryServiceFindTracesServer{stream}) } -type QueryService_FindTracesServer interface { - Send(*SpansResponseChunk) error - grpc.ServerStream -} +type QueryService_FindTracesServer = jaegerIdlModel.QueryService_FindTracesServer type queryServiceFindTracesServer struct { grpc.ServerStream @@ -1174,2526 +505,28 @@ var _QueryService_serviceDesc = grpc.ServiceDesc{ Metadata: "query.proto", } -func (m *GetTraceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetTraceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *GetTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RawTraces { - i-- - if m.RawTraces { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x20 - } - n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err1 != nil { - return 0, err1 - } - i -= n1 - i = encodeVarintQuery(dAtA, i, uint64(n1)) - i-- - dAtA[i] = 0x1a - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintQuery(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x12 - { - size := m.TraceID.Size() - i -= size - if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} -func (m *SpansResponseChunk) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil -} - -func (m *SpansResponseChunk) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA[offset] = uint8(v) + return base } -func (m *SpansResponseChunk) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Spans) > 0 { - for iNdEx := len(m.Spans) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Spans[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} -func (m *ArchiveTraceRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 } - -func (m *ArchiveTraceRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *ArchiveTraceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err3 != nil { - return 0, err3 - } - i -= n3 - i = encodeVarintQuery(dAtA, i, uint64(n3)) - i-- - dAtA[i] = 0x1a - n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err4 != nil { - return 0, err4 - } - i -= n4 - i = encodeVarintQuery(dAtA, i, uint64(n4)) - i-- - dAtA[i] = 0x12 - { - size := m.TraceID.Size() - i -= size - if _, err := m.TraceID.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ArchiveTraceResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ArchiveTraceResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ArchiveTraceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *TraceQueryParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *TraceQueryParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TraceQueryParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.RawTraces { - i-- - if m.RawTraces { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - } - if m.SearchDepth != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.SearchDepth)) - i-- - dAtA[i] = 0x40 - } - n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintQuery(dAtA, i, uint64(n5)) - i-- - dAtA[i] = 0x3a - n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.DurationMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintQuery(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x32 - n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMax, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax):]) - if err7 != nil { - return 0, err7 - } - i -= n7 - i = encodeVarintQuery(dAtA, i, uint64(n7)) - i-- - dAtA[i] = 0x2a - n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTimeMin, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin):]) - if err8 != nil { - return 0, err8 - } - i -= n8 - i = encodeVarintQuery(dAtA, i, uint64(n8)) - i-- - dAtA[i] = 0x22 - if len(m.Tags) > 0 { - for k := range m.Tags { - v := m.Tags[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintQuery(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintQuery(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintQuery(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0x1a - } - } - if len(m.OperationName) > 0 { - i -= len(m.OperationName) - copy(dAtA[i:], m.OperationName) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationName))) - i-- - dAtA[i] = 0x12 - } - if len(m.ServiceName) > 0 { - i -= len(m.ServiceName) - copy(dAtA[i:], m.ServiceName) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ServiceName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FindTracesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FindTracesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FindTracesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.Query != nil { - { - size, err := m.Query.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetServicesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetServicesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetServicesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - return len(dAtA) - i, nil -} - -func (m *GetServicesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetServicesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetServicesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Services) > 0 { - for iNdEx := len(m.Services) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Services[iNdEx]) - copy(dAtA[i:], m.Services[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Services[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GetOperationsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetOperationsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetOperationsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.SpanKind) > 0 { - i -= len(m.SpanKind) - copy(dAtA[i:], m.SpanKind) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SpanKind))) - i-- - dAtA[i] = 0x12 - } - if len(m.Service) > 0 { - i -= len(m.Service) - copy(dAtA[i:], m.Service) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Service))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *Operation) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Operation) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Operation) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.SpanKind) > 0 { - i -= len(m.SpanKind) - copy(dAtA[i:], m.SpanKind) - i = encodeVarintQuery(dAtA, i, uint64(len(m.SpanKind))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *GetOperationsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetOperationsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetOperationsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Operations) > 0 { - for iNdEx := len(m.Operations) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Operations[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if len(m.OperationNames) > 0 { - for iNdEx := len(m.OperationNames) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.OperationNames[iNdEx]) - copy(dAtA[i:], m.OperationNames[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.OperationNames[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *GetDependenciesRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetDependenciesRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetDependenciesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime):]) - if err10 != nil { - return 0, err10 - } - i -= n10 - i = encodeVarintQuery(dAtA, i, uint64(n10)) - i-- - dAtA[i] = 0x12 - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) - if err11 != nil { - return 0, err11 - } - i -= n11 - i = encodeVarintQuery(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *GetDependenciesResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GetDependenciesResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GetDependenciesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.Dependencies) > 0 { - for iNdEx := len(m.Dependencies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Dependencies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GetTraceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TraceID.Size() - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovQuery(uint64(l)) - if m.RawTraces { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SpansResponseChunk) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Spans) > 0 { - for _, e := range m.Spans { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ArchiveTraceRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.TraceID.Size() - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovQuery(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *ArchiveTraceResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *TraceQueryParameters) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ServiceName) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.OperationName) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if len(m.Tags) > 0 { - for k, v := range m.Tags { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovQuery(uint64(len(k))) + 1 + len(v) + sovQuery(uint64(len(v))) - n += mapEntrySize + 1 + sovQuery(uint64(mapEntrySize)) - } - } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMin) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTimeMax) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMin) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.DurationMax) - n += 1 + l + sovQuery(uint64(l)) - if m.SearchDepth != 0 { - n += 1 + sovQuery(uint64(m.SearchDepth)) - } - if m.RawTraces { - n += 2 - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *FindTracesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Query != nil { - l = m.Query.Size() - n += 1 + l + sovQuery(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetServicesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetServicesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Services) > 0 { - for _, s := range m.Services { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetOperationsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Service) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SpanKind) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *Operation) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.SpanKind) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetOperationsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.OperationNames) > 0 { - for _, s := range m.OperationNames { - l = len(s) - n += 1 + l + sovQuery(uint64(l)) - } - } - if len(m.Operations) > 0 { - for _, e := range m.Operations { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetDependenciesRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) - n += 1 + l + sovQuery(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTime) - n += 1 + l + sovQuery(uint64(l)) - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *GetDependenciesResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Dependencies) > 0 { - for _, e := range m.Dependencies { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GetTraceRequest) 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 ErrIntOverflowQuery - } - 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: GetTraceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetTraceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TraceID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RawTraces", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RawTraces = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SpansResponseChunk) 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 ErrIntOverflowQuery - } - 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: SpansResponseChunk: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SpansResponseChunk: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Spans", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Spans = append(m.Spans, model.Span{}) - if err := m.Spans[len(m.Spans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ArchiveTraceRequest) 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 ErrIntOverflowQuery - } - 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: ArchiveTraceRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ArchiveTraceRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TraceID", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.TraceID.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ArchiveTraceResponse) 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 ErrIntOverflowQuery - } - 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: ArchiveTraceResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ArchiveTraceResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *TraceQueryParameters) 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 ErrIntOverflowQuery - } - 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: TraceQueryParameters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TraceQueryParameters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperationName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperationName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tags", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Tags == nil { - m.Tags = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthQuery - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthQuery - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.Tags[mapkey] = mapvalue - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeMin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTimeMin, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTimeMax", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTimeMax, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationMin", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DurationMin, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 7: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DurationMax", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.DurationMax, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SearchDepth", wireType) - } - m.SearchDepth = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.SearchDepth |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RawTraces", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.RawTraces = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FindTracesRequest) 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 ErrIntOverflowQuery - } - 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: FindTracesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FindTracesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Query == nil { - m.Query = &TraceQueryParameters{} - } - if err := m.Query.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetServicesRequest) 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 ErrIntOverflowQuery - } - 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: GetServicesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetServicesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetServicesResponse) 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 ErrIntOverflowQuery - } - 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: GetServicesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetServicesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Services", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Services = append(m.Services, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetOperationsRequest) 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 ErrIntOverflowQuery - } - 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: GetOperationsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetOperationsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Service = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpanKind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpanKind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Operation) 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 ErrIntOverflowQuery - } - 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: Operation: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Operation: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpanKind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpanKind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetOperationsResponse) 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 ErrIntOverflowQuery - } - 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: GetOperationsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetOperationsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperationNames", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.OperationNames = append(m.OperationNames, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operations", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operations = append(m.Operations, &Operation{}) - if err := m.Operations[len(m.Operations)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetDependenciesRequest) 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 ErrIntOverflowQuery - } - 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: GetDependenciesRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetDependenciesRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field StartTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EndTime", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *GetDependenciesResponse) 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 ErrIntOverflowQuery - } - 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: GetDependenciesResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GetDependenciesResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Dependencies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Dependencies = append(m.Dependencies, model.DependencyLink{}) - if err := m.Dependencies[len(m.Dependencies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.pb.go index f2d01ad2e80..97d8e52e263 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.pb.go @@ -5,17 +5,15 @@ package api_v2 import ( 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" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" io "io" math "math" math_bits "math/bits" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) // Reference imports to suppress errors if they are not otherwise used. @@ -30,7 +28,7 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // See description of the SamplingStrategyResponse.strategyType field. -type SamplingStrategyType int32 +type SamplingStrategyType = jaegerIdlModel.SamplingStrategyType const ( SamplingStrategyType_PROBABILISTIC SamplingStrategyType = 0 @@ -47,389 +45,61 @@ var SamplingStrategyType_value = map[string]int32{ "RATE_LIMITING": 1, } -func (x SamplingStrategyType) String() string { - return proto.EnumName(SamplingStrategyType_name, int32(x)) -} -func (SamplingStrategyType) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_79c798842d009798, []int{0} -} // ProbabilisticSamplingStrategy samples traces with a fixed probability. -type ProbabilisticSamplingStrategy struct { - // samplingRate is the sampling probability in the range [0.0, 1.0]. - SamplingRate float64 `protobuf:"fixed64,1,opt,name=samplingRate,proto3" json:"samplingRate,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type ProbabilisticSamplingStrategy = jaegerIdlModel.ProbabilisticSamplingStrategy + -func (m *ProbabilisticSamplingStrategy) Reset() { *m = ProbabilisticSamplingStrategy{} } -func (m *ProbabilisticSamplingStrategy) String() string { return proto.CompactTextString(m) } -func (*ProbabilisticSamplingStrategy) ProtoMessage() {} -func (*ProbabilisticSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_79c798842d009798, []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.MarshalToSizedBuffer(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 - } - return 0 -} // RateLimitingSamplingStrategy samples a fixed number of traces per time interval. // The typical implementations use the leaky bucket algorithm. -type RateLimitingSamplingStrategy struct { - // TODO this field type should be changed to double, to support rates like 1 per minute. - MaxTracesPerSecond int32 `protobuf:"varint,1,opt,name=maxTracesPerSecond,proto3" json:"maxTracesPerSecond,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type RateLimitingSamplingStrategy = jaegerIdlModel.RateLimitingSamplingStrategy + -func (m *RateLimitingSamplingStrategy) Reset() { *m = RateLimitingSamplingStrategy{} } -func (m *RateLimitingSamplingStrategy) String() string { return proto.CompactTextString(m) } -func (*RateLimitingSamplingStrategy) ProtoMessage() {} -func (*RateLimitingSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_79c798842d009798, []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.MarshalToSizedBuffer(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 - } - return 0 -} // OperationSamplingStrategy is a sampling strategy for a given operation // (aka endpoint, span name). Only probabilistic sampling is currently supported. -type OperationSamplingStrategy struct { - Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,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:"-"` -} +type OperationSamplingStrategy = jaegerIdlModel.OperationSamplingStrategy + -func (m *OperationSamplingStrategy) Reset() { *m = OperationSamplingStrategy{} } -func (m *OperationSamplingStrategy) String() string { return proto.CompactTextString(m) } -func (*OperationSamplingStrategy) ProtoMessage() {} -func (*OperationSamplingStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_79c798842d009798, []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.MarshalToSizedBuffer(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 - } - return "" -} -func (m *OperationSamplingStrategy) GetProbabilisticSampling() *ProbabilisticSamplingStrategy { - if m != nil { - return m.ProbabilisticSampling - } - return nil -} // PerOperationSamplingStrategies is a combination of strategies for different endpoints // as well as some service-wide defaults. It is particularly useful for services whose // endpoints receive vastly different traffic, so that any single rate of sampling would // result in either too much data for some endpoints or almost no data for other endpoints. -type PerOperationSamplingStrategies struct { - // defaultSamplingProbability is the sampling probability for spans that do not match - // any of the perOperationStrategies. - DefaultSamplingProbability float64 `protobuf:"fixed64,1,opt,name=defaultSamplingProbability,proto3" json:"defaultSamplingProbability,omitempty"` - // defaultLowerBoundTracesPerSecond defines a lower-bound rate limit used to ensure that - // there is some minimal amount of traces sampled for an endpoint that might otherwise - // be never sampled via probabilistic strategies. The limit is local to a service instance, - // so if a service is deployed with many (N) instances, the effective minimum rate of sampling - // will be N times higher. This setting applies to ALL operations, whether or not they match - // one of the perOperationStrategies. - DefaultLowerBoundTracesPerSecond float64 `protobuf:"fixed64,2,opt,name=defaultLowerBoundTracesPerSecond,proto3" json:"defaultLowerBoundTracesPerSecond,omitempty"` - // perOperationStrategies describes sampling strategiesf for individual operations within - // a given service. - PerOperationStrategies []*OperationSamplingStrategy `protobuf:"bytes,3,rep,name=perOperationStrategies,proto3" json:"perOperationStrategies,omitempty"` - // defaultUpperBoundTracesPerSecond defines an upper bound rate limit. - // However, almost no Jaeger SDKs support this parameter. - 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 fileDescriptor_79c798842d009798, []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.MarshalToSizedBuffer(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 - } - return 0 -} +type PerOperationSamplingStrategies = jaegerIdlModel.PerOperationSamplingStrategies -func (m *PerOperationSamplingStrategies) GetDefaultLowerBoundTracesPerSecond() float64 { - if m != nil { - return m.DefaultLowerBoundTracesPerSecond - } - return 0 -} -func (m *PerOperationSamplingStrategies) GetPerOperationStrategies() []*OperationSamplingStrategy { - if m != nil { - return m.PerOperationStrategies - } - return nil -} -func (m *PerOperationSamplingStrategies) GetDefaultUpperBoundTracesPerSecond() float64 { - if m != nil { - return m.DefaultUpperBoundTracesPerSecond - } - return 0 -} // SamplingStrategyResponse contains an overall sampling strategy for a given service. -// This type should be treated as a union where only one of the strategy field is present. -type SamplingStrategyResponse struct { - // Legacy field that was meant to indicate which one of the strategy fields - // below is present. This enum was not extended when per-operation strategy - // was introduced, because extending enum has backwards compatiblity issues. - // The recommended approach for consumers is to ignore this field and instead - // checks the other fields being not null (starting with operationSampling). - // For producers, it is recommended to set this field correctly for probabilistic - // and rate-limiting strategies, but if per-operation strategy is returned, - // the enum can be set to 0 (probabilistic). - 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,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_79c798842d009798, []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.MarshalToSizedBuffer(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) -} - -var xxx_messageInfo_SamplingStrategyResponse proto.InternalMessageInfo - -func (m *SamplingStrategyResponse) GetStrategyType() SamplingStrategyType { - if m != nil { - return m.StrategyType - } - return SamplingStrategyType_PROBABILISTIC -} - -func (m *SamplingStrategyResponse) GetProbabilisticSampling() *ProbabilisticSamplingStrategy { - if m != nil { - return m.ProbabilisticSampling - } - return nil -} +// This type should = jaegerIdlModel.should as a union where only one of the strategy field is present. +type SamplingStrategyResponse = jaegerIdlModel.SamplingStrategyResponse -func (m *SamplingStrategyResponse) GetRateLimitingSampling() *RateLimitingSamplingStrategy { - if m != nil { - return m.RateLimitingSampling - } - return nil -} -func (m *SamplingStrategyResponse) GetOperationSampling() *PerOperationSamplingStrategies { - if m != nil { - return m.OperationSampling - } - return nil -} // SamplingStrategyParameters defines request parameters for remote sampler. -type SamplingStrategyParameters struct { - // serviceName is a required argument. - ServiceName string `protobuf:"bytes,1,opt,name=serviceName,proto3" json:"serviceName,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} +type SamplingStrategyParameters = jaegerIdlModel.SamplingStrategyParameters + -func (m *SamplingStrategyParameters) Reset() { *m = SamplingStrategyParameters{} } -func (m *SamplingStrategyParameters) String() string { return proto.CompactTextString(m) } -func (*SamplingStrategyParameters) ProtoMessage() {} -func (*SamplingStrategyParameters) Descriptor() ([]byte, []int) { - return fileDescriptor_79c798842d009798, []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.MarshalToSizedBuffer(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 { - return m.ServiceName - } - return "" -} + func init() { - proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) + //proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) proto.RegisterType((*ProbabilisticSamplingStrategy)(nil), "jaeger.api_v2.ProbabilisticSamplingStrategy") proto.RegisterType((*RateLimitingSamplingStrategy)(nil), "jaeger.api_v2.RateLimitingSamplingStrategy") proto.RegisterType((*OperationSamplingStrategy)(nil), "jaeger.api_v2.OperationSamplingStrategy") @@ -491,14 +161,14 @@ const _ = grpc.SupportPackageIsVersion4 // 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) -} +type SamplingManagerClient = jaegerIdlModel.SamplingManagerClient + type samplingManagerClient struct { cc *grpc.ClientConn } + func NewSamplingManagerClient(cc *grpc.ClientConn) SamplingManagerClient { return &samplingManagerClient{cc} } @@ -513,17 +183,13 @@ func (c *samplingManagerClient) GetSamplingStrategy(ctx context.Context, in *Sam } // SamplingManagerServer is the server API for SamplingManager service. -type SamplingManagerServer interface { - GetSamplingStrategy(context.Context, *SamplingStrategyParameters) (*SamplingStrategyResponse, error) -} +type SamplingManagerServer = jaegerIdlModel.SamplingManagerServer // UnimplementedSamplingManagerServer can be embedded to have forward compatible implementations. -type UnimplementedSamplingManagerServer struct { -} +type UnimplementedSamplingManagerServer = jaegerIdlModel.UnimplementedSamplingManagerServer + + -func (*UnimplementedSamplingManagerServer) GetSamplingStrategy(ctx context.Context, req *SamplingStrategyParameters) (*SamplingStrategyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSamplingStrategy not implemented") -} func RegisterSamplingManagerServer(s *grpc.Server, srv SamplingManagerServer) { s.RegisterService(&_SamplingManager_serviceDesc, srv) @@ -560,277 +226,7 @@ var _SamplingManager_serviceDesc = grpc.ServiceDesc{ Metadata: "sampling.proto", } -func (m *ProbabilisticSamplingStrategy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ProbabilisticSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ProbabilisticSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.SamplingRate != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.SamplingRate)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *RateLimitingSamplingStrategy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *RateLimitingSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RateLimitingSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.MaxTracesPerSecond != 0 { - i = encodeVarintSampling(dAtA, i, uint64(m.MaxTracesPerSecond)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *OperationSamplingStrategy) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *OperationSamplingStrategy) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *OperationSamplingStrategy) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.ProbabilisticSampling != nil { - { - size, err := m.ProbabilisticSampling.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSampling(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Operation) > 0 { - i -= len(m.Operation) - copy(dAtA[i:], m.Operation) - i = encodeVarintSampling(dAtA, i, uint64(len(m.Operation))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *PerOperationSamplingStrategies) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *PerOperationSamplingStrategies) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *PerOperationSamplingStrategies) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.DefaultUpperBoundTracesPerSecond != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultUpperBoundTracesPerSecond)))) - i-- - dAtA[i] = 0x21 - } - if len(m.PerOperationStrategies) > 0 { - for iNdEx := len(m.PerOperationStrategies) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PerOperationStrategies[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSampling(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if m.DefaultLowerBoundTracesPerSecond != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultLowerBoundTracesPerSecond)))) - i-- - dAtA[i] = 0x11 - } - if m.DefaultSamplingProbability != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.DefaultSamplingProbability)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *SamplingStrategyResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SamplingStrategyResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SamplingStrategyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if m.OperationSampling != nil { - { - size, err := m.OperationSampling.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSampling(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - if m.RateLimitingSampling != nil { - { - size, err := m.RateLimitingSampling.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSampling(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if m.ProbabilisticSampling != nil { - { - size, err := m.ProbabilisticSampling.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintSampling(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.StrategyType != 0 { - i = encodeVarintSampling(dAtA, i, uint64(m.StrategyType)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *SamplingStrategyParameters) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SamplingStrategyParameters) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} -func (m *SamplingStrategyParameters) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.XXX_unrecognized != nil { - i -= len(m.XXX_unrecognized) - copy(dAtA[i:], m.XXX_unrecognized) - } - if len(m.ServiceName) > 0 { - i -= len(m.ServiceName) - copy(dAtA[i:], m.ServiceName) - i = encodeVarintSampling(dAtA, i, uint64(len(m.ServiceName))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { offset -= sovSampling(v) @@ -843,125 +239,7 @@ func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -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) - if l > 0 { - n += 1 + l + sovSampling(uint64(l)) - } - if m.ProbabilisticSampling != nil { - 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 { - n += 9 - } - if m.DefaultLowerBoundTracesPerSecond != 0 { - n += 9 - } - if len(m.PerOperationStrategies) > 0 { - for _, e := range m.PerOperationStrategies { - l = e.Size() - n += 1 + l + sovSampling(uint64(l)) - } - } - 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 { - n += 1 + sovSampling(uint64(m.StrategyType)) - } - if m.ProbabilisticSampling != nil { - l = m.ProbabilisticSampling.Size() - n += 1 + l + sovSampling(uint64(l)) - } - if m.RateLimitingSampling != nil { - l = m.RateLimitingSampling.Size() - n += 1 + l + sovSampling(uint64(l)) - } - if m.OperationSampling != nil { - 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 -} func sovSampling(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 @@ -969,636 +247,7 @@ func sovSampling(x uint64) (n int) { 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) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - 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: ProbabilisticSamplingStrategy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ProbabilisticSamplingStrategy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field SamplingRate", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.SamplingRate = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipSampling(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *RateLimitingSamplingStrategy) 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 ErrIntOverflowSampling - } - 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: RateLimitingSamplingStrategy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RateLimitingSamplingStrategy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxTracesPerSecond", wireType) - } - m.MaxTracesPerSecond = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxTracesPerSecond |= int32(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipSampling(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *OperationSamplingStrategy) 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 ErrIntOverflowSampling - } - 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: OperationSamplingStrategy: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: OperationSamplingStrategy: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operation = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProbabilisticSampling", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ProbabilisticSampling == nil { - m.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} - } - if err := m.ProbabilisticSampling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSampling(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *PerOperationSamplingStrategies) 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 ErrIntOverflowSampling - } - 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: PerOperationSamplingStrategies: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: PerOperationSamplingStrategies: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultSamplingProbability", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.DefaultSamplingProbability = float64(math.Float64frombits(v)) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultLowerBoundTracesPerSecond", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.DefaultLowerBoundTracesPerSecond = float64(math.Float64frombits(v)) - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PerOperationStrategies", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PerOperationStrategies = append(m.PerOperationStrategies, &OperationSamplingStrategy{}) - if err := m.PerOperationStrategies[len(m.PerOperationStrategies)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field DefaultUpperBoundTracesPerSecond", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.DefaultUpperBoundTracesPerSecond = float64(math.Float64frombits(v)) - default: - iNdEx = preIndex - skippy, err := skipSampling(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SamplingStrategyResponse) 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 ErrIntOverflowSampling - } - 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: SamplingStrategyResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SamplingStrategyResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field StrategyType", wireType) - } - m.StrategyType = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.StrategyType |= SamplingStrategyType(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ProbabilisticSampling", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ProbabilisticSampling == nil { - m.ProbabilisticSampling = &ProbabilisticSamplingStrategy{} - } - if err := m.ProbabilisticSampling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RateLimitingSampling", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.RateLimitingSampling == nil { - m.RateLimitingSampling = &RateLimitingSamplingStrategy{} - } - if err := m.RateLimitingSampling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field OperationSampling", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.OperationSampling == nil { - m.OperationSampling = &PerOperationSamplingStrategies{} - } - if err := m.OperationSampling.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSampling(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *SamplingStrategyParameters) 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 ErrIntOverflowSampling - } - 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: SamplingStrategyParameters: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SamplingStrategyParameters: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ServiceName", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowSampling - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthSampling - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthSampling - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ServiceName = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipSampling(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthSampling - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func skipSampling(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 From fe5e350162df12b4bdca9404b30c90df7c4da3bd Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 00:52:02 +0200 Subject: [PATCH 02/11] fix: fmt Signed-off-by: nabil salah --- model/ids.go | 1 - 1 file changed, 1 deletion(-) diff --git a/model/ids.go b/model/ids.go index eeef8cf4613..10d2c5f88e7 100644 --- a/model/ids.go +++ b/model/ids.go @@ -71,7 +71,6 @@ func TraceIDFromBytes(data []byte) (TraceID, error) { return t, nil } - // ------- SpanID ------- // NewSpanID creates a new SpanID from a 64bit unsigned int. From e7e491d78e1b0e0921fc24c1630873bf83f0742d Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 01:35:49 +0200 Subject: [PATCH 03/11] enhance:alias constants and top-level functions Signed-off-by: nabil salah --- model/flags.go | 6 +- model/hash.go | 8 +- model/ids.go | 57 +-------- model/keyvalue.go | 38 +++--- model/{model.pb.go => model.go} | 116 +++++------------- model/process.go | 8 +- model/sort.go | 82 +------------ model/span.go | 2 +- model/spanref.go | 38 ++---- model/time.go | 16 +-- .../api_v2/{collector.pb.go => collector.go} | 10 +- proto-gen/api_v2/{query.pb.go => query.go} | 8 +- .../api_v2/{sampling.pb.go => sampling.go} | 20 ++- 13 files changed, 96 insertions(+), 313 deletions(-) rename model/{model.pb.go => model.go} (89%) rename proto-gen/api_v2/{collector.pb.go => collector.go} (95%) rename proto-gen/api_v2/{query.pb.go => query.go} (98%) rename proto-gen/api_v2/{sampling.pb.go => sampling.go} (95%) diff --git a/model/flags.go b/model/flags.go index e3d6721586c..a12b8b42a0a 100644 --- a/model/flags.go +++ b/model/flags.go @@ -10,11 +10,11 @@ import ( const ( // SampledFlag is the bit set in Flags in order to define a span as a sampled span - SampledFlag = Flags(1) + SampledFlag = jaegerIdlModel.SampledFlag // DebugFlag is the bit set in Flags in order to define a span as a debug span - DebugFlag = Flags(2) + DebugFlag = jaegerIdlModel.SampledFlag // FirehoseFlag is the bit in Flags in order to define a span as a firehose span - FirehoseFlag = Flags(8) + FirehoseFlag = jaegerIdlModel.SampledFlag ) // Flags is a bit map of flags for a span diff --git a/model/hash.go b/model/hash.go index 733d60b9833..dc87ab73244 100644 --- a/model/hash.go +++ b/model/hash.go @@ -5,8 +5,6 @@ package model import ( - "hash/fnv" - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) @@ -16,9 +14,5 @@ type Hashable = jaegerIdlModel.Hashable // HashCode calculates a FNV-1a hash code for a Hashable object. func HashCode(o Hashable) (uint64, error) { - h := fnv.New64a() - if err := o.Hash(h); err != nil { - return 0, err - } - return h.Sum64(), nil + return jaegerIdlModel.HashCode(o) } diff --git a/model/ids.go b/model/ids.go index 10d2c5f88e7..8eddfa2eb58 100644 --- a/model/ids.go +++ b/model/ids.go @@ -5,19 +5,12 @@ package model import ( - "encoding/binary" - "errors" - "fmt" - "strconv" - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) const ( // traceIDShortBytesLen indicates length of 64bit traceID when represented as list of bytes traceIDShortBytesLen = 8 - // traceIDLongBytesLen indicates length of 128bit traceID when represented as list of bytes - traceIDLongBytesLen = 16 ) // TraceID is a random 128bit identifier for a trace @@ -30,70 +23,32 @@ type SpanID = jaegerIdlModel.SpanID // NewTraceID creates a new TraceID from two 64bit unsigned ints. func NewTraceID(high, low uint64) TraceID { - return TraceID{High: high, Low: low} + return jaegerIdlModel.NewTraceID(high, low) } // TraceIDFromString creates a TraceID from a hexadecimal string func TraceIDFromString(s string) (TraceID, error) { - var hi, lo uint64 - var err error - switch { - case len(s) > 32: - return TraceID{}, fmt.Errorf("TraceID cannot be longer than 32 hex characters: %s", s) - case len(s) > 16: - hiLen := len(s) - 16 - if hi, err = strconv.ParseUint(s[0:hiLen], 16, 64); err != nil { - return TraceID{}, err - } - if lo, err = strconv.ParseUint(s[hiLen:], 16, 64); err != nil { - return TraceID{}, err - } - default: - if lo, err = strconv.ParseUint(s, 16, 64); err != nil { - return TraceID{}, err - } - } - return TraceID{High: hi, Low: lo}, nil + return jaegerIdlModel.TraceIDFromString(s) } // TraceIDFromBytes creates a TraceID from list of bytes func TraceIDFromBytes(data []byte) (TraceID, error) { - var t TraceID - switch { - case len(data) == traceIDLongBytesLen: - t.High = binary.BigEndian.Uint64(data[:traceIDShortBytesLen]) - t.Low = binary.BigEndian.Uint64(data[traceIDShortBytesLen:]) - case len(data) == traceIDShortBytesLen: - t.Low = binary.BigEndian.Uint64(data) - default: - return TraceID{}, errors.New("invalid length for TraceID") - } - return t, nil + return jaegerIdlModel.TraceIDFromBytes(data) } // ------- SpanID ------- // NewSpanID creates a new SpanID from a 64bit unsigned int. func NewSpanID(v uint64) SpanID { - return SpanID(v) + return jaegerIdlModel.NewSpanID(v) } // SpanIDFromString creates a SpanID from a hexadecimal string func SpanIDFromString(s string) (SpanID, error) { - if len(s) > 16 { - return SpanID(0), fmt.Errorf("SpanID cannot be longer than 16 hex characters: %s", s) - } - id, err := strconv.ParseUint(s, 16, 64) - if err != nil { - return SpanID(0), err - } - return SpanID(id), nil + return jaegerIdlModel.SpanIDFromString(s) } // SpanIDFromBytes creates a SpandID from list of bytes func SpanIDFromBytes(data []byte) (SpanID, error) { - if len(data) != traceIDShortBytesLen { - return SpanID(0), errors.New("invalid length for SpanID") - } - return NewSpanID(binary.BigEndian.Uint64(data)), nil + return jaegerIdlModel.SpanIDFromBytes(data) } diff --git a/model/keyvalue.go b/model/keyvalue.go index b017418ba7b..2d4c7db3e5f 100644 --- a/model/keyvalue.go +++ b/model/keyvalue.go @@ -5,8 +5,6 @@ package model import ( - "fmt" - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) @@ -23,29 +21,23 @@ const ( // BinaryType indicates the value is binary blob stored as a byte array BinaryType = ValueType_BINARY - SpanKindKey = "span.kind" - SamplerTypeKey = "sampler.type" - SamplerParamKey = "sampler.param" + SpanKindKey = jaegerIdlModel.SpanKindKey + SamplerTypeKey = jaegerIdlModel.SamplerTypeKey + SamplerParamKey = jaegerIdlModel.SamplerParamKey ) type SpanKind = jaegerIdlModel.SpanKind const ( - SpanKindClient SpanKind = "client" - SpanKindServer SpanKind = "server" - SpanKindProducer SpanKind = "producer" - SpanKindConsumer SpanKind = "consumer" - SpanKindInternal SpanKind = "internal" - SpanKindUnspecified SpanKind = "" + SpanKindClient SpanKind = jaegerIdlModel.SpanKindClient + SpanKindServer SpanKind = jaegerIdlModel.SpanKindServer + SpanKindProducer SpanKind = jaegerIdlModel.SpanKindProducer + SpanKindConsumer SpanKind = jaegerIdlModel.SpanKindConsumer + SpanKindInternal SpanKind = jaegerIdlModel.SpanKindInternal + SpanKindUnspecified SpanKind =jaegerIdlModel.SpanKindUnspecified ) - func SpanKindFromString(kind string) (SpanKind, error) { - switch SpanKind(kind) { - case SpanKindClient, SpanKindServer, SpanKindProducer, SpanKindConsumer, SpanKindInternal, SpanKindUnspecified: - return SpanKind(kind), nil - default: - return SpanKindUnspecified, fmt.Errorf("unknown span kind %q", kind) - } + return jaegerIdlModel.SpanKindFromString(kind) } // KeyValues is a type alias that exposes convenience functions like Sort, FindByKey. @@ -53,25 +45,25 @@ type KeyValues = jaegerIdlModel.KeyValues // String creates a String-typed KeyValue func String(key string, value string) KeyValue { - return KeyValue{Key: key, VType: StringType, VStr: value} + return jaegerIdlModel.String(key, value) } // Bool creates a Bool-typed KeyValue func Bool(key string, value bool) KeyValue { - return KeyValue{Key: key, VType: BoolType, VBool: value} + return jaegerIdlModel.Bool(key, value) } // Int64 creates a Int64-typed KeyValue func Int64(key string, value int64) KeyValue { - return KeyValue{Key: key, VType: Int64Type, VInt64: value} + return jaegerIdlModel.Int64(key, value) } // Float64 creates a Float64-typed KeyValue func Float64(key string, value float64) KeyValue { - return KeyValue{Key: key, VType: Float64Type, VFloat64: value} + return jaegerIdlModel.Float64(key, value) } // Binary creates a Binary-typed KeyValue func Binary(key string, value []byte) KeyValue { - return KeyValue{Key: key, VType: BinaryType, VBinary: value} + return jaegerIdlModel.Binary(key, value) } diff --git a/model/model.pb.go b/model/model.go similarity index 89% rename from model/model.pb.go rename to model/model.go index 71aabd62425..3b1334cc6d8 100644 --- a/model/model.pb.go +++ b/model/model.go @@ -1,26 +1,32 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. + +// Copyright (c) 2025 The Jaeger Authors. +// SPDX-License-Identifier: Apache-2.0 + // source: model.proto package model import ( - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" io "io" math "math" math_bits "math/bits" time "time" + + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) // Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen +var ( + _ = proto.Marshal + _ = fmt.Errorf + _ = math.Inf + _ = time.Kitchen +) // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -31,104 +37,56 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ValueType = jaegerIdlModel.ValueType const ( - ValueType_STRING ValueType = 0 - ValueType_BOOL ValueType = 1 - ValueType_INT64 ValueType = 2 - ValueType_FLOAT64 ValueType = 3 - ValueType_BINARY ValueType = 4 + ValueType_STRING ValueType = jaegerIdlModel.ValueType_STRING + ValueType_BOOL ValueType = jaegerIdlModel.ValueType_BOOL + ValueType_INT64 ValueType = jaegerIdlModel.ValueType_INT64 + ValueType_FLOAT64 ValueType = jaegerIdlModel.ValueType_FLOAT64 + ValueType_BINARY ValueType = jaegerIdlModel.ValueType_BINARY ) -var ValueType_name = map[int32]string{ - 0: "STRING", - 1: "BOOL", - 2: "INT64", - 3: "FLOAT64", - 4: "BINARY", -} - -var ValueType_value = map[string]int32{ - "STRING": 0, - "BOOL": 1, - "INT64": 2, - "FLOAT64": 3, - "BINARY": 4, -} +var ValueType_name = jaegerIdlModel.ValueType_name +var ValueType_value = jaegerIdlModel.ValueType_value type SpanRefType = jaegerIdlModel.SpanRefType const ( - SpanRefType_CHILD_OF SpanRefType = 0 - SpanRefType_FOLLOWS_FROM SpanRefType = 1 + SpanRefType_CHILD_OF SpanRefType = jaegerIdlModel.SpanRefType_CHILD_OF + SpanRefType_FOLLOWS_FROM SpanRefType = jaegerIdlModel.SpanRefType_FOLLOWS_FROM ) -var SpanRefType_name = map[int32]string{ - 0: "CHILD_OF", - 1: "FOLLOWS_FROM", -} - -var SpanRefType_value = map[string]int32{ - "CHILD_OF": 0, - "FOLLOWS_FROM": 1, -} +var SpanRefType_name = jaegerIdlModel.SpanRefType_name +var SpanRefType_value = jaegerIdlModel.SpanRefType_value type KeyValue = jaegerIdlModel.KeyValue - - var xxx_messageInfo_KeyValue proto.InternalMessageInfo - - type Log = jaegerIdlModel.Log - - var xxx_messageInfo_Log proto.InternalMessageInfo - - type SpanRef = jaegerIdlModel.SpanRef - - var xxx_messageInfo_SpanRef proto.InternalMessageInfo - - type Process = jaegerIdlModel.Process - - var xxx_messageInfo_Process proto.InternalMessageInfo - - type Span = jaegerIdlModel.Span - - var xxx_messageInfo_Span proto.InternalMessageInfo - - type Trace = jaegerIdlModel.Trace - - var xxx_messageInfo_Trace proto.InternalMessageInfo - - type Trace_ProcessMapping = jaegerIdlModel.Trace_ProcessMapping - - var xxx_messageInfo_Trace_ProcessMapping proto.InternalMessageInfo - - // Note that both Span and Batch may contain a Process. // This is different from the Thrift model which was only used // for transport, because Proto model is also used by the backend @@ -140,23 +98,15 @@ var xxx_messageInfo_Trace_ProcessMapping proto.InternalMessageInfo // over batch.Process. type Batch = jaegerIdlModel.Batch - - var xxx_messageInfo_Batch proto.InternalMessageInfo - - type DependencyLink = jaegerIdlModel.DependencyLink - - var xxx_messageInfo_DependencyLink proto.InternalMessageInfo - - func init() { - //proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) - //proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) + proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) + proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) proto.RegisterType((*KeyValue)(nil), "jaeger.api_v2.KeyValue") proto.RegisterType((*Log)(nil), "jaeger.api_v2.Log") proto.RegisterType((*SpanRef)(nil), "jaeger.api_v2.SpanRef") @@ -234,10 +184,6 @@ var fileDescriptor_4c16552f9fdb66d8 = []byte{ 0x02, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x45, 0x11, 0xa2, 0xdf, 0x07, 0x00, 0x00, } - - - - func encodeVarintModel(dAtA []byte, offset int, v uint64) int { offset -= sovModel(v) base := offset @@ -250,10 +196,10 @@ func encodeVarintModel(dAtA []byte, offset int, v uint64) int { return base } - func sovModel(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } + func sozModel(x uint64) (n int) { return sovModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } @@ -338,7 +284,7 @@ func skipModel(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthModel = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowModel = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupModel = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthModel = jaegerIdlModel.ErrInvalidLengthModel + ErrIntOverflowModel = jaegerIdlModel.ErrIntOverflowModel + ErrUnexpectedEndOfGroupModel = jaegerIdlModel.ErrUnexpectedEndOfGroupModel ) diff --git a/model/process.go b/model/process.go index 00ea40ba04a..cb504f5803e 100644 --- a/model/process.go +++ b/model/process.go @@ -4,12 +4,14 @@ package model +import ( + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" +) + // NewProcess creates a new Process for given serviceName and tags. // The tags are sorted in place and kept in the same array/slice, // in order to store the Process in a canonical form that is relied // upon by the Equal and Hash functions. func NewProcess(serviceName string, tags []KeyValue) *Process { - typedTags := KeyValues(tags) - typedTags.Sort() - return &Process{ServiceName: serviceName, Tags: typedTags} + return jaegerIdlModel.NewProcess(serviceName, tags) } diff --git a/model/sort.go b/model/sort.go index 91d82219085..9922adc3473 100644 --- a/model/sort.go +++ b/model/sort.go @@ -5,97 +5,25 @@ package model import ( - "sort" + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) -type byTraceID []*TraceID - -func (s byTraceID) Len() int { return len(s) } -func (s byTraceID) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s byTraceID) Less(i, j int) bool { - if s[i].High < s[j].High { - return true - } else if s[i].High > s[j].High { - return false - } - return s[i].Low < s[j].Low -} - // SortTraceIDs sorts a list of TraceIDs func SortTraceIDs(traceIDs []*TraceID) { - sort.Sort(byTraceID(traceIDs)) -} - -type traceByTraceID []*Trace - -func (s traceByTraceID) Len() int { return len(s) } -func (s traceByTraceID) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s traceByTraceID) Less(i, j int) bool { - switch { - case len(s[i].Spans) == 0: - return true - case len(s[j].Spans) == 0: - return false - default: - return s[i].Spans[0].TraceID.Low < s[j].Spans[0].TraceID.Low - } + jaegerIdlModel.SortTraceIDs(traceIDs) } // SortTraces deep sorts a list of traces by TraceID. func SortTraces(traces []*Trace) { - sort.Sort(traceByTraceID(traces)) - for _, trace := range traces { - SortTrace(trace) - } + jaegerIdlModel.SortTraces(traces) } -type spanBySpanID []*Span - -func (s spanBySpanID) Len() int { return len(s) } -func (s spanBySpanID) Swap(i, j int) { s[i], s[j] = s[j], s[i] } -func (s spanBySpanID) Less(i, j int) bool { return s[i].SpanID < s[j].SpanID } - // SortTrace deep sorts a trace's spans by SpanID. func SortTrace(trace *Trace) { - sort.Sort(spanBySpanID(trace.Spans)) - for _, span := range trace.Spans { - SortSpan(span) - } + jaegerIdlModel.SortTrace(trace) } // SortSpan deep sorts a span: this sorts its tags, logs by timestamp, tags in logs, and tags in process. func SortSpan(span *Span) { - span.NormalizeTimestamps() - sortTags(span.Tags) - sortLogs(span.Logs) - sortProcess(span.Process) -} - -type tagByKey []KeyValue - -func (t tagByKey) Len() int { return len(t) } -func (t tagByKey) Swap(i, j int) { t[i], t[j] = t[j], t[i] } -func (t tagByKey) Less(i, j int) bool { return t[i].Key < t[j].Key } - -func sortTags(tags []KeyValue) { - sort.Sort(tagByKey(tags)) -} - -type logByTimestamp []Log - -func (t logByTimestamp) Len() int { return len(t) } -func (t logByTimestamp) Swap(i, j int) { t[i], t[j] = t[j], t[i] } -func (t logByTimestamp) Less(i, j int) bool { return t[i].Timestamp.Before(t[j].Timestamp) } - -func sortLogs(logs []Log) { - sort.Sort(logByTimestamp(logs)) - for _, log := range logs { - sortTags(log.Fields) - } -} - -func sortProcess(process *Process) { - if process != nil { - sortTags(process.Tags) - } + jaegerIdlModel.SortSpan(span) } diff --git a/model/span.go b/model/span.go index 06d01c1ba2b..45c4307ce52 100644 --- a/model/span.go +++ b/model/span.go @@ -27,5 +27,5 @@ var toSamplerType = map[string]SamplerType{ } func SpanKindTag(kind SpanKind) KeyValue { - return String(SpanKindKey, string(kind)) + return jaegerIdlModel.SpanKindTag(kind) } diff --git a/model/spanref.go b/model/spanref.go index 39d0e13820d..5ff47cf5175 100644 --- a/model/spanref.go +++ b/model/spanref.go @@ -4,6 +4,10 @@ package model +import ( + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" +) + const ( // ChildOf span reference type describes a reference to a parent span // that depends on the response from the current (child) span @@ -19,43 +23,15 @@ const ( // or other formats might still have these IDs without representing them in the References, // so this converts parent IDs to canonical reference format. func MaybeAddParentSpanID(traceID TraceID, parentSpanID SpanID, refs []SpanRef) []SpanRef { - if parentSpanID == 0 { - return refs - } - for i := range refs { - r := &refs[i] - if r.SpanID == parentSpanID && r.TraceID == traceID { - return refs - } - } - newRef := SpanRef{ - TraceID: traceID, - SpanID: parentSpanID, - RefType: ChildOf, - } - if len(refs) == 0 { - return append(refs, newRef) - } - newRefs := make([]SpanRef, len(refs)+1) - newRefs[0] = newRef - copy(newRefs[1:], refs) - return newRefs + return jaegerIdlModel.MaybeAddParentSpanID(traceID, parentSpanID, refs) } // NewChildOfRef creates a new child-of span reference. func NewChildOfRef(traceID TraceID, spanID SpanID) SpanRef { - return SpanRef{ - RefType: ChildOf, - TraceID: traceID, - SpanID: spanID, - } + return jaegerIdlModel.NewChildOfRef(traceID, spanID) } // NewFollowsFromRef creates a new follows-from span reference. func NewFollowsFromRef(traceID TraceID, spanID SpanID) SpanRef { - return SpanRef{ - RefType: FollowsFrom, - TraceID: traceID, - SpanID: spanID, - } + return jaegerIdlModel.NewFollowsFromRef(traceID, spanID) } diff --git a/model/time.go b/model/time.go index 153e52b7609..f5409fb45de 100644 --- a/model/time.go +++ b/model/time.go @@ -6,32 +6,28 @@ package model import ( "time" + + jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) // EpochMicrosecondsAsTime converts microseconds since epoch to time.Time value. func EpochMicrosecondsAsTime(ts uint64) time.Time { - seconds := ts / 1000000 - nanos := 1000 * (ts % 1000000) - //nolint: gosec // G115 - return time.Unix(int64(seconds), int64(nanos)).UTC() + return jaegerIdlModel.EpochMicrosecondsAsTime(ts) } // TimeAsEpochMicroseconds converts time.Time to microseconds since epoch, // which is the format the StartTime field is stored in the Span. func TimeAsEpochMicroseconds(t time.Time) uint64 { - //nolint: gosec // G115 - return uint64(t.UnixNano() / 1000) + return jaegerIdlModel.TimeAsEpochMicroseconds(t) } // MicrosecondsAsDuration converts duration in microseconds to time.Duration value. func MicrosecondsAsDuration(v uint64) time.Duration { - //nolint: gosec // G115 - return time.Duration(v) * time.Microsecond + return jaegerIdlModel.MicrosecondsAsDuration(v) } // DurationAsMicroseconds converts time.Duration to microseconds, // which is the format the Duration field is stored in the Span. func DurationAsMicroseconds(d time.Duration) uint64 { - //nolint: gosec // G115 - return uint64(d.Nanoseconds() / 1000) + return jaegerIdlModel.DurationAsMicroseconds(d) } diff --git a/proto-gen/api_v2/collector.pb.go b/proto-gen/api_v2/collector.go similarity index 95% rename from proto-gen/api_v2/collector.pb.go rename to proto-gen/api_v2/collector.go index 1b10bc6e803..c5b06b214b8 100644 --- a/proto-gen/api_v2/collector.pb.go +++ b/proto-gen/api_v2/collector.go @@ -87,7 +87,7 @@ type collectorServiceClient struct { } func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { - return &collectorServiceClient{cc} + return jaegerIdlModel.NewCollectorServiceClient(cc) } func (c *collectorServiceClient) PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) { @@ -108,7 +108,7 @@ type UnimplementedCollectorServiceServer = jaegerIdlModel.UnimplementedCollector func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { - s.RegisterService(&_CollectorService_serviceDesc, srv) + jaegerIdlModel.RegisterCollectorServiceServer(s, srv) } func _CollectorService_PostSpans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -244,7 +244,7 @@ func skipCollector(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthCollector = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowCollector = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupCollector = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthCollector = jaegerIdlModel.ErrInvalidLengthCollector + ErrIntOverflowCollector = jaegerIdlModel.ErrIntOverflowCollector + ErrUnexpectedEndOfGroupCollector = jaegerIdlModel.ErrUnexpectedEndOfGroupCollector ) diff --git a/proto-gen/api_v2/query.pb.go b/proto-gen/api_v2/query.go similarity index 98% rename from proto-gen/api_v2/query.pb.go rename to proto-gen/api_v2/query.go index 118a84962e6..c3ea0fa5888 100644 --- a/proto-gen/api_v2/query.pb.go +++ b/proto-gen/api_v2/query.go @@ -357,7 +357,7 @@ type UnimplementedQueryServiceServer = jaegerIdlModel.UnimplementedQueryServiceS func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { - s.RegisterService(&_QueryService_serviceDesc, srv) + jaegerIdlModel.RegisterQueryServiceServer(s,srv) } func _QueryService_GetTrace_Handler(srv interface{}, stream grpc.ServerStream) error { @@ -607,7 +607,7 @@ func skipQuery(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthQuery = jaegerIdlModel.ErrInvalidLengthQuery + ErrIntOverflowQuery = jaegerIdlModel.ErrIntOverflowQuery + ErrUnexpectedEndOfGroupQuery = jaegerIdlModel.ErrUnexpectedEndOfGroupQuery ) diff --git a/proto-gen/api_v2/sampling.pb.go b/proto-gen/api_v2/sampling.go similarity index 95% rename from proto-gen/api_v2/sampling.pb.go rename to proto-gen/api_v2/sampling.go index 97d8e52e263..de7cf0a2807 100644 --- a/proto-gen/api_v2/sampling.pb.go +++ b/proto-gen/api_v2/sampling.go @@ -35,15 +35,9 @@ const ( SamplingStrategyType_RATE_LIMITING SamplingStrategyType = 1 ) -var SamplingStrategyType_name = map[int32]string{ - 0: "PROBABILISTIC", - 1: "RATE_LIMITING", -} +var SamplingStrategyType_name = jaegerIdlModel.SamplingStrategyType_name -var SamplingStrategyType_value = map[string]int32{ - "PROBABILISTIC": 0, - "RATE_LIMITING": 1, -} +var SamplingStrategyType_value = jaegerIdlModel.SamplingStrategyType_value @@ -170,7 +164,7 @@ type samplingManagerClient struct { func NewSamplingManagerClient(cc *grpc.ClientConn) SamplingManagerClient { - return &samplingManagerClient{cc} + return jaegerIdlModel.NewSamplingManagerClient(cc) } func (c *samplingManagerClient) GetSamplingStrategy(ctx context.Context, in *SamplingStrategyParameters, opts ...grpc.CallOption) (*SamplingStrategyResponse, error) { @@ -192,7 +186,7 @@ type UnimplementedSamplingManagerServer = jaegerIdlModel.UnimplementedSamplingMa func RegisterSamplingManagerServer(s *grpc.Server, srv SamplingManagerServer) { - s.RegisterService(&_SamplingManager_serviceDesc, srv) + jaegerIdlModel.RegisterSamplingManagerServer(s, srv) } func _SamplingManager_GetSamplingStrategy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { @@ -328,7 +322,7 @@ func skipSampling(dAtA []byte) (n int, err error) { } var ( - ErrInvalidLengthSampling = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowSampling = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupSampling = fmt.Errorf("proto: unexpected end of group") + ErrInvalidLengthSampling = jaegerIdlModel.ErrInvalidLengthSampling + ErrIntOverflowSampling = jaegerIdlModel.ErrIntOverflowSampling + ErrUnexpectedEndOfGroupSampling = jaegerIdlModel.ErrUnexpectedEndOfGroupSampling ) From 4dc49eeada5a5650c414bce7b64b82fe6c86f75c Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 01:46:02 +0200 Subject: [PATCH 04/11] fix: linting and fmted Signed-off-by: nabil salah --- model/keyvalue.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/keyvalue.go b/model/keyvalue.go index 2d4c7db3e5f..b30e6374bdf 100644 --- a/model/keyvalue.go +++ b/model/keyvalue.go @@ -34,8 +34,9 @@ const ( SpanKindProducer SpanKind = jaegerIdlModel.SpanKindProducer SpanKindConsumer SpanKind = jaegerIdlModel.SpanKindConsumer SpanKindInternal SpanKind = jaegerIdlModel.SpanKindInternal - SpanKindUnspecified SpanKind =jaegerIdlModel.SpanKindUnspecified + SpanKindUnspecified SpanKind = jaegerIdlModel.SpanKindUnspecified ) + func SpanKindFromString(kind string) (SpanKind, error) { return jaegerIdlModel.SpanKindFromString(kind) } From 65346fd9185c4bcae73f03d8ea2cbcb3f1cc5df8 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 02:05:28 +0200 Subject: [PATCH 05/11] fix: proto duplicate enum registered Signed-off-by: nabil salah --- model/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/model.go b/model/model.go index 3b1334cc6d8..0703fd73815 100644 --- a/model/model.go +++ b/model/model.go @@ -105,7 +105,7 @@ type DependencyLink = jaegerIdlModel.DependencyLink var xxx_messageInfo_DependencyLink proto.InternalMessageInfo func init() { - proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) + //proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) proto.RegisterType((*KeyValue)(nil), "jaeger.api_v2.KeyValue") proto.RegisterType((*Log)(nil), "jaeger.api_v2.Log") From d3025a883d96413e8b59efa889149436a47fb2c1 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 02:38:47 +0200 Subject: [PATCH 06/11] fix: failing tests and remove unused variables Signed-off-by: nabil salah --- model/model.go | 219 -------------- pkg/gogocodec/codec.go | 4 +- proto-gen/api_v2/collector.go | 215 +------------- proto-gen/api_v2/query.go | 537 +--------------------------------- proto-gen/api_v2/sampling.go | 265 +---------------- 5 files changed, 8 insertions(+), 1232 deletions(-) diff --git a/model/model.go b/model/model.go index 0703fd73815..11defc46315 100644 --- a/model/model.go +++ b/model/model.go @@ -1,38 +1,16 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. - // Copyright (c) 2025 The Jaeger Authors. // SPDX-License-Identifier: Apache-2.0 -// source: model.proto - package model import ( - fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - time "time" - - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" ) -// Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf - _ = time.Kitchen -) - // 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ValueType = jaegerIdlModel.ValueType @@ -61,32 +39,18 @@ var SpanRefType_value = jaegerIdlModel.SpanRefType_value type KeyValue = jaegerIdlModel.KeyValue -var xxx_messageInfo_KeyValue proto.InternalMessageInfo - type Log = jaegerIdlModel.Log -var xxx_messageInfo_Log proto.InternalMessageInfo - type SpanRef = jaegerIdlModel.SpanRef -var xxx_messageInfo_SpanRef proto.InternalMessageInfo - type Process = jaegerIdlModel.Process -var xxx_messageInfo_Process proto.InternalMessageInfo - type Span = jaegerIdlModel.Span -var xxx_messageInfo_Span proto.InternalMessageInfo - type Trace = jaegerIdlModel.Trace -var xxx_messageInfo_Trace proto.InternalMessageInfo - type Trace_ProcessMapping = jaegerIdlModel.Trace_ProcessMapping -var xxx_messageInfo_Trace_ProcessMapping proto.InternalMessageInfo - // Note that both Span and Batch may contain a Process. // This is different from the Thrift model which was only used // for transport, because Proto model is also used by the backend @@ -98,191 +62,8 @@ var xxx_messageInfo_Trace_ProcessMapping proto.InternalMessageInfo // over batch.Process. type Batch = jaegerIdlModel.Batch -var xxx_messageInfo_Batch proto.InternalMessageInfo - type DependencyLink = jaegerIdlModel.DependencyLink -var xxx_messageInfo_DependencyLink proto.InternalMessageInfo - -func init() { - //proto.RegisterEnum("jaeger.api_v2.ValueType", ValueType_name, ValueType_value) - proto.RegisterEnum("jaeger.api_v2.SpanRefType", SpanRefType_name, SpanRefType_value) - proto.RegisterType((*KeyValue)(nil), "jaeger.api_v2.KeyValue") - proto.RegisterType((*Log)(nil), "jaeger.api_v2.Log") - proto.RegisterType((*SpanRef)(nil), "jaeger.api_v2.SpanRef") - proto.RegisterType((*Process)(nil), "jaeger.api_v2.Process") - proto.RegisterType((*Span)(nil), "jaeger.api_v2.Span") - proto.RegisterType((*Trace)(nil), "jaeger.api_v2.Trace") - proto.RegisterType((*Trace_ProcessMapping)(nil), "jaeger.api_v2.Trace.ProcessMapping") - proto.RegisterType((*Batch)(nil), "jaeger.api_v2.Batch") - proto.RegisterType((*DependencyLink)(nil), "jaeger.api_v2.DependencyLink") -} - -func init() { proto.RegisterFile("model.proto", fileDescriptor_4c16552f9fdb66d8) } - -var fileDescriptor_4c16552f9fdb66d8 = []byte{ - // 957 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0xc1, 0x6f, 0xe3, 0xc4, - 0x17, 0xee, 0x24, 0x76, 0x6c, 0xbf, 0xa4, 0x55, 0x34, 0xbb, 0xbf, 0xad, 0x37, 0x3f, 0xd1, 0x84, - 0xac, 0x90, 0xc2, 0xaa, 0xa4, 0x6c, 0xd9, 0xed, 0x01, 0x21, 0xa1, 0x75, 0x4b, 0xc0, 0x90, 0x36, - 0x68, 0x5a, 0x81, 0xe0, 0x62, 0x4d, 0x9d, 0x89, 0xd7, 0xbb, 0x8e, 0xc7, 0xb2, 0x1d, 0xa3, 0xdc, - 0xf8, 0x13, 0x10, 0x27, 0x8e, 0x70, 0xe5, 0x2f, 0xd9, 0x23, 0x07, 0x4e, 0x48, 0x14, 0xd4, 0xd3, - 0xfe, 0x19, 0x68, 0xc6, 0xe3, 0x74, 0x1b, 0x56, 0xd0, 0xbd, 0x70, 0xca, 0xbc, 0x99, 0xef, 0x7b, - 0xf3, 0xde, 0xf7, 0xbe, 0x89, 0xa1, 0x39, 0xe7, 0x53, 0x16, 0x0d, 0x93, 0x94, 0xe7, 0x1c, 0x6f, - 0x3e, 0xa5, 0x2c, 0x60, 0xe9, 0x90, 0x26, 0xa1, 0x57, 0xec, 0x77, 0x6e, 0x07, 0x3c, 0xe0, 0xf2, - 0x64, 0x4f, 0xac, 0x4a, 0x50, 0xa7, 0x1b, 0x70, 0x1e, 0x44, 0x6c, 0x4f, 0x46, 0xe7, 0x8b, 0xd9, - 0x5e, 0x1e, 0xce, 0x59, 0x96, 0xd3, 0x79, 0xa2, 0x00, 0x3b, 0xeb, 0x80, 0xe9, 0x22, 0xa5, 0x79, - 0xc8, 0xe3, 0xf2, 0xbc, 0xff, 0x2b, 0x02, 0xf3, 0x33, 0xb6, 0xfc, 0x82, 0x46, 0x0b, 0x86, 0xdb, - 0x50, 0x7f, 0xc6, 0x96, 0x36, 0xea, 0xa1, 0x81, 0x45, 0xc4, 0x12, 0xef, 0x41, 0xa3, 0xf0, 0xf2, - 0x65, 0xc2, 0xec, 0x5a, 0x0f, 0x0d, 0xb6, 0xf6, 0xed, 0xe1, 0xb5, 0xaa, 0x86, 0x92, 0x77, 0xb6, - 0x4c, 0x18, 0xd1, 0x0b, 0xf1, 0x83, 0x6f, 0x81, 0x5e, 0x78, 0x59, 0x9e, 0xda, 0x75, 0x99, 0x44, - 0x2b, 0x4e, 0xf3, 0x14, 0xff, 0x4f, 0x64, 0x39, 0xe7, 0x3c, 0xb2, 0xb5, 0x1e, 0x1a, 0x98, 0x44, - 0x2f, 0x1c, 0xce, 0x23, 0xbc, 0x0d, 0x46, 0xe1, 0x85, 0x71, 0x7e, 0xf0, 0xd0, 0xd6, 0x7b, 0x68, - 0x50, 0x27, 0x8d, 0xc2, 0x15, 0x11, 0xfe, 0x3f, 0x58, 0x85, 0x37, 0x8b, 0x38, 0x15, 0x47, 0x8d, - 0x1e, 0x1a, 0x20, 0x62, 0x16, 0xa3, 0x32, 0xc6, 0x77, 0xc1, 0x2c, 0xbc, 0xf3, 0x30, 0xa6, 0xe9, - 0xd2, 0x36, 0x7a, 0x68, 0xd0, 0x22, 0x46, 0xe1, 0xc8, 0xf0, 0x7d, 0xf3, 0xc5, 0x8f, 0x5d, 0xf4, - 0xe2, 0xa7, 0x2e, 0xea, 0x7f, 0x8b, 0xa0, 0x3e, 0xe6, 0x01, 0x76, 0xc0, 0x5a, 0x29, 0x22, 0xfb, - 0x6a, 0xee, 0x77, 0x86, 0xa5, 0x24, 0xc3, 0x4a, 0x92, 0xe1, 0x59, 0x85, 0x70, 0xcc, 0xe7, 0x17, - 0xdd, 0x8d, 0xef, 0xfe, 0xe8, 0x22, 0x72, 0x45, 0xc3, 0x8f, 0xa0, 0x31, 0x0b, 0x59, 0x34, 0xcd, - 0xec, 0x5a, 0xaf, 0x3e, 0x68, 0xee, 0x6f, 0xaf, 0x69, 0x50, 0xc9, 0xe7, 0x68, 0x82, 0x4d, 0x14, - 0xb8, 0xff, 0x33, 0x02, 0xe3, 0x34, 0xa1, 0x31, 0x61, 0x33, 0xfc, 0x08, 0xcc, 0x3c, 0xa5, 0x3e, - 0xf3, 0xc2, 0xa9, 0xac, 0xa2, 0xe5, 0x74, 0x04, 0xf6, 0xb7, 0x8b, 0xae, 0x71, 0x26, 0xf6, 0xdd, - 0xa3, 0xcb, 0xab, 0x25, 0x31, 0x24, 0xd6, 0x9d, 0xe2, 0x07, 0x60, 0x64, 0x09, 0x8d, 0x05, 0xab, - 0x26, 0x59, 0xb6, 0x62, 0x35, 0x44, 0x62, 0x49, 0x52, 0x2b, 0xd2, 0x10, 0x40, 0x77, 0x2a, 0x6e, - 0x4a, 0xd9, 0xac, 0x1c, 0x59, 0x5d, 0x8e, 0xac, 0xb3, 0x56, 0xae, 0xaa, 0x49, 0x0e, 0xcd, 0x48, - 0xcb, 0x45, 0xdf, 0x03, 0xe3, 0xf3, 0x94, 0xfb, 0x2c, 0xcb, 0xf0, 0x9b, 0xd0, 0xca, 0x58, 0x5a, - 0x84, 0x3e, 0xf3, 0x62, 0x3a, 0x67, 0xca, 0x0d, 0x4d, 0xb5, 0x77, 0x42, 0xe7, 0x0c, 0x3f, 0x00, - 0x2d, 0xa7, 0xc1, 0x0d, 0xf5, 0x90, 0xd0, 0xfe, 0xef, 0x1a, 0x68, 0xe2, 0xe6, 0xff, 0x50, 0x8a, - 0xb7, 0x60, 0x8b, 0x27, 0xac, 0x74, 0x7b, 0xd9, 0x4a, 0xe9, 0xc9, 0xcd, 0xd5, 0xae, 0x6c, 0xe6, - 0x03, 0x80, 0x94, 0xcd, 0x58, 0xca, 0x62, 0x9f, 0x65, 0xb6, 0x26, 0x5b, 0xba, 0xf3, 0x6a, 0xcd, - 0x54, 0x47, 0x2f, 0xe1, 0xf1, 0x3d, 0xd0, 0x67, 0x91, 0xd0, 0x42, 0x38, 0x78, 0xd3, 0xd9, 0x54, - 0x55, 0xe9, 0x23, 0xb1, 0x49, 0xca, 0x33, 0x7c, 0x08, 0x90, 0xe5, 0x34, 0xcd, 0x3d, 0x61, 0x2a, - 0x69, 0xe8, 0x1b, 0xdb, 0x50, 0xf2, 0xc4, 0x09, 0xfe, 0x10, 0xcc, 0xea, 0xed, 0x4a, 0xdf, 0x37, - 0xf7, 0xef, 0xfe, 0x2d, 0xc5, 0x91, 0x02, 0x94, 0x19, 0x7e, 0x10, 0x19, 0x56, 0xa4, 0xd5, 0xd4, - 0xcc, 0x1b, 0x4f, 0x0d, 0xef, 0x82, 0x16, 0xf1, 0x20, 0xb3, 0x2d, 0x49, 0xc1, 0x6b, 0x94, 0x31, - 0x0f, 0x2a, 0xb4, 0x40, 0xe1, 0x77, 0xc1, 0x48, 0x4a, 0x13, 0xd9, 0x20, 0x0b, 0x5c, 0x97, 0x51, - 0x59, 0x8c, 0x54, 0x30, 0xbc, 0x0b, 0xa0, 0x96, 0x62, 0xb0, 0x4d, 0x31, 0x1e, 0x67, 0xf3, 0xf2, - 0xa2, 0x6b, 0x29, 0xa4, 0x7b, 0x44, 0x2c, 0x05, 0x70, 0xa7, 0xb8, 0x03, 0xe6, 0x37, 0x34, 0x8d, - 0xc3, 0x38, 0xc8, 0xec, 0x56, 0xaf, 0x3e, 0xb0, 0xc8, 0x2a, 0xee, 0x7f, 0x5f, 0x03, 0x5d, 0x9a, - 0x06, 0xbf, 0x0d, 0xba, 0x30, 0x40, 0x66, 0x23, 0x59, 0xf4, 0xad, 0x57, 0x8d, 0xb2, 0x44, 0xe0, - 0x4f, 0xa1, 0x59, 0x5d, 0x3f, 0xa7, 0x89, 0xb2, 0xf3, 0xbd, 0x35, 0x82, 0xcc, 0x5a, 0x95, 0x7e, - 0x4c, 0x93, 0x24, 0x8c, 0xab, 0xb6, 0xab, 0xe2, 0x8f, 0x69, 0x72, 0xad, 0xb8, 0xfa, 0xf5, 0xe2, - 0x3a, 0x05, 0x6c, 0x5d, 0xe7, 0xaf, 0x35, 0x8e, 0xfe, 0xa5, 0xf1, 0x83, 0x2b, 0x61, 0x6b, 0xff, - 0x24, 0xac, 0x2a, 0xab, 0x02, 0xf7, 0x9f, 0x82, 0xee, 0xd0, 0xdc, 0x7f, 0xf2, 0x3a, 0x9a, 0xbc, - 0xd6, 0x5d, 0xe8, 0xea, 0xae, 0x05, 0x6c, 0x1d, 0xb1, 0x84, 0xc5, 0x53, 0x16, 0xfb, 0xcb, 0x71, - 0x18, 0x3f, 0xc3, 0x77, 0xa0, 0x91, 0xd0, 0x94, 0xc5, 0xb9, 0xfa, 0x0b, 0x51, 0x11, 0xbe, 0x0d, - 0xba, 0xff, 0x24, 0x8c, 0xca, 0x87, 0x6c, 0x91, 0x32, 0xc0, 0x6f, 0x00, 0xf8, 0x34, 0x8a, 0x3c, - 0x9f, 0x2f, 0xe2, 0x5c, 0xbe, 0x54, 0x8d, 0x58, 0x62, 0xe7, 0x50, 0x6c, 0x88, 0x64, 0x19, 0x5f, - 0xa4, 0x3e, 0x93, 0x9f, 0x10, 0x8b, 0xa8, 0xe8, 0xfe, 0x47, 0x60, 0xad, 0xbe, 0x41, 0x18, 0xa0, - 0x71, 0x7a, 0x46, 0xdc, 0x93, 0x8f, 0xdb, 0x1b, 0xd8, 0x04, 0xcd, 0x99, 0x4c, 0xc6, 0x6d, 0x84, - 0x2d, 0xd0, 0xdd, 0x93, 0xb3, 0x83, 0x87, 0xed, 0x1a, 0x6e, 0x82, 0x31, 0x1a, 0x4f, 0x1e, 0x8b, - 0xa0, 0x2e, 0xd0, 0x8e, 0x7b, 0xf2, 0x98, 0x7c, 0xd5, 0xd6, 0xee, 0xbf, 0x03, 0xcd, 0x97, 0xfe, - 0x17, 0x71, 0x0b, 0xcc, 0xc3, 0x4f, 0xdc, 0xf1, 0x91, 0x37, 0x19, 0xb5, 0x37, 0x70, 0x1b, 0x5a, - 0xa3, 0xc9, 0x78, 0x3c, 0xf9, 0xf2, 0xd4, 0x1b, 0x91, 0xc9, 0x71, 0x1b, 0x39, 0xbb, 0xcf, 0x2f, - 0x77, 0xd0, 0x2f, 0x97, 0x3b, 0xe8, 0xcf, 0xcb, 0x1d, 0x04, 0xdb, 0x21, 0x57, 0x1a, 0x89, 0x7f, - 0xab, 0x30, 0x0e, 0x94, 0x54, 0x5f, 0xeb, 0xf2, 0x7b, 0x7e, 0xde, 0x90, 0xef, 0xf3, 0xbd, 0xbf, - 0x02, 0x00, 0x00, 0xff, 0xff, 0xaa, 0x45, 0x11, 0xa2, 0xdf, 0x07, 0x00, 0x00, -} - -func encodeVarintModel(dAtA []byte, offset int, v uint64) int { - offset -= sovModel(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - -func sovModel(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} - -func sozModel(x uint64) (n int) { - return sovModel(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func skipModel(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModel - } - 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, ErrIntOverflowModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowModel - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthModel - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupModel - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthModel - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - var ( ErrInvalidLengthModel = jaegerIdlModel.ErrInvalidLengthModel ErrIntOverflowModel = jaegerIdlModel.ErrIntOverflowModel diff --git a/pkg/gogocodec/codec.go b/pkg/gogocodec/codec.go index 55322baa89c..ce1e0947736 100644 --- a/pkg/gogocodec/codec.go +++ b/pkg/gogocodec/codec.go @@ -15,8 +15,8 @@ import ( ) const ( - jaegerProtoGenPkgPath = "github.com/jaegertracing/jaeger/proto-gen" - jaegerModelPkgPath = "github.com/jaegertracing/jaeger/model" + jaegerProtoGenPkgPath = "github.com/jaegertracing/jaeger-idl/proto-gen" + jaegerModelPkgPath = "github.com/jaegertracing/jaeger-idl/model/v1" ) var defaultCodec encoding.CodecV2 diff --git a/proto-gen/api_v2/collector.go b/proto-gen/api_v2/collector.go index c5b06b214b8..16e1193679a 100644 --- a/proto-gen/api_v2/collector.go +++ b/proto-gen/api_v2/collector.go @@ -1,248 +1,35 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: collector.proto - package api_v2 import ( - context "context" - fmt "fmt" _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - io "io" - math "math" jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" - math_bits "math/bits" + grpc "google.golang.org/grpc" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package - type PostSpansRequest = jaegerIdlModel.PostSpansRequest - - -var xxx_messageInfo_PostSpansRequest proto.InternalMessageInfo - - - type PostSpansResponse = jaegerIdlModel.PostSpansResponse - - -var xxx_messageInfo_PostSpansResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*PostSpansRequest)(nil), "jaeger.api_v2.PostSpansRequest") - proto.RegisterType((*PostSpansResponse)(nil), "jaeger.api_v2.PostSpansResponse") -} - -func init() { proto.RegisterFile("collector.proto", fileDescriptor_9305884a292fdf82) } - -var fileDescriptor_9305884a292fdf82 = []byte{ - // 262 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0xce, 0xcf, 0xc9, - 0x49, 0x4d, 0x2e, 0xc9, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0xcd, 0x4a, 0x4c, - 0x4d, 0x4f, 0x2d, 0xd2, 0x4b, 0x2c, 0xc8, 0x8c, 0x2f, 0x33, 0x92, 0xe2, 0xce, 0xcd, 0x4f, 0x49, - 0xcd, 0x81, 0xc8, 0x49, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x99, 0xfa, 0x20, 0x16, 0x54, 0x54, - 0x26, 0x3d, 0x3f, 0x3f, 0x3d, 0x27, 0x55, 0x3f, 0xb1, 0x20, 0x53, 0x3f, 0x31, 0x2f, 0x2f, 0xbf, - 0x24, 0xb1, 0x24, 0x33, 0x3f, 0xaf, 0x18, 0x22, 0xab, 0xe4, 0xc2, 0x25, 0x10, 0x90, 0x5f, 0x5c, - 0x12, 0x5c, 0x90, 0x98, 0x57, 0x1c, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0x22, 0x64, 0xc0, 0xc5, - 0x9a, 0x94, 0x58, 0x92, 0x9c, 0x21, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xa2, 0x87, 0x62, - 0xa7, 0x9e, 0x13, 0x48, 0xce, 0x89, 0xe5, 0xc4, 0x3d, 0x79, 0x86, 0x20, 0x88, 0x42, 0x25, 0x61, - 0x2e, 0x41, 0x24, 0x53, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x8d, 0x6a, 0xb8, 0x04, 0x9c, 0x61, - 0xae, 0x0f, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x15, 0xca, 0xe0, 0xe2, 0x84, 0x2b, 0x14, 0x92, - 0x47, 0x33, 0x18, 0xdd, 0x21, 0x52, 0x0a, 0xb8, 0x15, 0x40, 0xec, 0x50, 0x92, 0x68, 0xba, 0xfc, - 0x64, 0x32, 0x93, 0x90, 0x12, 0x2f, 0xd8, 0x7b, 0x65, 0x46, 0xfa, 0xc5, 0x20, 0x69, 0x2b, 0x46, - 0x2d, 0x27, 0xdd, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x91, - 0x4b, 0x3c, 0x33, 0x1f, 0x6a, 0x56, 0x49, 0x51, 0x62, 0x72, 0x66, 0x5e, 0x3a, 0xd4, 0xc8, 0x28, - 0x36, 0x08, 0x9d, 0xc4, 0x06, 0x0e, 0x0e, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6f, 0x18, - 0xa1, 0x12, 0x71, 0x01, 0x00, 0x00, -} - -// 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 - // 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 = jaegerIdlModel.CollectorServiceClient -type collectorServiceClient struct { - cc *grpc.ClientConn -} - func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { return jaegerIdlModel.NewCollectorServiceClient(cc) } -func (c *collectorServiceClient) PostSpans(ctx context.Context, in *PostSpansRequest, opts ...grpc.CallOption) (*PostSpansResponse, error) { - out := new(PostSpansResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.CollectorService/PostSpans", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // CollectorServiceServer is the server API for CollectorService service. type CollectorServiceServer = jaegerIdlModel.CollectorServiceServer // UnimplementedCollectorServiceServer can be embedded to have forward compatible implementations. type UnimplementedCollectorServiceServer = jaegerIdlModel.UnimplementedCollectorServiceServer - - func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { jaegerIdlModel.RegisterCollectorServiceServer(s, 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: "collector.proto", -} - - - -func encodeVarintCollector(dAtA []byte, offset int, v uint64) int { - offset -= sovCollector(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - - -func sovCollector(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozCollector(x uint64) (n int) { - return sovCollector(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func skipCollector(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 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 - } - } - case 1: - iNdEx += 8 - 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 - } - } - if length < 0 { - return 0, ErrInvalidLengthCollector - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupCollector - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthCollector - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - var ( ErrInvalidLengthCollector = jaegerIdlModel.ErrInvalidLengthCollector ErrIntOverflowCollector = jaegerIdlModel.ErrIntOverflowCollector diff --git a/proto-gen/api_v2/query.go b/proto-gen/api_v2/query.go index c3ea0fa5888..699ef8c3194 100644 --- a/proto-gen/api_v2/query.go +++ b/proto-gen/api_v2/query.go @@ -1,69 +1,22 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: query.proto - package api_v2 import ( - context "context" - fmt "fmt" _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" grpc "google.golang.org/grpc" - io "io" - math "math" - math_bits "math/bits" - time "time" jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package - type GetTraceRequest = jaegerIdlModel.GetTraceRequest - - - -var xxx_messageInfo_GetTraceRequest proto.InternalMessageInfo - - - type SpansResponseChunk = jaegerIdlModel.SpansResponseChunk - - - -var xxx_messageInfo_SpansResponseChunk proto.InternalMessageInfo - - - type ArchiveTraceRequest = jaegerIdlModel.ArchiveTraceRequest - - -var xxx_messageInfo_ArchiveTraceRequest proto.InternalMessageInfo - - - type ArchiveTraceResponse = jaegerIdlModel.ArchiveTraceResponse - - - -var xxx_messageInfo_ArchiveTraceResponse proto.InternalMessageInfo - // Query parameters to find traces. Except for num_traces, all fields should be treated // as forming a conjunction, e.g., "service_name='X' AND operation_name='Y' AND ...". // All fields are matched against individual spans, not at the trace level. @@ -75,537 +28,51 @@ var xxx_messageInfo_ArchiveTraceResponse proto.InternalMessageInfo // that match the conditions, and the resulting number of traces can be less. // // Note: some storage implementations do not guarantee the correct implementation of all parameters. -// type TraceQueryParameters = jaegerIdlModel.TraceQueryParameters - - - -var xxx_messageInfo_TraceQueryParameters proto.InternalMessageInfo - - - type FindTracesRequest = jaegerIdlModel.FindTracesRequest - - -var xxx_messageInfo_FindTracesRequest proto.InternalMessageInfo - - type GetServicesRequest = jaegerIdlModel.GetServicesRequest - - - -var xxx_messageInfo_GetServicesRequest proto.InternalMessageInfo - type GetServicesResponse = jaegerIdlModel.GetServicesResponse - - - type GetOperationsRequest = jaegerIdlModel.GetOperationsRequest - - -var xxx_messageInfo_GetOperationsRequest proto.InternalMessageInfo - - - type Operation = jaegerIdlModel.Operation - - -var xxx_messageInfo_Operation proto.InternalMessageInfo - - - type GetOperationsResponse = jaegerIdlModel.GetOperationsResponse - - -var xxx_messageInfo_GetOperationsResponse proto.InternalMessageInfo - - - type GetDependenciesRequest = jaegerIdlModel.GetDependenciesRequest - - -var xxx_messageInfo_GetDependenciesRequest proto.InternalMessageInfo - - - type GetDependenciesResponse = jaegerIdlModel.GetDependenciesResponse - - -var xxx_messageInfo_GetDependenciesResponse proto.InternalMessageInfo - - - -func init() { - proto.RegisterType((*GetTraceRequest)(nil), "jaeger.api_v2.GetTraceRequest") - proto.RegisterType((*SpansResponseChunk)(nil), "jaeger.api_v2.SpansResponseChunk") - proto.RegisterType((*ArchiveTraceRequest)(nil), "jaeger.api_v2.ArchiveTraceRequest") - proto.RegisterType((*ArchiveTraceResponse)(nil), "jaeger.api_v2.ArchiveTraceResponse") - proto.RegisterType((*TraceQueryParameters)(nil), "jaeger.api_v2.TraceQueryParameters") - proto.RegisterMapType((map[string]string)(nil), "jaeger.api_v2.TraceQueryParameters.TagsEntry") - proto.RegisterType((*FindTracesRequest)(nil), "jaeger.api_v2.FindTracesRequest") - proto.RegisterType((*GetServicesRequest)(nil), "jaeger.api_v2.GetServicesRequest") - proto.RegisterType((*GetServicesResponse)(nil), "jaeger.api_v2.GetServicesResponse") - proto.RegisterType((*GetOperationsRequest)(nil), "jaeger.api_v2.GetOperationsRequest") - proto.RegisterType((*Operation)(nil), "jaeger.api_v2.Operation") - proto.RegisterType((*GetOperationsResponse)(nil), "jaeger.api_v2.GetOperationsResponse") - proto.RegisterType((*GetDependenciesRequest)(nil), "jaeger.api_v2.GetDependenciesRequest") - proto.RegisterType((*GetDependenciesResponse)(nil), "jaeger.api_v2.GetDependenciesResponse") -} - -func init() { proto.RegisterFile("query.proto", fileDescriptor_5c6ac9b241082464) } - -var fileDescriptor_5c6ac9b241082464 = []byte{ - // 995 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0x67, 0x1d, 0x3b, 0xb6, 0xdf, 0xda, 0x2d, 0x1d, 0x3b, 0xed, 0xb2, 0xa5, 0xb6, 0xb3, 0xa1, - 0x95, 0x85, 0x94, 0xdd, 0x62, 0x0e, 0x94, 0x0a, 0x09, 0x9a, 0xa6, 0xb5, 0x0a, 0xb4, 0xc0, 0x36, - 0x27, 0x38, 0x58, 0x13, 0xef, 0xb0, 0x5e, 0x1c, 0xcf, 0xba, 0xbb, 0xe3, 0x24, 0x16, 0xe2, 0xc2, - 0x27, 0x40, 0xea, 0x85, 0x13, 0xdf, 0x80, 0xaf, 0x81, 0x72, 0x44, 0xe2, 0xc6, 0x21, 0xa0, 0x88, - 0x0f, 0xc1, 0x11, 0xcd, 0x9f, 0x75, 0x76, 0xd7, 0x51, 0x08, 0xe1, 0xd8, 0x93, 0x77, 0xde, 0xbc, - 0xf7, 0x7b, 0x7f, 0x7f, 0x6f, 0x0c, 0xfa, 0x8b, 0x19, 0x89, 0xe6, 0xf6, 0x34, 0x0a, 0x59, 0x88, - 0xea, 0xdf, 0x60, 0xe2, 0x93, 0xc8, 0xc6, 0xd3, 0x60, 0xb0, 0xdf, 0x33, 0xf5, 0x49, 0xe8, 0x91, - 0x3d, 0x79, 0x67, 0x36, 0xfd, 0xd0, 0x0f, 0xc5, 0xa7, 0xc3, 0xbf, 0x94, 0xf4, 0x4d, 0x3f, 0x0c, - 0xfd, 0x3d, 0xe2, 0xe0, 0x69, 0xe0, 0x60, 0x4a, 0x43, 0x86, 0x59, 0x10, 0xd2, 0x58, 0xdd, 0xb6, - 0xd5, 0xad, 0x38, 0xed, 0xce, 0xbe, 0x76, 0x58, 0x30, 0x21, 0x31, 0xc3, 0x93, 0xa9, 0x52, 0x68, - 0xe5, 0x15, 0xbc, 0x59, 0x24, 0x10, 0xe4, 0xbd, 0xf5, 0xb2, 0x00, 0x57, 0xfb, 0x84, 0xed, 0x44, - 0x78, 0x48, 0x5c, 0xf2, 0x62, 0x46, 0x62, 0x86, 0xbe, 0x82, 0x0a, 0xe3, 0xe7, 0x41, 0xe0, 0x19, - 0x5a, 0x47, 0xeb, 0xd6, 0xb6, 0x3e, 0x3a, 0x3a, 0x6e, 0xbf, 0xf6, 0xfb, 0x71, 0x7b, 0xd3, 0x0f, - 0xd8, 0x68, 0xb6, 0x6b, 0x0f, 0xc3, 0x89, 0x23, 0x33, 0xe1, 0x8a, 0x01, 0xf5, 0xd5, 0xc9, 0x91, - 0xf9, 0x08, 0xb4, 0x27, 0xdb, 0x27, 0xc7, 0xed, 0xb2, 0xfa, 0x74, 0xcb, 0x02, 0xf1, 0x89, 0x87, - 0x1e, 0x02, 0xc4, 0x0c, 0x47, 0x6c, 0xc0, 0x23, 0x35, 0x0a, 0x1d, 0xad, 0xab, 0xf7, 0x4c, 0x5b, - 0x46, 0x69, 0x27, 0x51, 0xda, 0x3b, 0x49, 0x1a, 0x5b, 0x15, 0xee, 0xfa, 0x87, 0x3f, 0xda, 0x9a, - 0x5b, 0x15, 0x76, 0xfc, 0x06, 0x7d, 0x08, 0x15, 0x42, 0x3d, 0x09, 0xb1, 0xf2, 0x1f, 0x20, 0xca, - 0x84, 0x7a, 0x02, 0xe0, 0x16, 0x40, 0x84, 0x0f, 0x06, 0x22, 0xa8, 0xd8, 0x28, 0x76, 0xb4, 0x6e, - 0xc5, 0xad, 0x46, 0xf8, 0x40, 0x84, 0x1b, 0x5b, 0x8f, 0x00, 0x3d, 0x9f, 0x62, 0x1a, 0xbb, 0x24, - 0x9e, 0x86, 0x34, 0x26, 0x0f, 0x47, 0x33, 0x3a, 0x46, 0x0e, 0x94, 0x62, 0x2e, 0x35, 0xb4, 0xce, - 0x4a, 0x57, 0xef, 0x35, 0xec, 0x4c, 0x33, 0x6d, 0x6e, 0xb1, 0x55, 0xe4, 0xbe, 0x5c, 0xa9, 0x67, - 0xfd, 0xad, 0x41, 0xe3, 0x41, 0x34, 0x1c, 0x05, 0xfb, 0xe4, 0x15, 0x2b, 0xb0, 0x75, 0x1d, 0x9a, - 0xd9, 0xcc, 0x65, 0x21, 0xad, 0x5f, 0x8a, 0xd0, 0x14, 0x92, 0x2f, 0x38, 0x2b, 0x3e, 0xc7, 0x11, - 0x9e, 0x10, 0x46, 0xa2, 0x18, 0xad, 0x43, 0x2d, 0x26, 0xd1, 0x7e, 0x30, 0x24, 0x03, 0x8a, 0x27, - 0x44, 0xd4, 0xa5, 0xea, 0xea, 0x4a, 0xf6, 0x0c, 0x4f, 0x08, 0xba, 0x0d, 0x57, 0xc2, 0x29, 0x91, - 0xe3, 0x2b, 0x95, 0x0a, 0x42, 0xa9, 0xbe, 0x90, 0x0a, 0xb5, 0x07, 0x50, 0x64, 0xd8, 0x8f, 0x8d, - 0x15, 0xd1, 0xa5, 0xcd, 0x5c, 0x97, 0xce, 0x72, 0x6e, 0xef, 0x60, 0x3f, 0x7e, 0x44, 0x59, 0x34, - 0x77, 0x85, 0x29, 0xfa, 0x18, 0xae, 0x9c, 0xd6, 0x70, 0x30, 0x09, 0xa8, 0x18, 0x91, 0x8b, 0x16, - 0xa1, 0xb6, 0xa8, 0xe3, 0xd3, 0x80, 0xe6, 0xb1, 0xf0, 0xa1, 0x51, 0xba, 0x1c, 0x16, 0x3e, 0x44, - 0x8f, 0xa1, 0x96, 0xf0, 0x57, 0x44, 0xb5, 0x2a, 0x90, 0xde, 0x58, 0x42, 0xda, 0x56, 0x4a, 0x12, - 0xe8, 0x47, 0x0e, 0xa4, 0x27, 0x86, 0x3c, 0xa6, 0x0c, 0x0e, 0x3e, 0x34, 0xca, 0x97, 0xc1, 0xc1, - 0x87, 0xb2, 0x69, 0x38, 0x1a, 0x8e, 0x06, 0x1e, 0x99, 0xb2, 0x91, 0x51, 0xe9, 0x68, 0xdd, 0x12, - 0x6f, 0x1a, 0x97, 0x6d, 0x73, 0x51, 0x8e, 0x69, 0xd5, 0x1c, 0xd3, 0xcc, 0xf7, 0xa0, 0xba, 0x28, - 0x3e, 0x7a, 0x1d, 0x56, 0xc6, 0x64, 0xae, 0x5a, 0xcf, 0x3f, 0x51, 0x13, 0x4a, 0xfb, 0x78, 0x6f, - 0x96, 0x74, 0x5a, 0x1e, 0xee, 0x17, 0xee, 0x69, 0xd6, 0x33, 0xb8, 0xf6, 0x38, 0xa0, 0x9e, 0x84, - 0x49, 0x88, 0xf5, 0x3e, 0x94, 0xc4, 0xb6, 0x15, 0x10, 0x7a, 0x6f, 0xe3, 0x02, 0xbd, 0x77, 0xa5, - 0x85, 0xd5, 0x04, 0xd4, 0x27, 0xec, 0xb9, 0x1c, 0xb7, 0x04, 0xd0, 0x7a, 0x07, 0x1a, 0x19, 0xa9, - 0x9c, 0x62, 0x64, 0x42, 0x45, 0x0d, 0xa6, 0x5c, 0x06, 0x55, 0x77, 0x71, 0xb6, 0x9e, 0x42, 0xb3, - 0x4f, 0xd8, 0x67, 0xc9, 0x48, 0x2e, 0x62, 0x33, 0xa0, 0xac, 0x74, 0x54, 0x82, 0xc9, 0x11, 0xdd, - 0x84, 0x2a, 0xdf, 0x17, 0x83, 0x71, 0x40, 0x3d, 0x95, 0x68, 0x85, 0x0b, 0x3e, 0x09, 0xa8, 0x67, - 0x7d, 0x00, 0xd5, 0x05, 0x16, 0x42, 0x50, 0x4c, 0x91, 0x43, 0x7c, 0x9f, 0x6f, 0x3d, 0x87, 0xb5, - 0x5c, 0x30, 0x2a, 0x83, 0x3b, 0x29, 0x2e, 0x71, 0xd6, 0x24, 0x79, 0xe4, 0xa4, 0xe8, 0x1e, 0xc0, - 0x42, 0x12, 0x1b, 0x05, 0x41, 0x29, 0x23, 0x57, 0xd6, 0x05, 0xbc, 0x9b, 0xd2, 0xb5, 0x7e, 0xd2, - 0xe0, 0x7a, 0x9f, 0xb0, 0x6d, 0x32, 0x25, 0xd4, 0x23, 0x74, 0x18, 0x9c, 0xb6, 0x29, 0xbb, 0xa2, - 0xb4, 0xff, 0xbf, 0xa2, 0x0a, 0x97, 0x59, 0x51, 0xbb, 0x70, 0x63, 0x29, 0x3e, 0x55, 0x9d, 0x3e, - 0xd4, 0xbc, 0x94, 0x5c, 0x2d, 0xfc, 0x5b, 0xb9, 0xbc, 0x17, 0xa6, 0xf3, 0x4f, 0x03, 0x3a, 0x56, - 0xab, 0x3f, 0x63, 0xd8, 0xfb, 0xb9, 0x04, 0x35, 0x31, 0x70, 0x6a, 0x84, 0xd0, 0x18, 0x2a, 0xc9, - 0x73, 0x8b, 0x5a, 0x39, 0xbc, 0xdc, 0x3b, 0x6c, 0xae, 0x9f, 0xf1, 0xc0, 0x64, 0x9f, 0x24, 0xcb, - 0xfc, 0xfe, 0xb7, 0xbf, 0x5e, 0x16, 0x9a, 0x08, 0x39, 0x92, 0x60, 0xce, 0xb7, 0xc9, 0xc3, 0xf2, - 0xdd, 0x5d, 0x0d, 0x31, 0xa8, 0xa5, 0x97, 0x30, 0xb2, 0x72, 0x80, 0x67, 0xbc, 0x4d, 0xe6, 0xc6, - 0xb9, 0x3a, 0x6a, 0x8b, 0xdf, 0x14, 0x6e, 0xd7, 0xac, 0x86, 0x83, 0xe5, 0x75, 0xca, 0x2f, 0xf2, - 0x01, 0x4e, 0x99, 0x89, 0x3a, 0x39, 0xbc, 0x25, 0xd2, 0x5e, 0x24, 0x4d, 0x24, 0xfc, 0xd5, 0xac, - 0xb2, 0x23, 0x57, 0xcb, 0x7d, 0xed, 0xed, 0xbb, 0x1a, 0xf2, 0x41, 0x4f, 0x91, 0x13, 0xad, 0x2f, - 0x97, 0x33, 0x47, 0x67, 0xd3, 0x3a, 0x4f, 0x45, 0xe5, 0x76, 0x4d, 0xf8, 0xd2, 0x51, 0xd5, 0x49, - 0x28, 0x8d, 0x42, 0xa8, 0x67, 0x58, 0x84, 0x36, 0x96, 0x71, 0x96, 0x08, 0x6f, 0xbe, 0x75, 0xbe, - 0x92, 0x72, 0xd7, 0x10, 0xee, 0xea, 0x48, 0x77, 0x4e, 0xb9, 0x83, 0x0e, 0xc4, 0x9f, 0xb2, 0xf4, - 0x68, 0xa2, 0xdb, 0xcb, 0x68, 0x67, 0x50, 0xcb, 0xbc, 0xf3, 0x6f, 0x6a, 0xca, 0xed, 0x9a, 0x70, - 0x7b, 0x15, 0xd5, 0x9d, 0xf4, 0xbc, 0x6e, 0x6d, 0x1e, 0x9d, 0xb4, 0xb4, 0x5f, 0x4f, 0x5a, 0xda, - 0x9f, 0x27, 0x2d, 0x0d, 0x6e, 0x04, 0xa1, 0x9d, 0xf9, 0x17, 0xa2, 0x50, 0xbf, 0x5c, 0x95, 0xbf, - 0xbb, 0xab, 0x82, 0x69, 0xef, 0xfe, 0x13, 0x00, 0x00, 0xff, 0xff, 0x43, 0x45, 0x1e, 0x73, 0xe4, - 0x0a, 0x00, 0x00, -} - -// 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 - // QueryServiceClient is the client API for QueryService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type QueryServiceClient = jaegerIdlModel.QueryServiceClient - -type queryServiceClient struct { - cc *grpc.ClientConn -} - func NewQueryServiceClient(cc *grpc.ClientConn) QueryServiceClient { - return &queryServiceClient{cc} -} - -func (c *queryServiceClient) GetTrace(ctx context.Context, in *GetTraceRequest, opts ...grpc.CallOption) (QueryService_GetTraceClient, error) { - stream, err := c.cc.NewStream(ctx, &_QueryService_serviceDesc.Streams[0], "/jaeger.api_v2.QueryService/GetTrace", opts...) - if err != nil { - return nil, err - } - x := &queryServiceGetTraceClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil + return jaegerIdlModel.NewQueryServiceClient(cc) } type QueryService_GetTraceClient = jaegerIdlModel.QueryService_GetTraceClient -type queryServiceGetTraceClient struct { - grpc.ClientStream -} - -func (x *queryServiceGetTraceClient) Recv() (*SpansResponseChunk, error) { - m := new(SpansResponseChunk) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryServiceClient) ArchiveTrace(ctx context.Context, in *ArchiveTraceRequest, opts ...grpc.CallOption) (*ArchiveTraceResponse, error) { - out := new(ArchiveTraceResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.QueryService/ArchiveTrace", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryServiceClient) FindTraces(ctx context.Context, in *FindTracesRequest, opts ...grpc.CallOption) (QueryService_FindTracesClient, error) { - stream, err := c.cc.NewStream(ctx, &_QueryService_serviceDesc.Streams[1], "/jaeger.api_v2.QueryService/FindTraces", opts...) - if err != nil { - return nil, err - } - x := &queryServiceFindTracesClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - type QueryService_FindTracesClient = jaegerIdlModel.QueryService_FindTracesClient -type queryServiceFindTracesClient struct { - grpc.ClientStream -} - -func (x *queryServiceFindTracesClient) Recv() (*SpansResponseChunk, error) { - m := new(SpansResponseChunk) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *queryServiceClient) GetServices(ctx context.Context, in *GetServicesRequest, opts ...grpc.CallOption) (*GetServicesResponse, error) { - out := new(GetServicesResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.QueryService/GetServices", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryServiceClient) GetOperations(ctx context.Context, in *GetOperationsRequest, opts ...grpc.CallOption) (*GetOperationsResponse, error) { - out := new(GetOperationsResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.QueryService/GetOperations", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *queryServiceClient) GetDependencies(ctx context.Context, in *GetDependenciesRequest, opts ...grpc.CallOption) (*GetDependenciesResponse, error) { - out := new(GetDependenciesResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.QueryService/GetDependencies", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // QueryServiceServer is the server API for QueryService service. type QueryServiceServer = jaegerIdlModel.QueryServiceServer - // UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. type UnimplementedQueryServiceServer = jaegerIdlModel.UnimplementedQueryServiceServer - - - func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { - jaegerIdlModel.RegisterQueryServiceServer(s,srv) -} - -func _QueryService_GetTrace_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetTraceRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(QueryServiceServer).GetTrace(m, &queryServiceGetTraceServer{stream}) + jaegerIdlModel.RegisterQueryServiceServer(s, srv) } type QueryService_GetTraceServer = jaegerIdlModel.QueryService_GetTraceServer - -type queryServiceGetTraceServer struct { - grpc.ServerStream -} - -func (x *queryServiceGetTraceServer) Send(m *SpansResponseChunk) error { - return x.ServerStream.SendMsg(m) -} - -func _QueryService_ArchiveTrace_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ArchiveTraceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServiceServer).ArchiveTrace(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.QueryService/ArchiveTrace", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServiceServer).ArchiveTrace(ctx, req.(*ArchiveTraceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QueryService_FindTraces_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(FindTracesRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(QueryServiceServer).FindTraces(m, &queryServiceFindTracesServer{stream}) -} - type QueryService_FindTracesServer = jaegerIdlModel.QueryService_FindTracesServer -type queryServiceFindTracesServer struct { - grpc.ServerStream -} - -func (x *queryServiceFindTracesServer) Send(m *SpansResponseChunk) error { - return x.ServerStream.SendMsg(m) -} - -func _QueryService_GetServices_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetServicesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServiceServer).GetServices(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.QueryService/GetServices", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServiceServer).GetServices(ctx, req.(*GetServicesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QueryService_GetOperations_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetOperationsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServiceServer).GetOperations(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.QueryService/GetOperations", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServiceServer).GetOperations(ctx, req.(*GetOperationsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _QueryService_GetDependencies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetDependenciesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServiceServer).GetDependencies(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.QueryService/GetDependencies", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServiceServer).GetDependencies(ctx, req.(*GetDependenciesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _QueryService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "jaeger.api_v2.QueryService", - HandlerType: (*QueryServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ArchiveTrace", - Handler: _QueryService_ArchiveTrace_Handler, - }, - { - MethodName: "GetServices", - Handler: _QueryService_GetServices_Handler, - }, - { - MethodName: "GetOperations", - Handler: _QueryService_GetOperations_Handler, - }, - { - MethodName: "GetDependencies", - Handler: _QueryService_GetDependencies_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "GetTrace", - Handler: _QueryService_GetTrace_Handler, - ServerStreams: true, - }, - { - StreamName: "FindTraces", - Handler: _QueryService_FindTraces_Handler, - ServerStreams: true, - }, - }, - Metadata: "query.proto", -} - - - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - 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, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - var ( ErrInvalidLengthQuery = jaegerIdlModel.ErrInvalidLengthQuery ErrIntOverflowQuery = jaegerIdlModel.ErrIntOverflowQuery diff --git a/proto-gen/api_v2/sampling.go b/proto-gen/api_v2/sampling.go index de7cf0a2807..96e721f67da 100644 --- a/proto-gen/api_v2/sampling.go +++ b/proto-gen/api_v2/sampling.go @@ -1,326 +1,67 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: sampling.proto - package api_v2 import ( - context "context" - fmt "fmt" _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - grpc "google.golang.org/grpc" - io "io" - math "math" - math_bits "math/bits" jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" + grpc "google.golang.org/grpc" ) -// Reference imports to suppress errors if they are not otherwise used. -var _ = 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package - // See description of the SamplingStrategyResponse.strategyType field. type SamplingStrategyType = jaegerIdlModel.SamplingStrategyType const ( - SamplingStrategyType_PROBABILISTIC SamplingStrategyType = 0 - SamplingStrategyType_RATE_LIMITING SamplingStrategyType = 1 + SamplingStrategyType_PROBABILISTIC SamplingStrategyType = jaegerIdlModel.SamplingStrategyType_PROBABILISTIC + SamplingStrategyType_RATE_LIMITING SamplingStrategyType = jaegerIdlModel.SamplingStrategyType_RATE_LIMITING ) var SamplingStrategyType_name = jaegerIdlModel.SamplingStrategyType_name var SamplingStrategyType_value = jaegerIdlModel.SamplingStrategyType_value - - // ProbabilisticSamplingStrategy samples traces with a fixed probability. type ProbabilisticSamplingStrategy = jaegerIdlModel.ProbabilisticSamplingStrategy - - -var xxx_messageInfo_ProbabilisticSamplingStrategy proto.InternalMessageInfo - - // RateLimitingSamplingStrategy samples a fixed number of traces per time interval. // The typical implementations use the leaky bucket algorithm. type RateLimitingSamplingStrategy = jaegerIdlModel.RateLimitingSamplingStrategy - - -var xxx_messageInfo_RateLimitingSamplingStrategy proto.InternalMessageInfo - - // OperationSamplingStrategy is a sampling strategy for a given operation // (aka endpoint, span name). Only probabilistic sampling is currently supported. type OperationSamplingStrategy = jaegerIdlModel.OperationSamplingStrategy - - -var xxx_messageInfo_OperationSamplingStrategy proto.InternalMessageInfo - - - // PerOperationSamplingStrategies is a combination of strategies for different endpoints // as well as some service-wide defaults. It is particularly useful for services whose // endpoints receive vastly different traffic, so that any single rate of sampling would // result in either too much data for some endpoints or almost no data for other endpoints. type PerOperationSamplingStrategies = jaegerIdlModel.PerOperationSamplingStrategies - - - // SamplingStrategyResponse contains an overall sampling strategy for a given service. // This type should = jaegerIdlModel.should as a union where only one of the strategy field is present. type SamplingStrategyResponse = jaegerIdlModel.SamplingStrategyResponse - - // SamplingStrategyParameters defines request parameters for remote sampler. type SamplingStrategyParameters = jaegerIdlModel.SamplingStrategyParameters - - -var xxx_messageInfo_SamplingStrategyParameters proto.InternalMessageInfo - - - -func init() { - //proto.RegisterEnum("jaeger.api_v2.SamplingStrategyType", SamplingStrategyType_name, SamplingStrategyType_value) - proto.RegisterType((*ProbabilisticSamplingStrategy)(nil), "jaeger.api_v2.ProbabilisticSamplingStrategy") - proto.RegisterType((*RateLimitingSamplingStrategy)(nil), "jaeger.api_v2.RateLimitingSamplingStrategy") - proto.RegisterType((*OperationSamplingStrategy)(nil), "jaeger.api_v2.OperationSamplingStrategy") - proto.RegisterType((*PerOperationSamplingStrategies)(nil), "jaeger.api_v2.PerOperationSamplingStrategies") - proto.RegisterType((*SamplingStrategyResponse)(nil), "jaeger.api_v2.SamplingStrategyResponse") - proto.RegisterType((*SamplingStrategyParameters)(nil), "jaeger.api_v2.SamplingStrategyParameters") -} - -func init() { proto.RegisterFile("sampling.proto", fileDescriptor_79c798842d009798) } - -var fileDescriptor_79c798842d009798 = []byte{ - // 569 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x54, 0x41, 0x6f, 0x12, 0x41, - 0x14, 0x76, 0x40, 0x9b, 0xf4, 0xd1, 0xd6, 0x76, 0xac, 0xba, 0x12, 0x4a, 0xc8, 0xf6, 0x20, 0x56, - 0x0b, 0xc9, 0x7a, 0x33, 0xa6, 0x49, 0x69, 0x0c, 0x59, 0x43, 0x29, 0x59, 0xf0, 0xa2, 0x07, 0x1c, - 0xe0, 0xb9, 0x19, 0x03, 0x3b, 0x9b, 0x99, 0x29, 0xca, 0xd5, 0xc4, 0xab, 0x17, 0xcf, 0x5e, 0xfc, - 0x35, 0x1e, 0x4d, 0xbc, 0x79, 0x32, 0xc4, 0x1f, 0x62, 0x76, 0x59, 0x5a, 0x58, 0x16, 0xb8, 0x79, - 0xda, 0xcd, 0x7b, 0xdf, 0x7c, 0xdf, 0xf7, 0xde, 0xbc, 0x79, 0xb0, 0xa3, 0xd8, 0xc0, 0xef, 0x73, - 0xcf, 0x2d, 0xf9, 0x52, 0x68, 0x41, 0xb7, 0xdf, 0x33, 0x74, 0x51, 0x96, 0x98, 0xcf, 0xdb, 0x43, - 0x2b, 0xbb, 0xef, 0x0a, 0x57, 0x84, 0x99, 0x72, 0xf0, 0x37, 0x01, 0x65, 0x73, 0xae, 0x10, 0x6e, - 0x1f, 0xcb, 0xcc, 0xe7, 0x65, 0xe6, 0x79, 0x42, 0x33, 0xcd, 0x85, 0xa7, 0x26, 0x59, 0xf3, 0x0c, - 0x0e, 0x1a, 0x52, 0x74, 0x58, 0x87, 0xf7, 0xb9, 0xd2, 0xbc, 0xdb, 0x8c, 0x14, 0x9a, 0x5a, 0x32, - 0x8d, 0xee, 0x88, 0x9a, 0xb0, 0x35, 0x55, 0x75, 0x98, 0x46, 0x83, 0x14, 0x48, 0x91, 0x38, 0x73, - 0x31, 0xb3, 0x0e, 0xb9, 0xe0, 0x5b, 0xe3, 0x03, 0xae, 0x83, 0xb3, 0x71, 0x8e, 0x12, 0xd0, 0x01, - 0xfb, 0xd8, 0x92, 0xac, 0x8b, 0xaa, 0x81, 0xb2, 0x89, 0x5d, 0xe1, 0xf5, 0x42, 0xa6, 0x5b, 0x4e, - 0x42, 0xc6, 0xfc, 0x46, 0xe0, 0xc1, 0x85, 0x8f, 0x32, 0x74, 0xba, 0xc0, 0x96, 0x83, 0x4d, 0x31, - 0x4d, 0x86, 0x24, 0x9b, 0xce, 0x75, 0x80, 0x76, 0xe0, 0xae, 0x9f, 0x54, 0x90, 0x91, 0x2a, 0x90, - 0x62, 0xc6, 0x7a, 0x52, 0x9a, 0xeb, 0x59, 0x69, 0x65, 0xf1, 0x4e, 0x32, 0x95, 0xf9, 0x3b, 0x05, - 0xf9, 0x06, 0xca, 0x65, 0x16, 0x39, 0x2a, 0x7a, 0x02, 0xd9, 0x1e, 0xbe, 0x63, 0x97, 0x7d, 0x3d, - 0x4d, 0x5e, 0x29, 0xe9, 0x51, 0xd4, 0xc4, 0x15, 0x08, 0xfa, 0x12, 0x0a, 0x51, 0xb6, 0x26, 0x3e, - 0xa0, 0xac, 0x88, 0x4b, 0xaf, 0x17, 0x6f, 0x60, 0x2a, 0x64, 0x59, 0x8b, 0xa3, 0x6f, 0xe1, 0x9e, - 0x3f, 0xeb, 0xf6, 0xca, 0xa5, 0x91, 0x2e, 0xa4, 0x8b, 0x19, 0xab, 0x18, 0xeb, 0xc9, 0xd2, 0xd6, - 0x3b, 0x4b, 0x78, 0x66, 0xdc, 0xbe, 0xf2, 0xfd, 0x25, 0x6e, 0x6f, 0xce, 0xb9, 0x5d, 0x8a, 0x33, - 0x3f, 0xa7, 0xc1, 0x58, 0x10, 0x46, 0xe5, 0x0b, 0x4f, 0x21, 0xad, 0xc2, 0x96, 0x8a, 0x62, 0xad, - 0x91, 0x3f, 0x99, 0xc6, 0x1d, 0xeb, 0x30, 0x56, 0x40, 0xfc, 0x78, 0x00, 0x75, 0xe6, 0x0e, 0xfe, - 0x8f, 0x31, 0xa1, 0x6d, 0xd8, 0x97, 0x09, 0xcf, 0xc2, 0x48, 0x87, 0x12, 0x8f, 0x63, 0x12, 0xab, - 0x5e, 0x90, 0x93, 0x48, 0x44, 0xdf, 0xc0, 0x9e, 0x88, 0xdf, 0x55, 0xd8, 0xe7, 0x8c, 0x75, 0x1c, - 0x2f, 0x60, 0xe5, 0xb8, 0x3a, 0x8b, 0x3c, 0xe6, 0x09, 0x64, 0xe3, 0x36, 0x1a, 0x4c, 0xb2, 0x01, - 0x6a, 0x94, 0x8a, 0x16, 0x20, 0xa3, 0x50, 0x0e, 0x79, 0x17, 0xeb, 0x6c, 0x80, 0xd1, 0x33, 0x9c, - 0x0d, 0x1d, 0x3d, 0x87, 0xfd, 0xa4, 0x7b, 0xa0, 0x7b, 0xb0, 0xdd, 0x70, 0x2e, 0x2a, 0xa7, 0x15, - 0xbb, 0x66, 0x37, 0x5b, 0xf6, 0xd9, 0xee, 0x8d, 0x20, 0xe4, 0x9c, 0xb6, 0x5e, 0xb4, 0x6b, 0xf6, - 0xb9, 0xdd, 0xb2, 0xeb, 0xd5, 0x5d, 0x62, 0x7d, 0x27, 0x70, 0x7b, 0x7a, 0xfc, 0x9c, 0x79, 0xcc, - 0x45, 0x49, 0xbf, 0x10, 0xb8, 0x53, 0x45, 0xbd, 0xb0, 0x10, 0x1e, 0xad, 0xb9, 0xfe, 0x6b, 0xdb, - 0xd9, 0x87, 0x6b, 0xa0, 0xd3, 0x41, 0x33, 0x0f, 0x3f, 0xfd, 0xfa, 0xfb, 0x35, 0x75, 0x60, 0x1a, - 0xe1, 0xde, 0x1c, 0x5a, 0x65, 0x15, 0x43, 0x3e, 0x23, 0x47, 0x95, 0xe3, 0x1f, 0xe3, 0x3c, 0xf9, - 0x39, 0xce, 0x93, 0x3f, 0xe3, 0x3c, 0x81, 0xfb, 0x5c, 0x44, 0xec, 0x5a, 0xb2, 0x6e, 0xb0, 0xa5, - 0x27, 0x22, 0xaf, 0x37, 0x26, 0xdf, 0xce, 0x46, 0xb8, 0x72, 0x9f, 0xfe, 0x0b, 0x00, 0x00, 0xff, - 0xff, 0xf1, 0xcc, 0x49, 0x9b, 0xc7, 0x05, 0x00, 0x00, -} - -// 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 - // 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 = jaegerIdlModel.SamplingManagerClient - -type samplingManagerClient struct { - cc *grpc.ClientConn -} - - func NewSamplingManagerClient(cc *grpc.ClientConn) SamplingManagerClient { return jaegerIdlModel.NewSamplingManagerClient(cc) } -func (c *samplingManagerClient) GetSamplingStrategy(ctx context.Context, in *SamplingStrategyParameters, opts ...grpc.CallOption) (*SamplingStrategyResponse, error) { - out := new(SamplingStrategyResponse) - err := c.cc.Invoke(ctx, "/jaeger.api_v2.SamplingManager/GetSamplingStrategy", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // SamplingManagerServer is the server API for SamplingManager service. type SamplingManagerServer = jaegerIdlModel.SamplingManagerServer // UnimplementedSamplingManagerServer can be embedded to have forward compatible implementations. type UnimplementedSamplingManagerServer = jaegerIdlModel.UnimplementedSamplingManagerServer - - - func RegisterSamplingManagerServer(s *grpc.Server, srv SamplingManagerServer) { jaegerIdlModel.RegisterSamplingManagerServer(s, srv) } -func _SamplingManager_GetSamplingStrategy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SamplingStrategyParameters) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SamplingManagerServer).GetSamplingStrategy(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/jaeger.api_v2.SamplingManager/GetSamplingStrategy", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SamplingManagerServer).GetSamplingStrategy(ctx, req.(*SamplingStrategyParameters)) - } - return interceptor(ctx, in, info, handler) -} - -var _SamplingManager_serviceDesc = grpc.ServiceDesc{ - ServiceName: "jaeger.api_v2.SamplingManager", - HandlerType: (*SamplingManagerServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetSamplingStrategy", - Handler: _SamplingManager_GetSamplingStrategy_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "sampling.proto", -} - - - -func encodeVarintSampling(dAtA []byte, offset int, v uint64) int { - offset -= sovSampling(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} - - -func sovSampling(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozSampling(x uint64) (n int) { - return sovSampling(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} - -func skipSampling(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSampling - } - 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, ErrIntOverflowSampling - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowSampling - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthSampling - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupSampling - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthSampling - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - var ( ErrInvalidLengthSampling = jaegerIdlModel.ErrInvalidLengthSampling ErrIntOverflowSampling = jaegerIdlModel.ErrIntOverflowSampling From 86f8ad62f25a575a722c0e98b8a241b4bd398332 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 03:22:39 +0200 Subject: [PATCH 07/11] fix: proto unneccesary generate Signed-off-by: nabil salah --- Makefile.Protobuf.mk | 13 +---- model/flags.go | 10 ++-- model/hash.go | 6 +-- model/ids.go | 22 ++++---- model/keyvalue.go | 46 +++++++---------- model/model.go | 52 +++++++------------ model/process.go | 6 +-- model/sort.go | 18 ++----- model/span.go | 8 ++- model/spanref.go | 14 ++--- model/time.go | 20 ++------ plugin/storage/grpc/proto/storage.proto | 6 +-- proto-gen/api_v2/collector.go | 27 ++++------ proto-gen/api_v2/query.go | 68 ++++++++++--------------- proto-gen/api_v2/sampling.go | 47 ++++++++--------- 15 files changed, 135 insertions(+), 228 deletions(-) diff --git a/Makefile.Protobuf.mk b/Makefile.Protobuf.mk index e0d1d5a06d8..c8520f96d5e 100644 --- a/Makefile.Protobuf.mk +++ b/Makefile.Protobuf.mk @@ -78,18 +78,12 @@ define proto_compile endef .PHONY: proto -proto: proto-model \ - proto-api-v2 \ - proto-storage-v1 \ +proto: proto-storage-v1 \ proto-hotrod \ proto-zipkin \ proto-openmetrics \ proto-api-v3 -.PHONY: proto-model -proto-model: - $(call proto_compile, model, idl/proto/api_v2/model.proto) - $(PROTOC) -Imodel/proto --go_out=$(PWD)/model/ model/proto/model_test.proto API_V2_PATCHED_DIR=proto-gen/.patched/api_v2 .PHONY: patch-api-v2 @@ -99,11 +93,6 @@ patch-api-v2: cp idl/proto/api_v2/sampling.proto $(API_V2_PATCHED_DIR)/ cat idl/proto/api_v2/query.proto | $(SED) 's|jaegertracing/jaeger-idl/model/v1.|jaegertracing/jaeger/model.|g' > $(API_V2_PATCHED_DIR)/query.proto -.PHONY: proto-api-v2 -proto-api-v2: patch-api-v2 - $(call proto_compile, proto-gen/api_v2, $(API_V2_PATCHED_DIR)/query.proto) - $(call proto_compile, proto-gen/api_v2, $(API_V2_PATCHED_DIR)/collector.proto) - $(call proto_compile, proto-gen/api_v2, $(API_V2_PATCHED_DIR)/sampling.proto) .PHONY: proto-openmetrics proto-openmetrics: diff --git a/model/flags.go b/model/flags.go index a12b8b42a0a..163c3967041 100644 --- a/model/flags.go +++ b/model/flags.go @@ -5,17 +5,17 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) const ( // SampledFlag is the bit set in Flags in order to define a span as a sampled span - SampledFlag = jaegerIdlModel.SampledFlag + SampledFlag = modelv1.SampledFlag // DebugFlag is the bit set in Flags in order to define a span as a debug span - DebugFlag = jaegerIdlModel.SampledFlag + DebugFlag = modelv1.SampledFlag // FirehoseFlag is the bit in Flags in order to define a span as a firehose span - FirehoseFlag = jaegerIdlModel.SampledFlag + FirehoseFlag = modelv1.SampledFlag ) // Flags is a bit map of flags for a span -type Flags = jaegerIdlModel.Flags +type Flags = modelv1.Flags diff --git a/model/hash.go b/model/hash.go index dc87ab73244..0ee818b2cb1 100644 --- a/model/hash.go +++ b/model/hash.go @@ -5,14 +5,14 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) // Hashable interface is for type that can participate in a hash computation // by writing their data into io.Writer, which is usually an instance of hash.Hash. -type Hashable = jaegerIdlModel.Hashable +type Hashable = modelv1.Hashable // HashCode calculates a FNV-1a hash code for a Hashable object. func HashCode(o Hashable) (uint64, error) { - return jaegerIdlModel.HashCode(o) + return modelv1.HashCode(o) } diff --git a/model/ids.go b/model/ids.go index 8eddfa2eb58..d47bf880d52 100644 --- a/model/ids.go +++ b/model/ids.go @@ -5,7 +5,7 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) const ( @@ -14,41 +14,37 @@ const ( ) // TraceID is a random 128bit identifier for a trace -type TraceID = jaegerIdlModel.TraceID +type TraceID = modelv1.TraceID // SpanID is a random 64bit identifier for a span -type SpanID = jaegerIdlModel.SpanID +type SpanID = modelv1.SpanID // ------- TraceID ------- // NewTraceID creates a new TraceID from two 64bit unsigned ints. -func NewTraceID(high, low uint64) TraceID { - return jaegerIdlModel.NewTraceID(high, low) -} +var NewTraceID = modelv1.NewTraceID // TraceIDFromString creates a TraceID from a hexadecimal string func TraceIDFromString(s string) (TraceID, error) { - return jaegerIdlModel.TraceIDFromString(s) + return modelv1.TraceIDFromString(s) } // TraceIDFromBytes creates a TraceID from list of bytes func TraceIDFromBytes(data []byte) (TraceID, error) { - return jaegerIdlModel.TraceIDFromBytes(data) + return modelv1.TraceIDFromBytes(data) } // ------- SpanID ------- // NewSpanID creates a new SpanID from a 64bit unsigned int. -func NewSpanID(v uint64) SpanID { - return jaegerIdlModel.NewSpanID(v) -} +var NewSpanID = modelv1.NewSpanID // SpanIDFromString creates a SpanID from a hexadecimal string func SpanIDFromString(s string) (SpanID, error) { - return jaegerIdlModel.SpanIDFromString(s) + return modelv1.SpanIDFromString(s) } // SpanIDFromBytes creates a SpandID from list of bytes func SpanIDFromBytes(data []byte) (SpanID, error) { - return jaegerIdlModel.SpanIDFromBytes(data) + return modelv1.SpanIDFromBytes(data) } diff --git a/model/keyvalue.go b/model/keyvalue.go index b30e6374bdf..c2b8818b067 100644 --- a/model/keyvalue.go +++ b/model/keyvalue.go @@ -5,7 +5,7 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) // These constants are kept mostly for backwards compatibility. @@ -21,50 +21,40 @@ const ( // BinaryType indicates the value is binary blob stored as a byte array BinaryType = ValueType_BINARY - SpanKindKey = jaegerIdlModel.SpanKindKey - SamplerTypeKey = jaegerIdlModel.SamplerTypeKey - SamplerParamKey = jaegerIdlModel.SamplerParamKey + SpanKindKey = modelv1.SpanKindKey + SamplerTypeKey = modelv1.SamplerTypeKey + SamplerParamKey = modelv1.SamplerParamKey ) -type SpanKind = jaegerIdlModel.SpanKind +type SpanKind = modelv1.SpanKind const ( - SpanKindClient SpanKind = jaegerIdlModel.SpanKindClient - SpanKindServer SpanKind = jaegerIdlModel.SpanKindServer - SpanKindProducer SpanKind = jaegerIdlModel.SpanKindProducer - SpanKindConsumer SpanKind = jaegerIdlModel.SpanKindConsumer - SpanKindInternal SpanKind = jaegerIdlModel.SpanKindInternal - SpanKindUnspecified SpanKind = jaegerIdlModel.SpanKindUnspecified + SpanKindClient SpanKind = modelv1.SpanKindClient + SpanKindServer SpanKind = modelv1.SpanKindServer + SpanKindProducer SpanKind = modelv1.SpanKindProducer + SpanKindConsumer SpanKind = modelv1.SpanKindConsumer + SpanKindInternal SpanKind = modelv1.SpanKindInternal + SpanKindUnspecified SpanKind = modelv1.SpanKindUnspecified ) func SpanKindFromString(kind string) (SpanKind, error) { - return jaegerIdlModel.SpanKindFromString(kind) + return modelv1.SpanKindFromString(kind) } // KeyValues is a type alias that exposes convenience functions like Sort, FindByKey. -type KeyValues = jaegerIdlModel.KeyValues +type KeyValues = modelv1.KeyValues // String creates a String-typed KeyValue -func String(key string, value string) KeyValue { - return jaegerIdlModel.String(key, value) -} +var String = modelv1.String // Bool creates a Bool-typed KeyValue -func Bool(key string, value bool) KeyValue { - return jaegerIdlModel.Bool(key, value) -} +var Bool = modelv1.Bool // Int64 creates a Int64-typed KeyValue -func Int64(key string, value int64) KeyValue { - return jaegerIdlModel.Int64(key, value) -} +var Int64 = modelv1.Int64 // Float64 creates a Float64-typed KeyValue -func Float64(key string, value float64) KeyValue { - return jaegerIdlModel.Float64(key, value) -} +var Float64 = modelv1.Float64 // Binary creates a Binary-typed KeyValue -func Binary(key string, value []byte) KeyValue { - return jaegerIdlModel.Binary(key, value) -} +var Binary = modelv1.Binary diff --git a/model/model.go b/model/model.go index 11defc46315..6eff24141f7 100644 --- a/model/model.go +++ b/model/model.go @@ -4,7 +4,7 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) // This is a compile-time assertion to ensure that this generated file @@ -12,44 +12,36 @@ import ( // A compilation error at this line likely means your copy of the // proto package needs to be updated. -type ValueType = jaegerIdlModel.ValueType +type ValueType = modelv1.ValueType const ( - ValueType_STRING ValueType = jaegerIdlModel.ValueType_STRING - ValueType_BOOL ValueType = jaegerIdlModel.ValueType_BOOL - ValueType_INT64 ValueType = jaegerIdlModel.ValueType_INT64 - ValueType_FLOAT64 ValueType = jaegerIdlModel.ValueType_FLOAT64 - ValueType_BINARY ValueType = jaegerIdlModel.ValueType_BINARY + ValueType_STRING ValueType = modelv1.ValueType_STRING + ValueType_BOOL ValueType = modelv1.ValueType_BOOL + ValueType_INT64 ValueType = modelv1.ValueType_INT64 + ValueType_FLOAT64 ValueType = modelv1.ValueType_FLOAT64 + ValueType_BINARY ValueType = modelv1.ValueType_BINARY ) -var ValueType_name = jaegerIdlModel.ValueType_name - -var ValueType_value = jaegerIdlModel.ValueType_value - -type SpanRefType = jaegerIdlModel.SpanRefType +type SpanRefType = modelv1.SpanRefType const ( - SpanRefType_CHILD_OF SpanRefType = jaegerIdlModel.SpanRefType_CHILD_OF - SpanRefType_FOLLOWS_FROM SpanRefType = jaegerIdlModel.SpanRefType_FOLLOWS_FROM + SpanRefType_CHILD_OF SpanRefType = modelv1.SpanRefType_CHILD_OF + SpanRefType_FOLLOWS_FROM SpanRefType = modelv1.SpanRefType_FOLLOWS_FROM ) -var SpanRefType_name = jaegerIdlModel.SpanRefType_name - -var SpanRefType_value = jaegerIdlModel.SpanRefType_value +type KeyValue = modelv1.KeyValue -type KeyValue = jaegerIdlModel.KeyValue +type Log = modelv1.Log -type Log = jaegerIdlModel.Log +type SpanRef = modelv1.SpanRef -type SpanRef = jaegerIdlModel.SpanRef +type Process = modelv1.Process -type Process = jaegerIdlModel.Process +type Span = modelv1.Span -type Span = jaegerIdlModel.Span +type Trace = modelv1.Trace -type Trace = jaegerIdlModel.Trace - -type Trace_ProcessMapping = jaegerIdlModel.Trace_ProcessMapping +type Trace_ProcessMapping = modelv1.Trace_ProcessMapping // Note that both Span and Batch may contain a Process. // This is different from the Thrift model which was only used @@ -60,12 +52,6 @@ type Trace_ProcessMapping = jaegerIdlModel.Trace_ProcessMapping // semantics, both Batch and Spans in the same message may contain // their own instances of Process, with span.Process taking priority // over batch.Process. -type Batch = jaegerIdlModel.Batch - -type DependencyLink = jaegerIdlModel.DependencyLink +type Batch = modelv1.Batch -var ( - ErrInvalidLengthModel = jaegerIdlModel.ErrInvalidLengthModel - ErrIntOverflowModel = jaegerIdlModel.ErrIntOverflowModel - ErrUnexpectedEndOfGroupModel = jaegerIdlModel.ErrUnexpectedEndOfGroupModel -) +type DependencyLink = modelv1.DependencyLink diff --git a/model/process.go b/model/process.go index cb504f5803e..84ac2e36f52 100644 --- a/model/process.go +++ b/model/process.go @@ -5,13 +5,11 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) // NewProcess creates a new Process for given serviceName and tags. // The tags are sorted in place and kept in the same array/slice, // in order to store the Process in a canonical form that is relied // upon by the Equal and Hash functions. -func NewProcess(serviceName string, tags []KeyValue) *Process { - return jaegerIdlModel.NewProcess(serviceName, tags) -} +var NewProcess = modelv1.NewProcess diff --git a/model/sort.go b/model/sort.go index 9922adc3473..b58b4a35341 100644 --- a/model/sort.go +++ b/model/sort.go @@ -5,25 +5,17 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) // SortTraceIDs sorts a list of TraceIDs -func SortTraceIDs(traceIDs []*TraceID) { - jaegerIdlModel.SortTraceIDs(traceIDs) -} +var SortTraceIDs = modelv1.SortTraceIDs // SortTraces deep sorts a list of traces by TraceID. -func SortTraces(traces []*Trace) { - jaegerIdlModel.SortTraces(traces) -} +var SortTraces = modelv1.SortTraces // SortTrace deep sorts a trace's spans by SpanID. -func SortTrace(trace *Trace) { - jaegerIdlModel.SortTrace(trace) -} +var SortTrace = modelv1.SortTrace // SortSpan deep sorts a span: this sorts its tags, logs by timestamp, tags in logs, and tags in process. -func SortSpan(span *Span) { - jaegerIdlModel.SortSpan(span) -} +var SortSpan = modelv1.SortSpan diff --git a/model/span.go b/model/span.go index 45c4307ce52..4dd58b4381c 100644 --- a/model/span.go +++ b/model/span.go @@ -5,10 +5,10 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) -type SamplerType = jaegerIdlModel.SamplerType +type SamplerType = modelv1.SamplerType const ( SamplerTypeUnrecognized SamplerType = iota @@ -26,6 +26,4 @@ var toSamplerType = map[string]SamplerType{ "const": SamplerTypeConst, } -func SpanKindTag(kind SpanKind) KeyValue { - return jaegerIdlModel.SpanKindTag(kind) -} +var SpanKindTag = modelv1.SpanKindTag diff --git a/model/spanref.go b/model/spanref.go index 5ff47cf5175..66921317fe2 100644 --- a/model/spanref.go +++ b/model/spanref.go @@ -5,7 +5,7 @@ package model import ( - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) const ( @@ -22,16 +22,10 @@ const ( // We no longer store ParentSpanID in the domain model, but the data in the database // or other formats might still have these IDs without representing them in the References, // so this converts parent IDs to canonical reference format. -func MaybeAddParentSpanID(traceID TraceID, parentSpanID SpanID, refs []SpanRef) []SpanRef { - return jaegerIdlModel.MaybeAddParentSpanID(traceID, parentSpanID, refs) -} +var MaybeAddParentSpanID = modelv1.MaybeAddParentSpanID // NewChildOfRef creates a new child-of span reference. -func NewChildOfRef(traceID TraceID, spanID SpanID) SpanRef { - return jaegerIdlModel.NewChildOfRef(traceID, spanID) -} +var NewChildOfRef = modelv1.NewChildOfRef // NewFollowsFromRef creates a new follows-from span reference. -func NewFollowsFromRef(traceID TraceID, spanID SpanID) SpanRef { - return jaegerIdlModel.NewFollowsFromRef(traceID, spanID) -} +var NewFollowsFromRef = modelv1.NewFollowsFromRef diff --git a/model/time.go b/model/time.go index f5409fb45de..9e022dff1d5 100644 --- a/model/time.go +++ b/model/time.go @@ -5,29 +5,19 @@ package model import ( - "time" - - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/model/v1" + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" ) // EpochMicrosecondsAsTime converts microseconds since epoch to time.Time value. -func EpochMicrosecondsAsTime(ts uint64) time.Time { - return jaegerIdlModel.EpochMicrosecondsAsTime(ts) -} +var EpochMicrosecondsAsTime = modelv1.EpochMicrosecondsAsTime // TimeAsEpochMicroseconds converts time.Time to microseconds since epoch, // which is the format the StartTime field is stored in the Span. -func TimeAsEpochMicroseconds(t time.Time) uint64 { - return jaegerIdlModel.TimeAsEpochMicroseconds(t) -} +var TimeAsEpochMicroseconds = modelv1.TimeAsEpochMicroseconds // MicrosecondsAsDuration converts duration in microseconds to time.Duration value. -func MicrosecondsAsDuration(v uint64) time.Duration { - return jaegerIdlModel.MicrosecondsAsDuration(v) -} +var MicrosecondsAsDuration = modelv1.MicrosecondsAsDuration // DurationAsMicroseconds converts time.Duration to microseconds, // which is the format the Duration field is stored in the Span. -func DurationAsMicroseconds(d time.Duration) uint64 { - return jaegerIdlModel.DurationAsMicroseconds(d) -} +var DurationAsMicroseconds = modelv1.DurationAsMicroseconds diff --git a/plugin/storage/grpc/proto/storage.proto b/plugin/storage/grpc/proto/storage.proto index 7491b665043..50a0eebaa16 100644 --- a/plugin/storage/grpc/proto/storage.proto +++ b/plugin/storage/grpc/proto/storage.proto @@ -69,7 +69,7 @@ message CloseWriterResponse { message GetTraceRequest { bytes trace_id = 1 [ (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/jaegertracing/jaeger/model.TraceID", + (gogoproto.customtype) = "github.com/jaegertracing/jaeger-idl/model/v1.TraceID", (gogoproto.customname) = "TraceID" ]; google.protobuf.Timestamp start_time = 2 [ @@ -142,8 +142,8 @@ message FindTraceIDsRequest { message FindTraceIDsResponse { repeated bytes trace_ids = 1 [ - (gogoproto.nullable) = false, - (gogoproto.customtype) = "github.com/jaegertracing/jaeger/model.TraceID", + (gogoproto.nullable) = false,(gogoproto.customtype) = "github.com/jaegertracing/jaeger-idl/model/v1.TraceID" + , (gogoproto.customname) = "TraceIDs" ]; } diff --git a/proto-gen/api_v2/collector.go b/proto-gen/api_v2/collector.go index 16e1193679a..38544687a28 100644 --- a/proto-gen/api_v2/collector.go +++ b/proto-gen/api_v2/collector.go @@ -3,35 +3,30 @@ package api_v2 import ( _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" - grpc "google.golang.org/grpc" + modelv1 "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) -type PostSpansRequest = jaegerIdlModel.PostSpansRequest +type PostSpansRequest = modelv1.PostSpansRequest -type PostSpansResponse = jaegerIdlModel.PostSpansResponse +type PostSpansResponse = modelv1.PostSpansResponse // 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 = jaegerIdlModel.CollectorServiceClient +type CollectorServiceClient = modelv1.CollectorServiceClient -func NewCollectorServiceClient(cc *grpc.ClientConn) CollectorServiceClient { - return jaegerIdlModel.NewCollectorServiceClient(cc) -} +var NewCollectorServiceClient = modelv1.NewCollectorServiceClient // CollectorServiceServer is the server API for CollectorService service. -type CollectorServiceServer = jaegerIdlModel.CollectorServiceServer +type CollectorServiceServer = modelv1.CollectorServiceServer // UnimplementedCollectorServiceServer can be embedded to have forward compatible implementations. -type UnimplementedCollectorServiceServer = jaegerIdlModel.UnimplementedCollectorServiceServer +type UnimplementedCollectorServiceServer = modelv1.UnimplementedCollectorServiceServer -func RegisterCollectorServiceServer(s *grpc.Server, srv CollectorServiceServer) { - jaegerIdlModel.RegisterCollectorServiceServer(s, srv) -} +var RegisterCollectorServiceServer = modelv1.RegisterCollectorServiceServer var ( - ErrInvalidLengthCollector = jaegerIdlModel.ErrInvalidLengthCollector - ErrIntOverflowCollector = jaegerIdlModel.ErrIntOverflowCollector - ErrUnexpectedEndOfGroupCollector = jaegerIdlModel.ErrUnexpectedEndOfGroupCollector + ErrInvalidLengthCollector = modelv1.ErrInvalidLengthCollector + ErrIntOverflowCollector = modelv1.ErrIntOverflowCollector + ErrUnexpectedEndOfGroupCollector = modelv1.ErrUnexpectedEndOfGroupCollector ) diff --git a/proto-gen/api_v2/query.go b/proto-gen/api_v2/query.go index 699ef8c3194..18257079d10 100644 --- a/proto-gen/api_v2/query.go +++ b/proto-gen/api_v2/query.go @@ -4,77 +4,61 @@ import ( _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" _ "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" + modelv1 "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) -type GetTraceRequest = jaegerIdlModel.GetTraceRequest +type GetTraceRequest = modelv1.GetTraceRequest -type SpansResponseChunk = jaegerIdlModel.SpansResponseChunk +type SpansResponseChunk = modelv1.SpansResponseChunk -type ArchiveTraceRequest = jaegerIdlModel.ArchiveTraceRequest +type ArchiveTraceRequest = modelv1.ArchiveTraceRequest -type ArchiveTraceResponse = jaegerIdlModel.ArchiveTraceResponse +type ArchiveTraceResponse = modelv1.ArchiveTraceResponse -// Query parameters to find traces. Except for num_traces, all fields should be treated -// as forming a conjunction, e.g., "service_name='X' AND operation_name='Y' AND ...". -// All fields are matched against individual spans, not at the trace level. -// The returned results contain traces where at least one span matches the conditions. -// When num_traces results in fewer traces returned, there is no required ordering. -// -// Note: num_traces should restrict the number of traces returned, but not all backends -// interpret it this way. For instance, in Cassandra this limits the number of _spans_ -// that match the conditions, and the resulting number of traces can be less. -// -// Note: some storage implementations do not guarantee the correct implementation of all parameters. -type TraceQueryParameters = jaegerIdlModel.TraceQueryParameters +type TraceQueryParameters = modelv1.TraceQueryParameters -type FindTracesRequest = jaegerIdlModel.FindTracesRequest +type FindTracesRequest = modelv1.FindTracesRequest -type GetServicesRequest = jaegerIdlModel.GetServicesRequest +type GetServicesRequest = modelv1.GetServicesRequest -type GetServicesResponse = jaegerIdlModel.GetServicesResponse +type GetServicesResponse = modelv1.GetServicesResponse -type GetOperationsRequest = jaegerIdlModel.GetOperationsRequest +type GetOperationsRequest = modelv1.GetOperationsRequest -type Operation = jaegerIdlModel.Operation +type Operation = modelv1.Operation -type GetOperationsResponse = jaegerIdlModel.GetOperationsResponse +type GetOperationsResponse = modelv1.GetOperationsResponse -type GetDependenciesRequest = jaegerIdlModel.GetDependenciesRequest +type GetDependenciesRequest = modelv1.GetDependenciesRequest -type GetDependenciesResponse = jaegerIdlModel.GetDependenciesResponse +type GetDependenciesResponse = modelv1.GetDependenciesResponse // QueryServiceClient is the client API for QueryService service. // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryServiceClient = jaegerIdlModel.QueryServiceClient +type QueryServiceClient = modelv1.QueryServiceClient -func NewQueryServiceClient(cc *grpc.ClientConn) QueryServiceClient { - return jaegerIdlModel.NewQueryServiceClient(cc) -} +var NewQueryServiceClient = modelv1.NewQueryServiceClient -type QueryService_GetTraceClient = jaegerIdlModel.QueryService_GetTraceClient +type QueryService_GetTraceClient = modelv1.QueryService_GetTraceClient -type QueryService_FindTracesClient = jaegerIdlModel.QueryService_FindTracesClient +type QueryService_FindTracesClient = modelv1.QueryService_FindTracesClient // QueryServiceServer is the server API for QueryService service. -type QueryServiceServer = jaegerIdlModel.QueryServiceServer +type QueryServiceServer = modelv1.QueryServiceServer // UnimplementedQueryServiceServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServiceServer = jaegerIdlModel.UnimplementedQueryServiceServer +type UnimplementedQueryServiceServer = modelv1.UnimplementedQueryServiceServer -func RegisterQueryServiceServer(s *grpc.Server, srv QueryServiceServer) { - jaegerIdlModel.RegisterQueryServiceServer(s, srv) -} +var RegisterQueryServiceServer = modelv1.RegisterQueryServiceServer -type QueryService_GetTraceServer = jaegerIdlModel.QueryService_GetTraceServer +type QueryService_GetTraceServer = modelv1.QueryService_GetTraceServer -type QueryService_FindTracesServer = jaegerIdlModel.QueryService_FindTracesServer +type QueryService_FindTracesServer = modelv1.QueryService_FindTracesServer var ( - ErrInvalidLengthQuery = jaegerIdlModel.ErrInvalidLengthQuery - ErrIntOverflowQuery = jaegerIdlModel.ErrIntOverflowQuery - ErrUnexpectedEndOfGroupQuery = jaegerIdlModel.ErrUnexpectedEndOfGroupQuery + ErrInvalidLengthQuery = modelv1.ErrInvalidLengthQuery + ErrIntOverflowQuery = modelv1.ErrIntOverflowQuery + ErrUnexpectedEndOfGroupQuery = modelv1.ErrUnexpectedEndOfGroupQuery ) diff --git a/proto-gen/api_v2/sampling.go b/proto-gen/api_v2/sampling.go index 96e721f67da..79d7c7d5d68 100644 --- a/proto-gen/api_v2/sampling.go +++ b/proto-gen/api_v2/sampling.go @@ -3,67 +3,62 @@ package api_v2 import ( _ "github.com/gogo/googleapis/google/api" _ "github.com/gogo/protobuf/gogoproto" - jaegerIdlModel "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" - grpc "google.golang.org/grpc" + modelv1 "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) // See description of the SamplingStrategyResponse.strategyType field. -type SamplingStrategyType = jaegerIdlModel.SamplingStrategyType +type SamplingStrategyType = modelv1.SamplingStrategyType const ( - SamplingStrategyType_PROBABILISTIC SamplingStrategyType = jaegerIdlModel.SamplingStrategyType_PROBABILISTIC - SamplingStrategyType_RATE_LIMITING SamplingStrategyType = jaegerIdlModel.SamplingStrategyType_RATE_LIMITING + SamplingStrategyType_PROBABILISTIC SamplingStrategyType = modelv1.SamplingStrategyType_PROBABILISTIC + SamplingStrategyType_RATE_LIMITING SamplingStrategyType = modelv1.SamplingStrategyType_RATE_LIMITING ) -var SamplingStrategyType_name = jaegerIdlModel.SamplingStrategyType_name +var SamplingStrategyType_name = modelv1.SamplingStrategyType_name -var SamplingStrategyType_value = jaegerIdlModel.SamplingStrategyType_value +var SamplingStrategyType_value = modelv1.SamplingStrategyType_value // ProbabilisticSamplingStrategy samples traces with a fixed probability. -type ProbabilisticSamplingStrategy = jaegerIdlModel.ProbabilisticSamplingStrategy +type ProbabilisticSamplingStrategy = modelv1.ProbabilisticSamplingStrategy // RateLimitingSamplingStrategy samples a fixed number of traces per time interval. // The typical implementations use the leaky bucket algorithm. -type RateLimitingSamplingStrategy = jaegerIdlModel.RateLimitingSamplingStrategy +type RateLimitingSamplingStrategy = modelv1.RateLimitingSamplingStrategy // OperationSamplingStrategy is a sampling strategy for a given operation // (aka endpoint, span name). Only probabilistic sampling is currently supported. -type OperationSamplingStrategy = jaegerIdlModel.OperationSamplingStrategy +type OperationSamplingStrategy = modelv1.OperationSamplingStrategy // PerOperationSamplingStrategies is a combination of strategies for different endpoints // as well as some service-wide defaults. It is particularly useful for services whose // endpoints receive vastly different traffic, so that any single rate of sampling would // result in either too much data for some endpoints or almost no data for other endpoints. -type PerOperationSamplingStrategies = jaegerIdlModel.PerOperationSamplingStrategies +type PerOperationSamplingStrategies = modelv1.PerOperationSamplingStrategies // SamplingStrategyResponse contains an overall sampling strategy for a given service. -// This type should = jaegerIdlModel.should as a union where only one of the strategy field is present. -type SamplingStrategyResponse = jaegerIdlModel.SamplingStrategyResponse +// This type should = modelv1.should as a union where only one of the strategy field is present. +type SamplingStrategyResponse = modelv1.SamplingStrategyResponse // SamplingStrategyParameters defines request parameters for remote sampler. -type SamplingStrategyParameters = jaegerIdlModel.SamplingStrategyParameters +type SamplingStrategyParameters = modelv1.SamplingStrategyParameters // 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 = jaegerIdlModel.SamplingManagerClient +type SamplingManagerClient = modelv1.SamplingManagerClient -func NewSamplingManagerClient(cc *grpc.ClientConn) SamplingManagerClient { - return jaegerIdlModel.NewSamplingManagerClient(cc) -} +var NewSamplingManagerClient = modelv1.NewSamplingManagerClient // SamplingManagerServer is the server API for SamplingManager service. -type SamplingManagerServer = jaegerIdlModel.SamplingManagerServer +type SamplingManagerServer = modelv1.SamplingManagerServer // UnimplementedSamplingManagerServer can be embedded to have forward compatible implementations. -type UnimplementedSamplingManagerServer = jaegerIdlModel.UnimplementedSamplingManagerServer +type UnimplementedSamplingManagerServer = modelv1.UnimplementedSamplingManagerServer -func RegisterSamplingManagerServer(s *grpc.Server, srv SamplingManagerServer) { - jaegerIdlModel.RegisterSamplingManagerServer(s, srv) -} +var RegisterSamplingManagerServer = modelv1.RegisterSamplingManagerServer var ( - ErrInvalidLengthSampling = jaegerIdlModel.ErrInvalidLengthSampling - ErrIntOverflowSampling = jaegerIdlModel.ErrIntOverflowSampling - ErrUnexpectedEndOfGroupSampling = jaegerIdlModel.ErrUnexpectedEndOfGroupSampling + ErrInvalidLengthSampling = modelv1.ErrInvalidLengthSampling + ErrIntOverflowSampling = modelv1.ErrIntOverflowSampling + ErrUnexpectedEndOfGroupSampling = modelv1.ErrUnexpectedEndOfGroupSampling ) From c5a9c5a86a1dd7ef042f42b94fdbbf52ec8ddeea Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 03:38:14 +0200 Subject: [PATCH 08/11] fix: storage proto Signed-off-by: nabil salah --- proto-gen/storage_v1/storage.pb.go | 168 ++++++++++++++--------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/proto-gen/storage_v1/storage.pb.go b/proto-gen/storage_v1/storage.pb.go index 72e11ee49ce..cd577dc5d60 100644 --- a/proto-gen/storage_v1/storage.pb.go +++ b/proto-gen/storage_v1/storage.pb.go @@ -10,7 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - github_com_jaegertracing_jaeger_model "github.com/jaegertracing/jaeger/model" + github_com_jaegertracing_jaeger_idl_model_v1 "github.com/jaegertracing/jaeger-idl/model/v1" model "github.com/jaegertracing/jaeger/model" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" @@ -303,12 +303,12 @@ func (m *CloseWriterResponse) XXX_DiscardUnknown() { var xxx_messageInfo_CloseWriterResponse proto.InternalMessageInfo type GetTraceRequest struct { - TraceID github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_id"` - StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` - EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + TraceID github_com_jaegertracing_jaeger_idl_model_v1.TraceID `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3,customtype=github.com/jaegertracing/jaeger-idl/model/v1.TraceID" json:"trace_id"` + StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time"` + EndTime time.Time `protobuf:"bytes,3,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *GetTraceRequest) Reset() { *m = GetTraceRequest{} } @@ -854,10 +854,10 @@ func (m *FindTraceIDsRequest) GetQuery() *TraceQueryParameters { } type FindTraceIDsResponse struct { - TraceIDs []github_com_jaegertracing_jaeger_model.TraceID `protobuf:"bytes,1,rep,name=trace_ids,json=traceIds,proto3,customtype=github.com/jaegertracing/jaeger/model.TraceID" json:"trace_ids"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + TraceIDs []github_com_jaegertracing_jaeger_idl_model_v1.TraceID `protobuf:"bytes,1,rep,name=trace_ids,json=traceIds,proto3,customtype=github.com/jaegertracing/jaeger-idl/model/v1.TraceID" json:"trace_ids"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *FindTraceIDsResponse) Reset() { *m = FindTraceIDsResponse{} } @@ -1022,78 +1022,78 @@ func init() { func init() { proto.RegisterFile("storage.proto", fileDescriptor_0d2c4ccf1453ffdb) } var fileDescriptor_0d2c4ccf1453ffdb = []byte{ - // 1128 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x73, 0xdb, 0x44, - 0x14, 0x47, 0xb1, 0xdd, 0xd8, 0xcf, 0x4e, 0x9b, 0xac, 0x5d, 0xaa, 0x0a, 0x9a, 0x04, 0x41, 0x93, - 0xc0, 0x80, 0xdc, 0x98, 0x03, 0x0c, 0x94, 0x81, 0xe6, 0x4f, 0x33, 0x01, 0x0a, 0x45, 0xc9, 0xb4, - 0x33, 0x14, 0xe2, 0x59, 0x47, 0x8b, 0x22, 0x62, 0xad, 0x5c, 0x69, 0xe5, 0x49, 0x86, 0xe1, 0xc6, - 0x07, 0xe0, 0xc8, 0x89, 0x13, 0x33, 0x7c, 0x0f, 0x4e, 0x3d, 0x72, 0xe6, 0x10, 0x98, 0x5c, 0xb9, - 0xf2, 0x01, 0x18, 0xed, 0xae, 0x14, 0xfd, 0x9b, 0x24, 0x4d, 0x73, 0xf3, 0xbe, 0xf7, 0xdb, 0xdf, - 0xfb, 0xbb, 0xef, 0xc9, 0x30, 0x15, 0x30, 0xcf, 0xc7, 0x36, 0x31, 0x46, 0xbe, 0xc7, 0x3c, 0x34, - 0xf3, 0x3d, 0x26, 0x36, 0xf1, 0x8d, 0x58, 0x3a, 0x5e, 0xd6, 0x3a, 0xb6, 0x67, 0x7b, 0x5c, 0xdb, - 0x8d, 0x7e, 0x09, 0xa0, 0x36, 0x67, 0x7b, 0x9e, 0x3d, 0x24, 0x5d, 0x7e, 0x1a, 0x84, 0xdf, 0x75, - 0x99, 0xe3, 0x92, 0x80, 0x61, 0x77, 0x24, 0x01, 0xb3, 0x79, 0x80, 0x15, 0xfa, 0x98, 0x39, 0x1e, - 0x95, 0xfa, 0xa6, 0xeb, 0x59, 0x64, 0x28, 0x0e, 0xfa, 0xaf, 0x0a, 0xbc, 0xbc, 0x41, 0xd8, 0x1a, - 0x19, 0x11, 0x6a, 0x11, 0xba, 0xeb, 0x90, 0xc0, 0x24, 0x4f, 0x43, 0x12, 0x30, 0xb4, 0x0a, 0x10, - 0x30, 0xec, 0xb3, 0x7e, 0x64, 0x40, 0x55, 0xe6, 0x95, 0xa5, 0x66, 0x4f, 0x33, 0x04, 0xb9, 0x11, - 0x93, 0x1b, 0xdb, 0xb1, 0xf5, 0x95, 0xfa, 0xb3, 0xa3, 0xb9, 0x97, 0x7e, 0xfe, 0x7b, 0x4e, 0x31, - 0x1b, 0xfc, 0x5e, 0xa4, 0x41, 0x1f, 0x43, 0x9d, 0x50, 0x4b, 0x50, 0x4c, 0x3c, 0x07, 0xc5, 0x24, - 0xa1, 0x56, 0x24, 0xd7, 0x07, 0x70, 0xa3, 0xe0, 0x5f, 0x30, 0xf2, 0x68, 0x40, 0xd0, 0x06, 0xb4, - 0xac, 0x94, 0x5c, 0x55, 0xe6, 0x2b, 0x4b, 0xcd, 0xde, 0x2d, 0x43, 0x66, 0x12, 0x8f, 0x9c, 0xfe, - 0xb8, 0x67, 0x24, 0x57, 0x0f, 0x3f, 0x77, 0xe8, 0xfe, 0x4a, 0x35, 0x32, 0x61, 0x66, 0x2e, 0xea, - 0x1f, 0xc2, 0xf4, 0x63, 0xdf, 0x61, 0x64, 0x6b, 0x84, 0x69, 0x1c, 0xfd, 0x22, 0x54, 0x83, 0x11, - 0xa6, 0x32, 0xee, 0x76, 0x8e, 0x94, 0x23, 0x39, 0x40, 0x6f, 0xc3, 0x4c, 0xea, 0xb2, 0x70, 0x4d, - 0xef, 0x00, 0x5a, 0x1d, 0x7a, 0x01, 0xe1, 0x1a, 0x5f, 0x72, 0xea, 0xd7, 0xa1, 0x9d, 0x91, 0x4a, - 0xf0, 0x7f, 0x0a, 0x5c, 0xdb, 0x20, 0x6c, 0xdb, 0xc7, 0xbb, 0x24, 0x36, 0xff, 0x04, 0xea, 0x2c, - 0x3a, 0xf7, 0x1d, 0x8b, 0xbb, 0xd0, 0x5a, 0xf9, 0x24, 0x72, 0xfc, 0xaf, 0xa3, 0xb9, 0x77, 0x6c, - 0x87, 0xed, 0x85, 0x03, 0x63, 0xd7, 0x73, 0xbb, 0xc2, 0xa9, 0x08, 0xe8, 0x50, 0x5b, 0x9e, 0xba, - 0xa2, 0xbc, 0x9c, 0x6d, 0x73, 0xed, 0xf8, 0x68, 0x6e, 0x52, 0xfe, 0x34, 0x27, 0x39, 0xe3, 0xa6, - 0x95, 0xab, 0xec, 0xc4, 0x8b, 0x57, 0xb6, 0x72, 0x91, 0xca, 0x76, 0x00, 0x6d, 0x10, 0xb6, 0x45, - 0xfc, 0xb1, 0xb3, 0x9b, 0x74, 0x9d, 0xbe, 0x0c, 0xed, 0x8c, 0x54, 0xd6, 0x5a, 0x83, 0x7a, 0x20, - 0x65, 0xbc, 0xce, 0x0d, 0x33, 0x39, 0xeb, 0x0f, 0xa0, 0xb3, 0x41, 0xd8, 0x97, 0x23, 0x22, 0xda, - 0x3c, 0x69, 0x60, 0x15, 0x26, 0x25, 0x86, 0xa7, 0xb0, 0x61, 0xc6, 0x47, 0xf4, 0x0a, 0x34, 0xa2, - 0xda, 0xf5, 0xf7, 0x1d, 0x6a, 0xf1, 0xf8, 0x23, 0xba, 0x11, 0xa6, 0x9f, 0x39, 0xd4, 0xd2, 0xef, - 0x42, 0x23, 0xe1, 0x42, 0x08, 0xaa, 0x14, 0xbb, 0x31, 0x01, 0xff, 0x7d, 0xfa, 0xed, 0x1f, 0xe1, - 0x7a, 0xce, 0x19, 0x19, 0xc1, 0x02, 0x5c, 0xf5, 0x62, 0xe9, 0x17, 0xd8, 0x4d, 0xe2, 0xc8, 0x49, - 0xd1, 0x5d, 0x80, 0x44, 0x12, 0xa8, 0x13, 0xbc, 0xa7, 0x5f, 0x35, 0x0a, 0xd3, 0xc1, 0x48, 0x4c, - 0x98, 0x29, 0xbc, 0xfe, 0x7b, 0x15, 0x3a, 0xbc, 0xde, 0x5f, 0x85, 0xc4, 0x3f, 0x7c, 0x88, 0x7d, - 0xec, 0x12, 0x46, 0xfc, 0x00, 0xbd, 0x06, 0x2d, 0x19, 0x7d, 0x3f, 0x15, 0x50, 0x53, 0xca, 0x22, - 0xd3, 0xe8, 0x76, 0xca, 0x43, 0x01, 0x12, 0xc1, 0x4d, 0x65, 0x3c, 0x44, 0xeb, 0x50, 0x65, 0xd8, - 0x0e, 0xd4, 0x0a, 0x77, 0x6d, 0xb9, 0xc4, 0xb5, 0x32, 0x07, 0x8c, 0x6d, 0x6c, 0x07, 0xeb, 0x94, - 0xf9, 0x87, 0x26, 0xbf, 0x8e, 0x3e, 0x85, 0xab, 0x27, 0x4d, 0xd8, 0x77, 0x1d, 0xaa, 0x56, 0x9f, - 0xa3, 0x8b, 0x5a, 0x49, 0x23, 0x3e, 0x70, 0x68, 0x9e, 0x0b, 0x1f, 0xa8, 0xb5, 0x8b, 0x71, 0xe1, - 0x03, 0x74, 0x1f, 0x5a, 0xf1, 0xc0, 0xe4, 0x5e, 0x5d, 0xe1, 0x4c, 0x37, 0x0b, 0x4c, 0x6b, 0x12, - 0x24, 0x88, 0x7e, 0x89, 0x88, 0x9a, 0xf1, 0xc5, 0xc8, 0xa7, 0x0c, 0x0f, 0x3e, 0x50, 0x27, 0x2f, - 0xc2, 0x83, 0x0f, 0xd0, 0x2d, 0x00, 0x1a, 0xba, 0x7d, 0xfe, 0x76, 0x03, 0xb5, 0x3e, 0xaf, 0x2c, - 0xd5, 0xcc, 0x06, 0x0d, 0x5d, 0x9e, 0xe4, 0x40, 0x7b, 0x0f, 0x1a, 0x49, 0x66, 0xd1, 0x34, 0x54, - 0xf6, 0xc9, 0xa1, 0xac, 0x6d, 0xf4, 0x13, 0x75, 0xa0, 0x36, 0xc6, 0xc3, 0x30, 0x2e, 0xa5, 0x38, - 0x7c, 0x30, 0xf1, 0xbe, 0xa2, 0x9b, 0x30, 0x73, 0xdf, 0xa1, 0x96, 0xa0, 0x89, 0x9f, 0xcc, 0x47, - 0x50, 0x7b, 0x1a, 0xd5, 0x4d, 0x8e, 0xbd, 0xc5, 0x73, 0x16, 0xd7, 0x14, 0xb7, 0xf4, 0x75, 0x40, - 0xd1, 0x18, 0x4c, 0x9a, 0x7e, 0x75, 0x2f, 0xa4, 0xfb, 0xa8, 0x0b, 0xb5, 0xe8, 0x79, 0xc4, 0x03, - 0xba, 0x6c, 0x96, 0xca, 0xb1, 0x2c, 0x70, 0xfa, 0x36, 0xb4, 0x13, 0xd7, 0x36, 0xd7, 0x2e, 0xcb, - 0xb9, 0x31, 0x74, 0xb2, 0xac, 0xf2, 0x61, 0xee, 0x40, 0x23, 0x1e, 0xb5, 0xc2, 0xc5, 0xd6, 0xca, - 0xbd, 0x8b, 0xce, 0xda, 0x7a, 0xc2, 0x5e, 0x97, 0xc3, 0x36, 0xe0, 0x53, 0x1f, 0x8f, 0xf0, 0xc0, - 0x19, 0x3a, 0xec, 0x64, 0xbd, 0xea, 0xbf, 0x29, 0xd0, 0xc9, 0xca, 0xa5, 0x3f, 0x6f, 0xc3, 0x0c, - 0xf6, 0x77, 0xf7, 0x9c, 0xb1, 0x5c, 0x29, 0xd8, 0x22, 0x3e, 0x0f, 0xb9, 0x6e, 0x16, 0x15, 0x39, - 0xb4, 0xd8, 0x2c, 0xbc, 0xd8, 0x59, 0xb4, 0x50, 0xa0, 0x3b, 0xd0, 0x0e, 0x98, 0x4f, 0xb0, 0xeb, - 0x50, 0x3b, 0x85, 0xaf, 0x70, 0x7c, 0x99, 0xaa, 0xf7, 0x87, 0x02, 0xd3, 0x27, 0xc7, 0x87, 0xc3, - 0xd0, 0x76, 0x28, 0x7a, 0x04, 0x8d, 0x64, 0xe7, 0xa1, 0xd7, 0x4b, 0xea, 0x90, 0x5f, 0xa7, 0xda, - 0x1b, 0xa7, 0x83, 0x64, 0xe8, 0x8f, 0xa0, 0xc6, 0x17, 0x24, 0xba, 0x5d, 0x02, 0x2f, 0x2e, 0x54, - 0x6d, 0xe1, 0x2c, 0x98, 0xe0, 0xed, 0xfd, 0x00, 0x37, 0xb7, 0x8a, 0xb1, 0xc9, 0x60, 0x76, 0xe0, - 0x5a, 0xe2, 0x89, 0x40, 0x5d, 0x62, 0x48, 0x4b, 0x4a, 0xef, 0xdf, 0x8a, 0xc8, 0xa0, 0x28, 0x98, - 0x34, 0xfa, 0x18, 0xea, 0xf1, 0xca, 0x47, 0x7a, 0x09, 0x51, 0xee, 0x7b, 0x40, 0x2b, 0x4b, 0x48, - 0xf1, 0xa9, 0xdd, 0x51, 0xd0, 0x37, 0xd0, 0x4c, 0xed, 0xcf, 0xd2, 0x44, 0x16, 0xb7, 0x6e, 0x69, - 0x22, 0xcb, 0xd6, 0xf0, 0x00, 0xa6, 0x32, 0xdb, 0x0d, 0x2d, 0x96, 0x5f, 0x2c, 0x2c, 0x63, 0x6d, - 0xe9, 0x6c, 0xa0, 0xb4, 0xf1, 0x04, 0xe0, 0x64, 0x30, 0xa1, 0xb2, 0x2c, 0x17, 0xe6, 0xd6, 0xf9, - 0xd3, 0xd3, 0x87, 0x56, 0x7a, 0x08, 0xa0, 0x85, 0xd3, 0xe8, 0x4f, 0x66, 0x8f, 0xb6, 0x78, 0x26, - 0x4e, 0xb6, 0xda, 0x01, 0xdc, 0xb8, 0x97, 0x7f, 0x76, 0xb2, 0xe6, 0xdf, 0xca, 0xcf, 0xcc, 0x94, - 0xfe, 0x12, 0x3b, 0xad, 0x77, 0x98, 0xb1, 0x9c, 0xe9, 0xb6, 0x1d, 0xfe, 0x81, 0x29, 0xb5, 0x97, - 0xdf, 0x74, 0xbd, 0x9f, 0x14, 0x50, 0xb3, 0x9f, 0xe8, 0x29, 0xe3, 0x7b, 0xdc, 0x78, 0x5a, 0x8d, - 0xde, 0x2c, 0x37, 0x5e, 0xf2, 0x2f, 0x44, 0x7b, 0xeb, 0x3c, 0x50, 0x99, 0x81, 0x10, 0x90, 0xb0, - 0x99, 0x9e, 0xab, 0x51, 0xc9, 0x33, 0xe7, 0xd2, 0xa1, 0x51, 0x1c, 0xd0, 0xa5, 0x25, 0x2f, 0x1b, - 0xd8, 0x2b, 0xea, 0xb3, 0xe3, 0x59, 0xe5, 0xcf, 0xe3, 0x59, 0xe5, 0x9f, 0xe3, 0x59, 0xe5, 0x6b, - 0x90, 0xf0, 0xfe, 0x78, 0x79, 0x70, 0x85, 0x6f, 0xf9, 0x77, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, - 0x4d, 0x42, 0xc0, 0x41, 0xec, 0x0d, 0x00, 0x00, + // 1135 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcd, 0x6f, 0x1b, 0x45, + 0x14, 0x67, 0x63, 0xbb, 0xb1, 0x9f, 0xdd, 0x36, 0x19, 0xbb, 0x74, 0xbb, 0xd0, 0x24, 0x2c, 0x34, + 0x09, 0x08, 0xd6, 0x8d, 0x41, 0x02, 0x41, 0x11, 0x22, 0x1f, 0x35, 0x01, 0x0a, 0x65, 0x13, 0xb5, + 0x12, 0x1f, 0xb5, 0xc6, 0xd9, 0x61, 0x33, 0xc4, 0x3b, 0xeb, 0xee, 0x87, 0x95, 0x08, 0xf5, 0xc6, + 0x1f, 0xc0, 0x91, 0x13, 0x27, 0x24, 0xfe, 0x0f, 0x4e, 0x3d, 0x72, 0xe6, 0x10, 0x50, 0xae, 0xfc, + 0x09, 0x5c, 0xd0, 0xce, 0xcc, 0x6e, 0xf6, 0x4b, 0x49, 0x9a, 0xe6, 0xe6, 0x79, 0xef, 0x37, 0xbf, + 0xf7, 0x39, 0xef, 0xad, 0xe1, 0xb2, 0x1f, 0xb8, 0x1e, 0xb6, 0x89, 0x31, 0xf6, 0xdc, 0xc0, 0x45, + 0xb3, 0x3f, 0x60, 0x62, 0x13, 0xcf, 0x88, 0xa5, 0x93, 0x15, 0xad, 0x63, 0xbb, 0xb6, 0xcb, 0xb5, + 0xdd, 0xe8, 0x97, 0x00, 0x6a, 0xf3, 0xb6, 0xeb, 0xda, 0x23, 0xd2, 0xe5, 0xa7, 0x61, 0xf8, 0x7d, + 0x37, 0xa0, 0x0e, 0xf1, 0x03, 0xec, 0x8c, 0x25, 0x60, 0x2e, 0x0f, 0xb0, 0x42, 0x0f, 0x07, 0xd4, + 0x65, 0x52, 0xdf, 0x74, 0x5c, 0x8b, 0x8c, 0xc4, 0x41, 0xff, 0x55, 0x81, 0x17, 0xfb, 0x24, 0x58, + 0x27, 0x63, 0xc2, 0x2c, 0xc2, 0x76, 0x28, 0xf1, 0x4d, 0xf2, 0x38, 0x24, 0x7e, 0x80, 0xd6, 0x00, + 0xfc, 0x00, 0x7b, 0xc1, 0x20, 0x32, 0xa0, 0x2a, 0x0b, 0xca, 0x72, 0xb3, 0xa7, 0x19, 0x82, 0xdc, + 0x88, 0xc9, 0x8d, 0xed, 0xd8, 0xfa, 0x6a, 0xfd, 0xe9, 0xe1, 0xfc, 0x0b, 0x3f, 0xff, 0x3d, 0xaf, + 0x98, 0x0d, 0x7e, 0x2f, 0xd2, 0xa0, 0x8f, 0xa0, 0x4e, 0x98, 0x25, 0x28, 0xa6, 0x9e, 0x81, 0x62, + 0x9a, 0x30, 0x2b, 0x92, 0xeb, 0x43, 0xb8, 0x5e, 0xf0, 0xcf, 0x1f, 0xbb, 0xcc, 0x27, 0xa8, 0x0f, + 0x2d, 0x2b, 0x25, 0x57, 0x95, 0x85, 0xca, 0x72, 0xb3, 0x77, 0xd3, 0x90, 0x99, 0xc4, 0x63, 0x3a, + 0x98, 0xf4, 0x8c, 0xe4, 0xea, 0xc1, 0xe7, 0x94, 0xed, 0xad, 0x56, 0x23, 0x13, 0x66, 0xe6, 0xa2, + 0xfe, 0x01, 0xcc, 0x3c, 0xf4, 0x68, 0x40, 0xb6, 0xc6, 0x98, 0xc5, 0xd1, 0x2f, 0x41, 0xd5, 0x1f, + 0x63, 0x26, 0xe3, 0x6e, 0xe7, 0x48, 0x39, 0x92, 0x03, 0xf4, 0x36, 0xcc, 0xa6, 0x2e, 0x0b, 0xd7, + 0xf4, 0x0e, 0xa0, 0xb5, 0x91, 0xeb, 0x13, 0xae, 0xf1, 0x24, 0xa7, 0x7e, 0x0d, 0xda, 0x19, 0xa9, + 0x04, 0xff, 0xa7, 0xc0, 0xd5, 0x3e, 0x09, 0xb6, 0x3d, 0xbc, 0x43, 0x62, 0xf3, 0x43, 0xa8, 0x07, + 0xd1, 0x79, 0x40, 0x2d, 0xee, 0x42, 0x6b, 0xb5, 0x1f, 0x39, 0xfe, 0xd7, 0xe1, 0xfc, 0x3b, 0x36, + 0x0d, 0x76, 0xc3, 0xa1, 0xb1, 0xe3, 0x3a, 0x5d, 0xe1, 0x54, 0x04, 0xa4, 0xcc, 0x96, 0xa7, 0xb7, + 0xa8, 0x35, 0xea, 0xf2, 0x12, 0x77, 0x27, 0x2b, 0x06, 0x27, 0xdd, 0x5c, 0x3f, 0x3a, 0x9c, 0x9f, + 0x96, 0x3f, 0xcd, 0x69, 0x4e, 0xbc, 0x69, 0xe5, 0x0a, 0x3c, 0xf5, 0xfc, 0x05, 0xae, 0x9c, 0xa7, + 0xc0, 0x1d, 0x40, 0x7d, 0x12, 0x6c, 0x11, 0x6f, 0x42, 0x77, 0x92, 0xe6, 0xd3, 0x57, 0xa0, 0x9d, + 0x91, 0xca, 0x92, 0x6b, 0x50, 0xf7, 0xa5, 0x8c, 0x97, 0xbb, 0x61, 0x26, 0x67, 0xfd, 0x1e, 0x74, + 0xfa, 0x24, 0xf8, 0x72, 0x4c, 0x44, 0xb7, 0x27, 0x7d, 0xac, 0xc2, 0xb4, 0xc4, 0xf0, 0x4c, 0x36, + 0xcc, 0xf8, 0x88, 0x5e, 0x82, 0x46, 0x54, 0xc2, 0xc1, 0x1e, 0x65, 0x16, 0x8f, 0x3f, 0xa2, 0x1b, + 0x63, 0xf6, 0x19, 0x65, 0x96, 0x7e, 0x07, 0x1a, 0x09, 0x17, 0x42, 0x50, 0x65, 0xd8, 0x89, 0x09, + 0xf8, 0xef, 0x93, 0x6f, 0x3f, 0x81, 0x6b, 0x39, 0x67, 0x64, 0x04, 0x8b, 0x70, 0xc5, 0x8d, 0xa5, + 0x5f, 0x60, 0x27, 0x89, 0x23, 0x27, 0x45, 0x77, 0x00, 0x12, 0x89, 0xaf, 0x4e, 0xf1, 0xd6, 0x7e, + 0xd9, 0x28, 0x0c, 0x09, 0x23, 0x31, 0x61, 0xa6, 0xf0, 0xfa, 0xef, 0x55, 0xe8, 0xf0, 0x7a, 0x7f, + 0x15, 0x12, 0xef, 0xe0, 0x3e, 0xf6, 0xb0, 0x43, 0x02, 0xe2, 0xf9, 0xe8, 0x15, 0x68, 0xc9, 0xe8, + 0x07, 0xa9, 0x80, 0x9a, 0x52, 0x16, 0x99, 0x46, 0xb7, 0x52, 0x1e, 0x0a, 0x90, 0x08, 0xee, 0x72, + 0xc6, 0x43, 0xb4, 0x01, 0xd5, 0x00, 0xdb, 0xbe, 0x5a, 0xe1, 0xae, 0xad, 0x94, 0xb8, 0x56, 0xe6, + 0x80, 0xb1, 0x8d, 0x6d, 0x7f, 0x83, 0x05, 0xde, 0x81, 0xc9, 0xaf, 0xa3, 0x4f, 0xe1, 0xca, 0x71, + 0x13, 0x0e, 0x1c, 0xca, 0xd4, 0xea, 0x33, 0x74, 0x51, 0x2b, 0x69, 0xc4, 0x7b, 0x94, 0xe5, 0xb9, + 0xf0, 0xbe, 0x5a, 0x3b, 0x1f, 0x17, 0xde, 0x47, 0x77, 0xa1, 0x15, 0xcf, 0x4d, 0xee, 0xd5, 0x25, + 0xce, 0x74, 0xa3, 0xc0, 0xb4, 0x2e, 0x41, 0x82, 0xe8, 0x97, 0x88, 0xa8, 0x19, 0x5f, 0x8c, 0x7c, + 0xca, 0xf0, 0xe0, 0x7d, 0x75, 0xfa, 0x3c, 0x3c, 0x78, 0x1f, 0xdd, 0x04, 0x60, 0xa1, 0x33, 0xe0, + 0x6f, 0xd7, 0x57, 0xeb, 0x0b, 0xca, 0x72, 0xcd, 0x6c, 0xb0, 0xd0, 0xe1, 0x49, 0xf6, 0xb5, 0x77, + 0xa1, 0x91, 0x64, 0x16, 0xcd, 0x40, 0x65, 0x8f, 0x1c, 0xc8, 0xda, 0x46, 0x3f, 0x51, 0x07, 0x6a, + 0x13, 0x3c, 0x0a, 0xe3, 0x52, 0x8a, 0xc3, 0xfb, 0x53, 0xef, 0x29, 0xba, 0x09, 0xb3, 0x77, 0x29, + 0xb3, 0x04, 0x4d, 0xfc, 0x64, 0x3e, 0x84, 0xda, 0xe3, 0xa8, 0x6e, 0x72, 0xfa, 0x2d, 0x9d, 0xb1, + 0xb8, 0xa6, 0xb8, 0xa5, 0x6f, 0x00, 0x8a, 0xa6, 0x61, 0xd2, 0xf4, 0x6b, 0xbb, 0x21, 0xdb, 0x43, + 0x5d, 0xa8, 0x45, 0xcf, 0x23, 0x9e, 0xd3, 0x65, 0x23, 0x55, 0x4e, 0x67, 0x81, 0xd3, 0xb7, 0xa1, + 0x9d, 0xb8, 0xb6, 0xb9, 0x7e, 0x51, 0xce, 0x3d, 0x81, 0x4e, 0x96, 0x55, 0x3e, 0x4c, 0x02, 0x8d, + 0x78, 0xe2, 0x0a, 0x17, 0x5b, 0xab, 0x9f, 0x3c, 0xe7, 0xc8, 0xad, 0x27, 0x46, 0xea, 0x72, 0xe6, + 0xfa, 0x7c, 0x07, 0xe0, 0x31, 0x1e, 0xd2, 0x11, 0x0d, 0x8e, 0x97, 0xad, 0xfe, 0x9b, 0x02, 0x9d, + 0xac, 0x5c, 0xba, 0xf5, 0x26, 0xcc, 0x62, 0x6f, 0x67, 0x97, 0x4e, 0xe4, 0x82, 0xc1, 0x16, 0xf1, + 0x78, 0xe4, 0x75, 0xb3, 0xa8, 0xc8, 0xa1, 0xc5, 0x9e, 0xe1, 0x35, 0xcf, 0xa2, 0x85, 0x02, 0xdd, + 0x86, 0xb6, 0x1f, 0x78, 0x04, 0x3b, 0x94, 0xd9, 0x29, 0x7c, 0x85, 0xe3, 0xcb, 0x54, 0xbd, 0x3f, + 0x14, 0x98, 0x39, 0x3e, 0xde, 0x1f, 0x85, 0x36, 0x65, 0xe8, 0x01, 0x34, 0x92, 0x0d, 0x88, 0x5e, + 0x2d, 0x29, 0x47, 0x7e, 0xb9, 0x6a, 0xaf, 0x9d, 0x0c, 0x92, 0xa1, 0x3f, 0x80, 0x1a, 0x5f, 0x97, + 0xe8, 0x56, 0x09, 0xbc, 0xb8, 0x5e, 0xb5, 0xc5, 0xd3, 0x60, 0x82, 0xb7, 0xf7, 0x23, 0xdc, 0xd8, + 0x2a, 0xc6, 0x26, 0x83, 0x79, 0x04, 0x57, 0x13, 0x4f, 0x04, 0xea, 0x02, 0x43, 0x5a, 0x56, 0x7a, + 0xff, 0x56, 0x44, 0x06, 0x45, 0xc1, 0xa4, 0xd1, 0x87, 0x50, 0x8f, 0x3f, 0x00, 0x90, 0x5e, 0x42, + 0x94, 0xfb, 0x3a, 0xd0, 0xca, 0x12, 0x52, 0x7c, 0x71, 0xb7, 0x15, 0xf4, 0x2d, 0x34, 0x53, 0x6b, + 0xb4, 0x34, 0x91, 0xc5, 0xe5, 0x5b, 0x9a, 0xc8, 0xb2, 0x6d, 0x3c, 0x84, 0xcb, 0x99, 0x25, 0x87, + 0x96, 0xca, 0x2f, 0x16, 0x76, 0xb2, 0xb6, 0x7c, 0x3a, 0x50, 0xda, 0xf8, 0x06, 0xe0, 0x78, 0x3e, + 0xa1, 0xb2, 0x2c, 0x17, 0xc6, 0xd7, 0xd9, 0xd3, 0x33, 0x80, 0x56, 0x7a, 0x16, 0xa0, 0xc5, 0x93, + 0xe8, 0x8f, 0x47, 0x90, 0xb6, 0x74, 0x2a, 0x4e, 0xb6, 0xda, 0x3e, 0x5c, 0xff, 0x38, 0xff, 0xec, + 0x64, 0xcd, 0xbf, 0x93, 0x1f, 0x9d, 0x29, 0xfd, 0x05, 0x76, 0x5a, 0xef, 0x20, 0x63, 0x39, 0xd3, + 0x6d, 0x8f, 0xf8, 0xe7, 0xa6, 0xd4, 0x5e, 0x7c, 0xd3, 0xf5, 0x7e, 0x52, 0x40, 0xcd, 0x7e, 0xb0, + 0xa7, 0x8c, 0xef, 0x72, 0xe3, 0x69, 0x35, 0x7a, 0xbd, 0xdc, 0x78, 0xc9, 0x7f, 0x12, 0xed, 0x8d, + 0xb3, 0x40, 0x65, 0x06, 0x42, 0x40, 0xc2, 0x66, 0x7a, 0xae, 0x46, 0x25, 0xcf, 0x9c, 0x4b, 0x87, + 0x46, 0x71, 0x40, 0x97, 0x96, 0xbc, 0x6c, 0x60, 0xaf, 0xaa, 0x4f, 0x8f, 0xe6, 0x94, 0x3f, 0x8f, + 0xe6, 0x94, 0x7f, 0x8e, 0xe6, 0x94, 0xaf, 0x41, 0xc2, 0x07, 0x93, 0x95, 0xe1, 0x25, 0xbe, 0xec, + 0xdf, 0xfe, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xce, 0x76, 0x7d, 0x55, 0xfa, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4845,7 +4845,7 @@ func (m *FindTraceIDsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - var v github_com_jaegertracing_jaeger_model.TraceID + var v github_com_jaegertracing_jaeger_idl_model_v1.TraceID m.TraceIDs = append(m.TraceIDs, v) if err := m.TraceIDs[len(m.TraceIDs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err From a35f50fa4df3a72b4dc4168acfb1b267c55064d5 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 04:23:16 +0200 Subject: [PATCH 09/11] enhance: alias functions Signed-off-by: nabil salah --- model/hash.go | 4 +--- model/ids.go | 16 ++++------------ model/keyvalue.go | 4 +--- plugin/storage/grpc/proto/storage.proto | 4 ++-- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/model/hash.go b/model/hash.go index 0ee818b2cb1..e59913d4eef 100644 --- a/model/hash.go +++ b/model/hash.go @@ -13,6 +13,4 @@ import ( type Hashable = modelv1.Hashable // HashCode calculates a FNV-1a hash code for a Hashable object. -func HashCode(o Hashable) (uint64, error) { - return modelv1.HashCode(o) -} +var HashCode = modelv1.HashCode diff --git a/model/ids.go b/model/ids.go index d47bf880d52..b9846fff96a 100644 --- a/model/ids.go +++ b/model/ids.go @@ -25,14 +25,10 @@ type SpanID = modelv1.SpanID var NewTraceID = modelv1.NewTraceID // TraceIDFromString creates a TraceID from a hexadecimal string -func TraceIDFromString(s string) (TraceID, error) { - return modelv1.TraceIDFromString(s) -} +var TraceIDFromString = modelv1.TraceIDFromString // TraceIDFromBytes creates a TraceID from list of bytes -func TraceIDFromBytes(data []byte) (TraceID, error) { - return modelv1.TraceIDFromBytes(data) -} +var TraceIDFromBytes = modelv1.TraceIDFromBytes // ------- SpanID ------- @@ -40,11 +36,7 @@ func TraceIDFromBytes(data []byte) (TraceID, error) { var NewSpanID = modelv1.NewSpanID // SpanIDFromString creates a SpanID from a hexadecimal string -func SpanIDFromString(s string) (SpanID, error) { - return modelv1.SpanIDFromString(s) -} +var SpanIDFromString = modelv1.SpanIDFromString // SpanIDFromBytes creates a SpandID from list of bytes -func SpanIDFromBytes(data []byte) (SpanID, error) { - return modelv1.SpanIDFromBytes(data) -} +var SpanIDFromBytes = modelv1.SpanIDFromBytes diff --git a/model/keyvalue.go b/model/keyvalue.go index c2b8818b067..8abe5c9a655 100644 --- a/model/keyvalue.go +++ b/model/keyvalue.go @@ -37,9 +37,7 @@ const ( SpanKindUnspecified SpanKind = modelv1.SpanKindUnspecified ) -func SpanKindFromString(kind string) (SpanKind, error) { - return modelv1.SpanKindFromString(kind) -} +var SpanKindFromString = modelv1.SpanKindFromString // KeyValues is a type alias that exposes convenience functions like Sort, FindByKey. type KeyValues = modelv1.KeyValues diff --git a/plugin/storage/grpc/proto/storage.proto b/plugin/storage/grpc/proto/storage.proto index 50a0eebaa16..3a0298456c2 100644 --- a/plugin/storage/grpc/proto/storage.proto +++ b/plugin/storage/grpc/proto/storage.proto @@ -142,8 +142,8 @@ message FindTraceIDsRequest { message FindTraceIDsResponse { repeated bytes trace_ids = 1 [ - (gogoproto.nullable) = false,(gogoproto.customtype) = "github.com/jaegertracing/jaeger-idl/model/v1.TraceID" - , + (gogoproto.nullable) = false, + (gogoproto.customtype) = "github.com/jaegertracing/jaeger-idl/model/v1.TraceID", (gogoproto.customname) = "TraceIDs" ]; } From 0b7be7eaf0110b09a915d6b6bbbb1a1428613828 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 04:43:48 +0200 Subject: [PATCH 10/11] remove: unneccesary imports Signed-off-by: nabil salah --- model/dependencies.go | 6 +++++- model/doc.go | 6 ------ model/span.go | 10 +++++----- model/trace.go | 5 ----- proto-gen/api_v2/collector.go | 7 ------- proto-gen/api_v2/query.go | 9 --------- proto-gen/api_v2/sampling.go | 7 ------- 7 files changed, 10 insertions(+), 40 deletions(-) delete mode 100644 model/doc.go delete mode 100644 model/trace.go diff --git a/model/dependencies.go b/model/dependencies.go index 992af93e8fe..2252a25b09f 100644 --- a/model/dependencies.go +++ b/model/dependencies.go @@ -4,7 +4,11 @@ package model +import ( + modelv1 "github.com/jaegertracing/jaeger-idl/model/v1" +) + const ( // JaegerDependencyLinkSource describes a dependency diagram that was generated from Jaeger traces. - JaegerDependencyLinkSource = "jaeger" + JaegerDependencyLinkSource = modelv1.JaegerDependencyLinkSource ) diff --git a/model/doc.go b/model/doc.go deleted file mode 100644 index bb8daf13905..00000000000 --- a/model/doc.go +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) 2019 The Jaeger Authors. -// Copyright (c) 2017 Uber Technologies, Inc. -// SPDX-License-Identifier: Apache-2.0 - -// Package model describes the internal data model for Trace and Span -package model diff --git a/model/span.go b/model/span.go index 4dd58b4381c..9f640c259a7 100644 --- a/model/span.go +++ b/model/span.go @@ -11,11 +11,11 @@ import ( type SamplerType = modelv1.SamplerType const ( - SamplerTypeUnrecognized SamplerType = iota - SamplerTypeProbabilistic - SamplerTypeLowerBound - SamplerTypeRateLimiting - SamplerTypeConst + SamplerTypeUnrecognized SamplerType = modelv1.SamplerTypeUnrecognized + SamplerTypeProbabilistic = modelv1.SamplerTypeProbabilistic + SamplerTypeLowerBound = modelv1.SamplerTypeLowerBound + SamplerTypeRateLimiting = modelv1.SamplerTypeRateLimiting + SamplerTypeConst = modelv1.SamplerTypeConst ) var toSamplerType = map[string]SamplerType{ diff --git a/model/trace.go b/model/trace.go deleted file mode 100644 index 682cb6a5bff..00000000000 --- a/model/trace.go +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright (c) 2019 The Jaeger Authors. -// Copyright (c) 2017 Uber Technologies, Inc. -// SPDX-License-Identifier: Apache-2.0 - -package model diff --git a/proto-gen/api_v2/collector.go b/proto-gen/api_v2/collector.go index 38544687a28..6e91bf60607 100644 --- a/proto-gen/api_v2/collector.go +++ b/proto-gen/api_v2/collector.go @@ -1,8 +1,6 @@ package api_v2 import ( - _ "github.com/gogo/googleapis/google/api" - _ "github.com/gogo/protobuf/gogoproto" modelv1 "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) @@ -25,8 +23,3 @@ type UnimplementedCollectorServiceServer = modelv1.UnimplementedCollectorService var RegisterCollectorServiceServer = modelv1.RegisterCollectorServiceServer -var ( - ErrInvalidLengthCollector = modelv1.ErrInvalidLengthCollector - ErrIntOverflowCollector = modelv1.ErrIntOverflowCollector - ErrUnexpectedEndOfGroupCollector = modelv1.ErrUnexpectedEndOfGroupCollector -) diff --git a/proto-gen/api_v2/query.go b/proto-gen/api_v2/query.go index 18257079d10..c6ea40df2e6 100644 --- a/proto-gen/api_v2/query.go +++ b/proto-gen/api_v2/query.go @@ -1,10 +1,6 @@ package api_v2 import ( - _ "github.com/gogo/googleapis/google/api" - _ "github.com/gogo/protobuf/gogoproto" - _ "github.com/gogo/protobuf/types" - modelv1 "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) @@ -57,8 +53,3 @@ type QueryService_GetTraceServer = modelv1.QueryService_GetTraceServer type QueryService_FindTracesServer = modelv1.QueryService_FindTracesServer -var ( - ErrInvalidLengthQuery = modelv1.ErrInvalidLengthQuery - ErrIntOverflowQuery = modelv1.ErrIntOverflowQuery - ErrUnexpectedEndOfGroupQuery = modelv1.ErrUnexpectedEndOfGroupQuery -) diff --git a/proto-gen/api_v2/sampling.go b/proto-gen/api_v2/sampling.go index 79d7c7d5d68..db09468a1d8 100644 --- a/proto-gen/api_v2/sampling.go +++ b/proto-gen/api_v2/sampling.go @@ -1,8 +1,6 @@ package api_v2 import ( - _ "github.com/gogo/googleapis/google/api" - _ "github.com/gogo/protobuf/gogoproto" modelv1 "github.com/jaegertracing/jaeger-idl/proto-gen/api_v2" ) @@ -57,8 +55,3 @@ type UnimplementedSamplingManagerServer = modelv1.UnimplementedSamplingManagerSe var RegisterSamplingManagerServer = modelv1.RegisterSamplingManagerServer -var ( - ErrInvalidLengthSampling = modelv1.ErrInvalidLengthSampling - ErrIntOverflowSampling = modelv1.ErrIntOverflowSampling - ErrUnexpectedEndOfGroupSampling = modelv1.ErrUnexpectedEndOfGroupSampling -) From 48e2b6b5fb915925fa7733a72411017f4d2cd0a1 Mon Sep 17 00:00:00 2001 From: nabil salah Date: Fri, 24 Jan 2025 04:56:43 +0200 Subject: [PATCH 11/11] fix:grpc tes Signed-off-by: nabil salah --- pkg/gogocodec/codec.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/gogocodec/codec.go b/pkg/gogocodec/codec.go index ce1e0947736..1202e52b950 100644 --- a/pkg/gogocodec/codec.go +++ b/pkg/gogocodec/codec.go @@ -17,6 +17,9 @@ import ( const ( jaegerProtoGenPkgPath = "github.com/jaegertracing/jaeger-idl/proto-gen" jaegerModelPkgPath = "github.com/jaegertracing/jaeger-idl/model/v1" + + jaegerProtoGenPkgPathOld = "github.com/jaegertracing/jaeger/proto-gen" + jaegerModelPkgPathOld = "github.com/jaegertracing/jaeger/model" ) var defaultCodec encoding.CodecV2 @@ -89,5 +92,11 @@ func useGogo(t reflect.Type) bool { if strings.HasPrefix(pkg, jaegerModelPkgPath) { return true } + if strings.HasPrefix(pkg, jaegerProtoGenPkgPathOld) { + return true + } + if strings.HasPrefix(pkg, jaegerModelPkgPathOld) { + return true + } return false }