diff --git a/.travis.yml b/.travis.yml index 0f4ff5e8c..9a23d38be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ install: before_script: - go get -u github.com/ChimeraCoder/gojson/gojson - go get -u github.com/golang/protobuf/protoc-gen-go + - go get -u github.com/gogo/protobuf/protoc-gen-gofast - go generate # We need to ignore changes to this one file # because the go-generated version will have a different diff --git a/Dockerfile b/Dockerfile index f8312e950..8d5e238be 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ ENV GOPATH=/go RUN apt-get update RUN apt-get install -y zip RUN go get -u -v github.com/ChimeraCoder/gojson/gojson -RUN go get -u github.com/golang/protobuf/protoc-gen-go +RUN go get -u -v github.com/golang/protobuf/protoc-gen-go +RUN go get -u -v github.com/gogo/protobuf/protoc-gen-gofast RUN wget https://github.com/google/protobuf/releases/download/v3.1.0/protoc-3.1.0-linux-x86_64.zip RUN unzip protoc-3.1.0-linux-x86_64.zip RUN cp bin/protoc /usr/bin/protoc diff --git a/generate.go b/generate.go index f98cedce2..2ed532629 100644 --- a/generate.go +++ b/generate.go @@ -1,6 +1,6 @@ package veneur -//go:generate protoc --go_out=. ssf/sample.proto +//go:generate protoc --gofast_out=. ssf/sample.proto //go:generate gojson -input config_spec.yaml -o config.go -fmt yaml -pkg veneur -name Config //go:generate gojson -input example_proxy.yaml -o config_proxy.go -fmt yaml -pkg veneur -name ProxyConfig //TODO(aditya) reenable go:generate gojson -input fixtures/datadog_trace.json -o datadog_trace_span.go -fmt json -pkg veneur -name DatadogTraceSpan diff --git a/ssf/sample.pb.go b/ssf/sample.pb.go index 8eff261e2..7238cc3ae 100644 --- a/ssf/sample.pb.go +++ b/ssf/sample.pb.go @@ -1,16 +1,16 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. +// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: ssf/sample.proto /* -Package ssf is a generated protocol buffer package. + Package ssf is a generated protocol buffer package. -It is generated from these files: - ssf/sample.proto + It is generated from these files: + ssf/sample.proto -It has these top-level messages: - SSFSample - SSFSpan - SSFSpanCollection + It has these top-level messages: + SSFSample + SSFSpan + SSFSpanCollection */ package ssf @@ -18,6 +18,8 @@ import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" +import io "io" + // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf @@ -57,7 +59,7 @@ var SSFSample_Metric_value = map[string]int32{ func (x SSFSample_Metric) String() string { return proto.EnumName(SSFSample_Metric_name, int32(x)) } -func (SSFSample_Metric) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 0} } +func (SSFSample_Metric) EnumDescriptor() ([]byte, []int) { return fileDescriptorSample, []int{0, 0} } type SSFSample_Status int32 @@ -84,27 +86,27 @@ var SSFSample_Status_value = map[string]int32{ func (x SSFSample_Status) String() string { return proto.EnumName(SSFSample_Status_name, int32(x)) } -func (SSFSample_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []int{0, 1} } +func (SSFSample_Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorSample, []int{0, 1} } type SSFSample struct { // The underlying type of the metric - Metric SSFSample_Metric `protobuf:"varint,1,opt,name=metric,enum=ssf.SSFSample_Metric" json:"metric,omitempty"` + Metric SSFSample_Metric `protobuf:"varint,1,opt,name=metric,proto3,enum=ssf.SSFSample_Metric" json:"metric,omitempty"` // no spaces, but . is allowed // e.g.: veneur.bar.baz - Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"` - Value float32 `protobuf:"fixed32,3,opt,name=value" json:"value,omitempty"` - Timestamp int64 `protobuf:"varint,4,opt,name=timestamp" json:"timestamp,omitempty"` - Message string `protobuf:"bytes,5,opt,name=message" json:"message,omitempty"` - Status SSFSample_Status `protobuf:"varint,6,opt,name=status,enum=ssf.SSFSample_Status" json:"status,omitempty"` - SampleRate float32 `protobuf:"fixed32,7,opt,name=sample_rate,json=sampleRate" json:"sample_rate,omitempty"` - Tags map[string]string `protobuf:"bytes,8,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` - Unit string `protobuf:"bytes,9,opt,name=unit" json:"unit,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Value float32 `protobuf:"fixed32,3,opt,name=value,proto3" json:"value,omitempty"` + Timestamp int64 `protobuf:"varint,4,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + Message string `protobuf:"bytes,5,opt,name=message,proto3" json:"message,omitempty"` + Status SSFSample_Status `protobuf:"varint,6,opt,name=status,proto3,enum=ssf.SSFSample_Status" json:"status,omitempty"` + SampleRate float32 `protobuf:"fixed32,7,opt,name=sample_rate,json=sampleRate,proto3" json:"sample_rate,omitempty"` + Tags map[string]string `protobuf:"bytes,8,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Unit string `protobuf:"bytes,9,opt,name=unit,proto3" json:"unit,omitempty"` } func (m *SSFSample) Reset() { *m = SSFSample{} } func (m *SSFSample) String() string { return proto.CompactTextString(m) } func (*SSFSample) ProtoMessage() {} -func (*SSFSample) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} } +func (*SSFSample) Descriptor() ([]byte, []int) { return fileDescriptorSample, []int{0} } func (m *SSFSample) GetMetric() SSFSample_Metric { if m != nil { @@ -170,28 +172,28 @@ func (m *SSFSample) GetUnit() string { } type SSFSpan struct { - Version int32 `protobuf:"varint,1,opt,name=version" json:"version,omitempty"` + Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"` // the trace_id is the (span) id of the root span - TraceId int64 `protobuf:"varint,2,opt,name=trace_id,json=traceId" json:"trace_id,omitempty"` + TraceId int64 `protobuf:"varint,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` // the id for this span - Id int64 `protobuf:"varint,3,opt,name=id" json:"id,omitempty"` + Id int64 `protobuf:"varint,3,opt,name=id,proto3" json:"id,omitempty"` // the (span) id of the direct parent, // if this span is not a root span - ParentId int64 `protobuf:"varint,4,opt,name=parent_id,json=parentId" json:"parent_id,omitempty"` - StartTimestamp int64 `protobuf:"varint,5,opt,name=start_timestamp,json=startTimestamp" json:"start_timestamp,omitempty"` - EndTimestamp int64 `protobuf:"varint,6,opt,name=end_timestamp,json=endTimestamp" json:"end_timestamp,omitempty"` + ParentId int64 `protobuf:"varint,4,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"` + StartTimestamp int64 `protobuf:"varint,5,opt,name=start_timestamp,json=startTimestamp,proto3" json:"start_timestamp,omitempty"` + EndTimestamp int64 `protobuf:"varint,6,opt,name=end_timestamp,json=endTimestamp,proto3" json:"end_timestamp,omitempty"` // This flag being true signals that this span was an error. That definition // of error is not implicitly fatal, as a span may error but be fixed by // a subsequent retry, etc. - Error bool `protobuf:"varint,7,opt,name=error" json:"error,omitempty"` + Error bool `protobuf:"varint,7,opt,name=error,proto3" json:"error,omitempty"` // The name of the service // e.g. "veneur" - Service string `protobuf:"bytes,8,opt,name=service" json:"service,omitempty"` + Service string `protobuf:"bytes,8,opt,name=service,proto3" json:"service,omitempty"` Metrics []*SSFSample `protobuf:"bytes,10,rep,name=metrics" json:"metrics,omitempty"` // Tags are name value pairs that describe a facet of the span. They apply to // the *entire* span as opposed to logs which apply to a specific time in // the span. - Tags map[string]string `protobuf:"bytes,11,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"` + Tags map[string]string `protobuf:"bytes,11,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` // An indicator span is one that represents an action that is included in a // service's Service Level Indicators (https://en.wikipedia.org/wiki/Service_level_indicator) // This is a signal to receivers that this span may be used to compute SLIs. @@ -201,17 +203,17 @@ type SSFSpan struct { // It's also worth nothing that an indicator need not be the "root" or first // span in a trace. You might have various forms of middleware that happen // first or you might have multiple services participating in the same trace. - Indicator bool `protobuf:"varint,12,opt,name=indicator" json:"indicator,omitempty"` + Indicator bool `protobuf:"varint,12,opt,name=indicator,proto3" json:"indicator,omitempty"` // What to call this span. This could take the form of the endpoint // (/customer/:id), the function (class::name.method), a friendly name // (foo middleware) or whatever makes sense in your context. - Name string `protobuf:"bytes,13,opt,name=name" json:"name,omitempty"` + Name string `protobuf:"bytes,13,opt,name=name,proto3" json:"name,omitempty"` } func (m *SSFSpan) Reset() { *m = SSFSpan{} } func (m *SSFSpan) String() string { return proto.CompactTextString(m) } func (*SSFSpan) ProtoMessage() {} -func (*SSFSpan) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} } +func (*SSFSpan) Descriptor() ([]byte, []int) { return fileDescriptorSample, []int{1} } func (m *SSFSpan) GetVersion() int32 { if m != nil { @@ -307,7 +309,7 @@ type SSFSpanCollection struct { func (m *SSFSpanCollection) Reset() { *m = SSFSpanCollection{} } func (m *SSFSpanCollection) String() string { return proto.CompactTextString(m) } func (*SSFSpanCollection) ProtoMessage() {} -func (*SSFSpanCollection) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} } +func (*SSFSpanCollection) Descriptor() ([]byte, []int) { return fileDescriptorSample, []int{2} } func (m *SSFSpanCollection) GetSpans() []*SSFSpan { if m != nil { @@ -323,45 +325,1345 @@ func init() { proto.RegisterEnum("ssf.SSFSample_Metric", SSFSample_Metric_name, SSFSample_Metric_value) proto.RegisterEnum("ssf.SSFSample_Status", SSFSample_Status_name, SSFSample_Status_value) } +func (m *SSFSample) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SSFSample) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Metric != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.Metric)) + } + if len(m.Name) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintSample(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if m.Value != 0 { + dAtA[i] = 0x1d + i++ + i = encodeFixed32Sample(dAtA, i, uint32(math.Float32bits(float32(m.Value)))) + } + if m.Timestamp != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.Timestamp)) + } + if len(m.Message) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintSample(dAtA, i, uint64(len(m.Message))) + i += copy(dAtA[i:], m.Message) + } + if m.Status != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.Status)) + } + if m.SampleRate != 0 { + dAtA[i] = 0x3d + i++ + i = encodeFixed32Sample(dAtA, i, uint32(math.Float32bits(float32(m.SampleRate)))) + } + if len(m.Tags) > 0 { + for k, _ := range m.Tags { + dAtA[i] = 0x42 + i++ + v := m.Tags[k] + mapSize := 1 + len(k) + sovSample(uint64(len(k))) + 1 + len(v) + sovSample(uint64(len(v))) + i = encodeVarintSample(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintSample(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintSample(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + if len(m.Unit) > 0 { + dAtA[i] = 0x4a + i++ + i = encodeVarintSample(dAtA, i, uint64(len(m.Unit))) + i += copy(dAtA[i:], m.Unit) + } + return i, nil +} + +func (m *SSFSpan) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SSFSpan) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Version != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.Version)) + } + if m.TraceId != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.TraceId)) + } + if m.Id != 0 { + dAtA[i] = 0x18 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.Id)) + } + if m.ParentId != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.ParentId)) + } + if m.StartTimestamp != 0 { + dAtA[i] = 0x28 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.StartTimestamp)) + } + if m.EndTimestamp != 0 { + dAtA[i] = 0x30 + i++ + i = encodeVarintSample(dAtA, i, uint64(m.EndTimestamp)) + } + if m.Error { + dAtA[i] = 0x38 + i++ + if m.Error { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.Service) > 0 { + dAtA[i] = 0x42 + i++ + i = encodeVarintSample(dAtA, i, uint64(len(m.Service))) + i += copy(dAtA[i:], m.Service) + } + if len(m.Metrics) > 0 { + for _, msg := range m.Metrics { + dAtA[i] = 0x52 + i++ + i = encodeVarintSample(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + if len(m.Tags) > 0 { + for k, _ := range m.Tags { + dAtA[i] = 0x5a + i++ + v := m.Tags[k] + mapSize := 1 + len(k) + sovSample(uint64(len(k))) + 1 + len(v) + sovSample(uint64(len(v))) + i = encodeVarintSample(dAtA, i, uint64(mapSize)) + dAtA[i] = 0xa + i++ + i = encodeVarintSample(dAtA, i, uint64(len(k))) + i += copy(dAtA[i:], k) + dAtA[i] = 0x12 + i++ + i = encodeVarintSample(dAtA, i, uint64(len(v))) + i += copy(dAtA[i:], v) + } + } + if m.Indicator { + dAtA[i] = 0x60 + i++ + if m.Indicator { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if len(m.Name) > 0 { + dAtA[i] = 0x6a + i++ + i = encodeVarintSample(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + return i, nil +} + +func (m *SSFSpanCollection) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SSFSpanCollection) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Spans) > 0 { + for _, msg := range m.Spans { + dAtA[i] = 0xa + i++ + i = encodeVarintSample(dAtA, i, uint64(msg.Size())) + n, err := msg.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n + } + } + return i, nil +} + +func encodeFixed64Sample(dAtA []byte, offset int, v uint64) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + dAtA[offset+4] = uint8(v >> 32) + dAtA[offset+5] = uint8(v >> 40) + dAtA[offset+6] = uint8(v >> 48) + dAtA[offset+7] = uint8(v >> 56) + return offset + 8 +} +func encodeFixed32Sample(dAtA []byte, offset int, v uint32) int { + dAtA[offset] = uint8(v) + dAtA[offset+1] = uint8(v >> 8) + dAtA[offset+2] = uint8(v >> 16) + dAtA[offset+3] = uint8(v >> 24) + return offset + 4 +} +func encodeVarintSample(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *SSFSample) Size() (n int) { + var l int + _ = l + if m.Metric != 0 { + n += 1 + sovSample(uint64(m.Metric)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovSample(uint64(l)) + } + if m.Value != 0 { + n += 5 + } + if m.Timestamp != 0 { + n += 1 + sovSample(uint64(m.Timestamp)) + } + l = len(m.Message) + if l > 0 { + n += 1 + l + sovSample(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovSample(uint64(m.Status)) + } + if m.SampleRate != 0 { + n += 5 + } + if len(m.Tags) > 0 { + for k, v := range m.Tags { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovSample(uint64(len(k))) + 1 + len(v) + sovSample(uint64(len(v))) + n += mapEntrySize + 1 + sovSample(uint64(mapEntrySize)) + } + } + l = len(m.Unit) + if l > 0 { + n += 1 + l + sovSample(uint64(l)) + } + return n +} + +func (m *SSFSpan) Size() (n int) { + var l int + _ = l + if m.Version != 0 { + n += 1 + sovSample(uint64(m.Version)) + } + if m.TraceId != 0 { + n += 1 + sovSample(uint64(m.TraceId)) + } + if m.Id != 0 { + n += 1 + sovSample(uint64(m.Id)) + } + if m.ParentId != 0 { + n += 1 + sovSample(uint64(m.ParentId)) + } + if m.StartTimestamp != 0 { + n += 1 + sovSample(uint64(m.StartTimestamp)) + } + if m.EndTimestamp != 0 { + n += 1 + sovSample(uint64(m.EndTimestamp)) + } + if m.Error { + n += 2 + } + l = len(m.Service) + if l > 0 { + n += 1 + l + sovSample(uint64(l)) + } + if len(m.Metrics) > 0 { + for _, e := range m.Metrics { + l = e.Size() + n += 1 + l + sovSample(uint64(l)) + } + } + if len(m.Tags) > 0 { + for k, v := range m.Tags { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovSample(uint64(len(k))) + 1 + len(v) + sovSample(uint64(len(v))) + n += mapEntrySize + 1 + sovSample(uint64(mapEntrySize)) + } + } + if m.Indicator { + n += 2 + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovSample(uint64(l)) + } + return n +} + +func (m *SSFSpanCollection) Size() (n int) { + var l int + _ = l + if len(m.Spans) > 0 { + for _, e := range m.Spans { + l = e.Size() + n += 1 + l + sovSample(uint64(l)) + } + } + return n +} + +func sovSample(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozSample(x uint64) (n int) { + return sovSample(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SSFSample) 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 ErrIntOverflowSample + } + 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: SSFSample: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SSFSample: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Metric", wireType) + } + m.Metric = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Metric |= (SSFSample_Metric(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 4 + v = uint32(dAtA[iNdEx-4]) + v |= uint32(dAtA[iNdEx-3]) << 8 + v |= uint32(dAtA[iNdEx-2]) << 16 + v |= uint32(dAtA[iNdEx-1]) << 24 + m.Value = float32(math.Float32frombits(v)) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + m.Timestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Timestamp |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Message = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= (SSFSample_Status(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field SampleRate", wireType) + } + var v uint32 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + iNdEx += 4 + v = uint32(dAtA[iNdEx-4]) + v |= uint32(dAtA[iNdEx-3]) << 8 + v |= uint32(dAtA[iNdEx-2]) << 16 + v |= uint32(dAtA[iNdEx-1]) << 24 + m.SampleRate = float32(math.Float32frombits(v)) + 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 ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSample + } + postIndex := iNdEx + msglen + 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 ErrIntOverflowSample + } + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipSample(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSample + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Tags[mapkey] = mapvalue + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Unit", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Unit = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSample(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSample + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SSFSpan) 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 ErrIntOverflowSample + } + 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: SSFSpan: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SSFSpan: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= (int32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TraceId", wireType) + } + m.TraceId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.TraceId |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + m.Id = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Id |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ParentId", wireType) + } + m.ParentId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ParentId |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartTimestamp", wireType) + } + m.StartTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartTimestamp |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field EndTimestamp", wireType) + } + m.EndTimestamp = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.EndTimestamp |= (int64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Error", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Error = bool(v != 0) + case 8: + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Service = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metrics", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSample + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metrics = append(m.Metrics, &SSFSample{}) + if err := m.Metrics[len(m.Metrics)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + 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 ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSample + } + postIndex := iNdEx + msglen + 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 ErrIntOverflowSample + } + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipSample(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSample + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Tags[mapkey] = mapvalue + iNdEx = postIndex + case 12: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Indicator", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Indicator = bool(v != 0) + case 13: + 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 ErrIntOverflowSample + } + 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 ErrInvalidLengthSample + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSample(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSample + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SSFSpanCollection) 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 ErrIntOverflowSample + } + 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: SSFSpanCollection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SSFSpanCollection: 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 ErrIntOverflowSample + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSample + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Spans = append(m.Spans, &SSFSpan{}) + if err := m.Spans[len(m.Spans)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSample(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSample + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSample(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSample + } + 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, ErrIntOverflowSample + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSample + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthSample + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSample + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipSample(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthSample = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSample = fmt.Errorf("proto: integer overflow") +) -func init() { proto.RegisterFile("ssf/sample.proto", fileDescriptor0) } +func init() { proto.RegisterFile("ssf/sample.proto", fileDescriptorSample) } -var fileDescriptor0 = []byte{ - // 576 bytes of a gzipped FileDescriptorProto +var fileDescriptorSample = []byte{ + // 602 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcd, 0x6e, 0x13, 0x3d, - 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0x17, 0x8a, 0x7a, 0x56, + 0x72, 0xfd, 0xb6, 0x64, 0xe6, 0xa0, 0x57, 0xf8, 0xcb, 0x4d, 0xd3, 0xfb, 0x7a, 0xd3, 0xf4, 0xbe, + 0xdd, 0x34, 0xbd, 0x4f, 0xdf, 0x9b, 0x3b, 0x1f, 0x42, 0x7b, 0xf3, 0x2f, 0x7e, 0x06, 0x00, 0x00, + 0xff, 0xff, 0x1e, 0x4b, 0x42, 0x18, 0x07, 0x04, 0x00, 0x00, } diff --git a/trace/trace_test.go b/trace/trace_test.go index 55a2d9c0b..025e362fd 100644 --- a/trace/trace_test.go +++ b/trace/trace_test.go @@ -269,3 +269,11 @@ func TestStripPackageName(t *testing.T) { func assertTagEquals(t *testing.T, sample *ssf.SSFSpan, name, value string) { assert.Equal(t, value, sample.Tags[name]) } + +func BenchmarkMarshalSSF(b *testing.B) { + span := &ssf.SSFSpan{} + + for n := 0; n < b.N; n++ { + proto.Marshal(span) + } +}