From 25ccf5a08ac6d7fd63192be7c30c6d8f9aeaebdc Mon Sep 17 00:00:00 2001 From: alrex Date: Thu, 8 Oct 2020 20:07:39 -0700 Subject: [PATCH] Update proto v0.5.0 (#1230) * Updating version of OTLP to 0.5.0 * updating trace transform to use latest protos * update otlp span test * forgot one test * finishing the rest of the implementation In this change: - MetricDescriptor is no longer a member of the metric - splitting Sum, Gauge, Histogram by Int/Float - SummaryDataPoints are no longer around, MinMaxSumCount is now a Histogram * update changelog * Update CHANGELOG.md Move changes to the Unreleased section. This is to account for the recent release. Co-authored-by: Tyler Yahn --- CHANGELOG.md | 1 + exporters/otlp/internal/opentelemetry-proto | 2 +- .../collector/logs/v1/logs_service.pb.go | 577 ++ .../logs/v1/logs.pb.go | 1447 +++++ .../metrics/v1/metrics.pb.go | 4814 ++++++++++++----- .../trace/v1/trace.pb.go | 269 +- exporters/otlp/internal/transform/metric.go | 247 +- .../otlp/internal/transform/metric_test.go | 183 +- exporters/otlp/internal/transform/span.go | 14 +- .../otlp/internal/transform/span_test.go | 18 +- exporters/otlp/otlp_integration_test.go | 56 +- exporters/otlp/otlp_metric_test.go | 404 +- exporters/otlp/otlp_span_test.go | 16 +- 13 files changed, 5969 insertions(+), 2079 deletions(-) create mode 100644 exporters/otlp/internal/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go create mode 100644 exporters/otlp/internal/opentelemetry-proto-gen/logs/v1/logs.pb.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c1f0f604..6fda30d89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - `ErrorOption` has been changed to an interface to conform with project design standards which included adding a `NewErrorConfig` function. - `EmptySpanContext` is removed. - Move the `go.opentelemetry.io/otel/api/trace/tracetest` package into `go.opentelemetry.io/otel/oteltest`. (#1229) +- OTLP Exporter supports OTLP v0.5.0. (#1230) ## [0.13.0] - 2020-10-08 diff --git a/exporters/otlp/internal/opentelemetry-proto b/exporters/otlp/internal/opentelemetry-proto index e43e1abc4..313a868be 160000 --- a/exporters/otlp/internal/opentelemetry-proto +++ b/exporters/otlp/internal/opentelemetry-proto @@ -1 +1 @@ -Subproject commit e43e1abc40428a6ee98e3bfd79bec1dfa2ed18cd +Subproject commit 313a868be259dce6c6516dd417d3ad5fd3321acf diff --git a/exporters/otlp/internal/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go b/exporters/otlp/internal/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go new file mode 100644 index 000000000..9d9b8d67d --- /dev/null +++ b/exporters/otlp/internal/opentelemetry-proto-gen/collector/logs/v1/logs_service.pb.go @@ -0,0 +1,577 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: opentelemetry/proto/collector/logs/v1/logs_service.proto + +package v1 + +import ( + context "context" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + v1 "go.opentelemetry.io/otel/exporters/otlp/internal/opentelemetry-proto-gen/logs/v1" + 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" +) + +// 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 ExportLogsServiceRequest struct { + // An array of ResourceLogs. + // For data coming from a single resource this array will typically contain one + // element. Intermediary nodes (such as OpenTelemetry Collector) that receive + // data from multiple origins typically batch the data before forwarding further and + // in that case this array will contain multiple elements. + ResourceLogs []*v1.ResourceLogs `protobuf:"bytes,1,rep,name=resource_logs,json=resourceLogs,proto3" json:"resource_logs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExportLogsServiceRequest) Reset() { *m = ExportLogsServiceRequest{} } +func (m *ExportLogsServiceRequest) String() string { return proto.CompactTextString(m) } +func (*ExportLogsServiceRequest) ProtoMessage() {} +func (*ExportLogsServiceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_8e3bf87aaa43acd4, []int{0} +} +func (m *ExportLogsServiceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExportLogsServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExportLogsServiceRequest.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 *ExportLogsServiceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExportLogsServiceRequest.Merge(m, src) +} +func (m *ExportLogsServiceRequest) XXX_Size() int { + return m.Size() +} +func (m *ExportLogsServiceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_ExportLogsServiceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_ExportLogsServiceRequest proto.InternalMessageInfo + +func (m *ExportLogsServiceRequest) GetResourceLogs() []*v1.ResourceLogs { + if m != nil { + return m.ResourceLogs + } + return nil +} + +type ExportLogsServiceResponse struct { + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ExportLogsServiceResponse) Reset() { *m = ExportLogsServiceResponse{} } +func (m *ExportLogsServiceResponse) String() string { return proto.CompactTextString(m) } +func (*ExportLogsServiceResponse) ProtoMessage() {} +func (*ExportLogsServiceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_8e3bf87aaa43acd4, []int{1} +} +func (m *ExportLogsServiceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExportLogsServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExportLogsServiceResponse.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 *ExportLogsServiceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExportLogsServiceResponse.Merge(m, src) +} +func (m *ExportLogsServiceResponse) XXX_Size() int { + return m.Size() +} +func (m *ExportLogsServiceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ExportLogsServiceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ExportLogsServiceResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*ExportLogsServiceRequest)(nil), "opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest") + proto.RegisterType((*ExportLogsServiceResponse)(nil), "opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse") +} + +func init() { + proto.RegisterFile("opentelemetry/proto/collector/logs/v1/logs_service.proto", fileDescriptor_8e3bf87aaa43acd4) +} + +var fileDescriptor_8e3bf87aaa43acd4 = []byte{ + // 290 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0x4a, 0x03, 0x31, + 0x14, 0x86, 0x0d, 0x42, 0x17, 0xa9, 0x82, 0xcc, 0xaa, 0x56, 0x18, 0x64, 0x40, 0xa9, 0x8b, 0x26, + 0xb4, 0x6e, 0xdc, 0x29, 0x05, 0x77, 0x22, 0x65, 0xdc, 0x75, 0x53, 0x74, 0x78, 0x0c, 0x23, 0x31, + 0x2f, 0xbe, 0xa4, 0x83, 0x1e, 0xc2, 0x23, 0xb8, 0xf5, 0x2c, 0x2e, 0x3d, 0x82, 0xcc, 0x49, 0x64, + 0x92, 0x22, 0x53, 0x1d, 0x61, 0x70, 0x15, 0xf2, 0xf2, 0x7f, 0xff, 0xff, 0x3f, 0x08, 0x3f, 0x43, + 0x03, 0xda, 0x81, 0x82, 0x07, 0x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d, 0xfb, 0xcf, 0xdc, + 0xf5, 0xfc, 0xe3, 0xe9, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x46, 0x1c, 0xa2, 0x18, 0x63, 0x02, + 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 + +// LogsServiceClient is the client API for LogsService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type LogsServiceClient interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error) +} + +type logsServiceClient struct { + cc *grpc.ClientConn +} + +func NewLogsServiceClient(cc *grpc.ClientConn) LogsServiceClient { + return &logsServiceClient{cc} +} + +func (c *logsServiceClient) Export(ctx context.Context, in *ExportLogsServiceRequest, opts ...grpc.CallOption) (*ExportLogsServiceResponse, error) { + out := new(ExportLogsServiceResponse) + err := c.cc.Invoke(ctx, "/opentelemetry.proto.collector.logs.v1.LogsService/Export", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// LogsServiceServer is the server API for LogsService service. +type LogsServiceServer interface { + // For performance reasons, it is recommended to keep this RPC + // alive for the entire life of the application. + Export(context.Context, *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error) +} + +// UnimplementedLogsServiceServer can be embedded to have forward compatible implementations. +type UnimplementedLogsServiceServer struct { +} + +func (*UnimplementedLogsServiceServer) Export(ctx context.Context, req *ExportLogsServiceRequest) (*ExportLogsServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Export not implemented") +} + +func RegisterLogsServiceServer(s *grpc.Server, srv LogsServiceServer) { + s.RegisterService(&_LogsService_serviceDesc, srv) +} + +func _LogsService_Export_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExportLogsServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(LogsServiceServer).Export(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/opentelemetry.proto.collector.logs.v1.LogsService/Export", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(LogsServiceServer).Export(ctx, req.(*ExportLogsServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _LogsService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "opentelemetry.proto.collector.logs.v1.LogsService", + HandlerType: (*LogsServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Export", + Handler: _LogsService_Export_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "opentelemetry/proto/collector/logs/v1/logs_service.proto", +} + +func (m *ExportLogsServiceRequest) 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 *ExportLogsServiceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExportLogsServiceRequest) 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.ResourceLogs) > 0 { + for iNdEx := len(m.ResourceLogs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ResourceLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogsService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *ExportLogsServiceResponse) 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 *ExportLogsServiceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExportLogsServiceResponse) 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 encodeVarintLogsService(dAtA []byte, offset int, v uint64) int { + offset -= sovLogsService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ExportLogsServiceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ResourceLogs) > 0 { + for _, e := range m.ResourceLogs { + l = e.Size() + n += 1 + l + sovLogsService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ExportLogsServiceResponse) 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 sovLogsService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLogsService(x uint64) (n int) { + return sovLogsService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ExportLogsServiceRequest) 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 ErrIntOverflowLogsService + } + 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: ExportLogsServiceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExportLogsServiceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ResourceLogs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogsService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogsService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogsService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ResourceLogs = append(m.ResourceLogs, &v1.ResourceLogs{}) + if err := m.ResourceLogs[len(m.ResourceLogs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogsService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogsService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogsService + } + 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 *ExportLogsServiceResponse) 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 ErrIntOverflowLogsService + } + 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: ExportLogsServiceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExportLogsServiceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipLogsService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogsService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogsService + } + 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 skipLogsService(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, ErrIntOverflowLogsService + } + 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, ErrIntOverflowLogsService + } + 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, ErrIntOverflowLogsService + } + 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, ErrInvalidLengthLogsService + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLogsService + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLogsService + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLogsService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLogsService = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLogsService = fmt.Errorf("proto: unexpected end of group") +) diff --git a/exporters/otlp/internal/opentelemetry-proto-gen/logs/v1/logs.pb.go b/exporters/otlp/internal/opentelemetry-proto-gen/logs/v1/logs.pb.go new file mode 100644 index 000000000..06e62e6a6 --- /dev/null +++ b/exporters/otlp/internal/opentelemetry-proto-gen/logs/v1/logs.pb.go @@ -0,0 +1,1447 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: opentelemetry/proto/logs/v1/logs.proto + +package v1 + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + v11 "go.opentelemetry.io/otel/exporters/otlp/internal/opentelemetry-proto-gen/common/v1" + v1 "go.opentelemetry.io/otel/exporters/otlp/internal/opentelemetry-proto-gen/resource/v1" + io "io" + math "math" + math_bits "math/bits" +) + +// 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 + +// Possible values for LogRecord.SeverityNumber. +type SeverityNumber int32 + +const ( + // UNSPECIFIED is the default SeverityNumber, it MUST not be used. + SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED SeverityNumber = 0 + SeverityNumber_SEVERITY_NUMBER_TRACE SeverityNumber = 1 + SeverityNumber_SEVERITY_NUMBER_TRACE2 SeverityNumber = 2 + SeverityNumber_SEVERITY_NUMBER_TRACE3 SeverityNumber = 3 + SeverityNumber_SEVERITY_NUMBER_TRACE4 SeverityNumber = 4 + SeverityNumber_SEVERITY_NUMBER_DEBUG SeverityNumber = 5 + SeverityNumber_SEVERITY_NUMBER_DEBUG2 SeverityNumber = 6 + SeverityNumber_SEVERITY_NUMBER_DEBUG3 SeverityNumber = 7 + SeverityNumber_SEVERITY_NUMBER_DEBUG4 SeverityNumber = 8 + SeverityNumber_SEVERITY_NUMBER_INFO SeverityNumber = 9 + SeverityNumber_SEVERITY_NUMBER_INFO2 SeverityNumber = 10 + SeverityNumber_SEVERITY_NUMBER_INFO3 SeverityNumber = 11 + SeverityNumber_SEVERITY_NUMBER_INFO4 SeverityNumber = 12 + SeverityNumber_SEVERITY_NUMBER_WARN SeverityNumber = 13 + SeverityNumber_SEVERITY_NUMBER_WARN2 SeverityNumber = 14 + SeverityNumber_SEVERITY_NUMBER_WARN3 SeverityNumber = 15 + SeverityNumber_SEVERITY_NUMBER_WARN4 SeverityNumber = 16 + SeverityNumber_SEVERITY_NUMBER_ERROR SeverityNumber = 17 + SeverityNumber_SEVERITY_NUMBER_ERROR2 SeverityNumber = 18 + SeverityNumber_SEVERITY_NUMBER_ERROR3 SeverityNumber = 19 + SeverityNumber_SEVERITY_NUMBER_ERROR4 SeverityNumber = 20 + SeverityNumber_SEVERITY_NUMBER_FATAL SeverityNumber = 21 + SeverityNumber_SEVERITY_NUMBER_FATAL2 SeverityNumber = 22 + SeverityNumber_SEVERITY_NUMBER_FATAL3 SeverityNumber = 23 + SeverityNumber_SEVERITY_NUMBER_FATAL4 SeverityNumber = 24 +) + +var SeverityNumber_name = map[int32]string{ + 0: "SEVERITY_NUMBER_UNSPECIFIED", + 1: "SEVERITY_NUMBER_TRACE", + 2: "SEVERITY_NUMBER_TRACE2", + 3: "SEVERITY_NUMBER_TRACE3", + 4: "SEVERITY_NUMBER_TRACE4", + 5: "SEVERITY_NUMBER_DEBUG", + 6: "SEVERITY_NUMBER_DEBUG2", + 7: "SEVERITY_NUMBER_DEBUG3", + 8: "SEVERITY_NUMBER_DEBUG4", + 9: "SEVERITY_NUMBER_INFO", + 10: "SEVERITY_NUMBER_INFO2", + 11: "SEVERITY_NUMBER_INFO3", + 12: "SEVERITY_NUMBER_INFO4", + 13: "SEVERITY_NUMBER_WARN", + 14: "SEVERITY_NUMBER_WARN2", + 15: "SEVERITY_NUMBER_WARN3", + 16: "SEVERITY_NUMBER_WARN4", + 17: "SEVERITY_NUMBER_ERROR", + 18: "SEVERITY_NUMBER_ERROR2", + 19: "SEVERITY_NUMBER_ERROR3", + 20: "SEVERITY_NUMBER_ERROR4", + 21: "SEVERITY_NUMBER_FATAL", + 22: "SEVERITY_NUMBER_FATAL2", + 23: "SEVERITY_NUMBER_FATAL3", + 24: "SEVERITY_NUMBER_FATAL4", +} + +var SeverityNumber_value = map[string]int32{ + "SEVERITY_NUMBER_UNSPECIFIED": 0, + "SEVERITY_NUMBER_TRACE": 1, + "SEVERITY_NUMBER_TRACE2": 2, + "SEVERITY_NUMBER_TRACE3": 3, + "SEVERITY_NUMBER_TRACE4": 4, + "SEVERITY_NUMBER_DEBUG": 5, + "SEVERITY_NUMBER_DEBUG2": 6, + "SEVERITY_NUMBER_DEBUG3": 7, + "SEVERITY_NUMBER_DEBUG4": 8, + "SEVERITY_NUMBER_INFO": 9, + "SEVERITY_NUMBER_INFO2": 10, + "SEVERITY_NUMBER_INFO3": 11, + "SEVERITY_NUMBER_INFO4": 12, + "SEVERITY_NUMBER_WARN": 13, + "SEVERITY_NUMBER_WARN2": 14, + "SEVERITY_NUMBER_WARN3": 15, + "SEVERITY_NUMBER_WARN4": 16, + "SEVERITY_NUMBER_ERROR": 17, + "SEVERITY_NUMBER_ERROR2": 18, + "SEVERITY_NUMBER_ERROR3": 19, + "SEVERITY_NUMBER_ERROR4": 20, + "SEVERITY_NUMBER_FATAL": 21, + "SEVERITY_NUMBER_FATAL2": 22, + "SEVERITY_NUMBER_FATAL3": 23, + "SEVERITY_NUMBER_FATAL4": 24, +} + +func (x SeverityNumber) String() string { + return proto.EnumName(SeverityNumber_name, int32(x)) +} + +func (SeverityNumber) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d1c030a3ec7e961e, []int{0} +} + +// Masks for LogRecord.flags field. +type LogRecordFlags int32 + +const ( + LogRecordFlags_LOG_RECORD_FLAG_UNSPECIFIED LogRecordFlags = 0 + LogRecordFlags_LOG_RECORD_FLAG_TRACE_FLAGS_MASK LogRecordFlags = 255 +) + +var LogRecordFlags_name = map[int32]string{ + 0: "LOG_RECORD_FLAG_UNSPECIFIED", + 255: "LOG_RECORD_FLAG_TRACE_FLAGS_MASK", +} + +var LogRecordFlags_value = map[string]int32{ + "LOG_RECORD_FLAG_UNSPECIFIED": 0, + "LOG_RECORD_FLAG_TRACE_FLAGS_MASK": 255, +} + +func (x LogRecordFlags) String() string { + return proto.EnumName(LogRecordFlags_name, int32(x)) +} + +func (LogRecordFlags) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d1c030a3ec7e961e, []int{1} +} + +// A collection of InstrumentationLibraryLogs from a Resource. +type ResourceLogs struct { + // The resource for the logs in this message. + // If this field is not set then no resource info is known. + Resource *v1.Resource `protobuf:"bytes,1,opt,name=resource,proto3" json:"resource,omitempty"` + // A list of InstrumentationLibraryLogs that originate from a resource. + InstrumentationLibraryLogs []*InstrumentationLibraryLogs `protobuf:"bytes,2,rep,name=instrumentation_library_logs,json=instrumentationLibraryLogs,proto3" json:"instrumentation_library_logs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ResourceLogs) Reset() { *m = ResourceLogs{} } +func (m *ResourceLogs) String() string { return proto.CompactTextString(m) } +func (*ResourceLogs) ProtoMessage() {} +func (*ResourceLogs) Descriptor() ([]byte, []int) { + return fileDescriptor_d1c030a3ec7e961e, []int{0} +} +func (m *ResourceLogs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ResourceLogs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ResourceLogs.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 *ResourceLogs) XXX_Merge(src proto.Message) { + xxx_messageInfo_ResourceLogs.Merge(m, src) +} +func (m *ResourceLogs) XXX_Size() int { + return m.Size() +} +func (m *ResourceLogs) XXX_DiscardUnknown() { + xxx_messageInfo_ResourceLogs.DiscardUnknown(m) +} + +var xxx_messageInfo_ResourceLogs proto.InternalMessageInfo + +func (m *ResourceLogs) GetResource() *v1.Resource { + if m != nil { + return m.Resource + } + return nil +} + +func (m *ResourceLogs) GetInstrumentationLibraryLogs() []*InstrumentationLibraryLogs { + if m != nil { + return m.InstrumentationLibraryLogs + } + return nil +} + +// A collection of Logs produced by an InstrumentationLibrary. +type InstrumentationLibraryLogs struct { + // The instrumentation library information for the logs in this message. + // If this field is not set then no library info is known. + InstrumentationLibrary *v11.InstrumentationLibrary `protobuf:"bytes,1,opt,name=instrumentation_library,json=instrumentationLibrary,proto3" json:"instrumentation_library,omitempty"` + // A list of log records. + Logs []*LogRecord `protobuf:"bytes,2,rep,name=logs,proto3" json:"logs,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InstrumentationLibraryLogs) Reset() { *m = InstrumentationLibraryLogs{} } +func (m *InstrumentationLibraryLogs) String() string { return proto.CompactTextString(m) } +func (*InstrumentationLibraryLogs) ProtoMessage() {} +func (*InstrumentationLibraryLogs) Descriptor() ([]byte, []int) { + return fileDescriptor_d1c030a3ec7e961e, []int{1} +} +func (m *InstrumentationLibraryLogs) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InstrumentationLibraryLogs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_InstrumentationLibraryLogs.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 *InstrumentationLibraryLogs) XXX_Merge(src proto.Message) { + xxx_messageInfo_InstrumentationLibraryLogs.Merge(m, src) +} +func (m *InstrumentationLibraryLogs) XXX_Size() int { + return m.Size() +} +func (m *InstrumentationLibraryLogs) XXX_DiscardUnknown() { + xxx_messageInfo_InstrumentationLibraryLogs.DiscardUnknown(m) +} + +var xxx_messageInfo_InstrumentationLibraryLogs proto.InternalMessageInfo + +func (m *InstrumentationLibraryLogs) GetInstrumentationLibrary() *v11.InstrumentationLibrary { + if m != nil { + return m.InstrumentationLibrary + } + return nil +} + +func (m *InstrumentationLibraryLogs) GetLogs() []*LogRecord { + if m != nil { + return m.Logs + } + return nil +} + +// A log record according to OpenTelemetry Log Data Model: +// https://github.com/open-telemetry/oteps/blob/master/text/logs/0097-log-data-model.md +type LogRecord struct { + // time_unix_nano is the time when the event occurred. + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // Value of 0 indicates unknown or missing timestamp. + TimeUnixNano uint64 `protobuf:"fixed64,1,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // Numerical value of the severity, normalized to values described in Log Data Model. + // [Optional]. + SeverityNumber SeverityNumber `protobuf:"varint,2,opt,name=severity_number,json=severityNumber,proto3,enum=opentelemetry.proto.logs.v1.SeverityNumber" json:"severity_number,omitempty"` + // The severity text (also known as log level). The original string representation as + // it is known at the source. [Optional]. + SeverityText string `protobuf:"bytes,3,opt,name=severity_text,json=severityText,proto3" json:"severity_text,omitempty"` + // Short event identifier that does not contain varying parts. Name describes + // what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50 + // characters. Not guaranteed to be unique in any way. [Optional]. + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + // A value containing the body of the log record. Can be for example a human-readable + // string message (including multi-line) describing the event in a free form or it can + // be a structured data composed of arrays and maps of other values. [Optional]. + Body *v11.AnyValue `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"` + // Additional attributes that describe the specific event occurrence. [Optional]. + Attributes []*v11.KeyValue `protobuf:"bytes,6,rep,name=attributes,proto3" json:"attributes,omitempty"` + DroppedAttributesCount uint32 `protobuf:"varint,7,opt,name=dropped_attributes_count,json=droppedAttributesCount,proto3" json:"dropped_attributes_count,omitempty"` + // Flags, a bit field. 8 least significant bits are the trace flags as + // defined in W3C Trace Context specification. 24 most significant bits are reserved + // and must be set to 0. Readers must not assume that 24 most significant bits + // will be zero and must correctly mask the bits when reading 8-bit trace flag (use + // flags & TRACE_FLAGS_MASK). [Optional]. + Flags uint32 `protobuf:"fixed32,8,opt,name=flags,proto3" json:"flags,omitempty"` + // A unique identifier for a trace. All logs from the same trace share + // the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes + // is considered invalid. Can be set for logs that are part of request processing + // and have an assigned trace id. [Optional]. + TraceId []byte `protobuf:"bytes,9,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + // A unique identifier for a span within a trace, assigned when the span + // is created. The ID is an 8-byte array. An ID with all zeroes is considered + // invalid. Can be set for logs that are part of a particular processing span. + // If span_id is present trace_id SHOULD be also present. [Optional]. + SpanId []byte `protobuf:"bytes,10,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LogRecord) Reset() { *m = LogRecord{} } +func (m *LogRecord) String() string { return proto.CompactTextString(m) } +func (*LogRecord) ProtoMessage() {} +func (*LogRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_d1c030a3ec7e961e, []int{2} +} +func (m *LogRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LogRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LogRecord.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 *LogRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_LogRecord.Merge(m, src) +} +func (m *LogRecord) XXX_Size() int { + return m.Size() +} +func (m *LogRecord) XXX_DiscardUnknown() { + xxx_messageInfo_LogRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_LogRecord proto.InternalMessageInfo + +func (m *LogRecord) GetTimeUnixNano() uint64 { + if m != nil { + return m.TimeUnixNano + } + return 0 +} + +func (m *LogRecord) GetSeverityNumber() SeverityNumber { + if m != nil { + return m.SeverityNumber + } + return SeverityNumber_SEVERITY_NUMBER_UNSPECIFIED +} + +func (m *LogRecord) GetSeverityText() string { + if m != nil { + return m.SeverityText + } + return "" +} + +func (m *LogRecord) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LogRecord) GetBody() *v11.AnyValue { + if m != nil { + return m.Body + } + return nil +} + +func (m *LogRecord) GetAttributes() []*v11.KeyValue { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *LogRecord) GetDroppedAttributesCount() uint32 { + if m != nil { + return m.DroppedAttributesCount + } + return 0 +} + +func (m *LogRecord) GetFlags() uint32 { + if m != nil { + return m.Flags + } + return 0 +} + +func (m *LogRecord) GetTraceId() []byte { + if m != nil { + return m.TraceId + } + return nil +} + +func (m *LogRecord) GetSpanId() []byte { + if m != nil { + return m.SpanId + } + return nil +} + +func init() { + proto.RegisterEnum("opentelemetry.proto.logs.v1.SeverityNumber", SeverityNumber_name, SeverityNumber_value) + proto.RegisterEnum("opentelemetry.proto.logs.v1.LogRecordFlags", LogRecordFlags_name, LogRecordFlags_value) + proto.RegisterType((*ResourceLogs)(nil), "opentelemetry.proto.logs.v1.ResourceLogs") + proto.RegisterType((*InstrumentationLibraryLogs)(nil), "opentelemetry.proto.logs.v1.InstrumentationLibraryLogs") + proto.RegisterType((*LogRecord)(nil), "opentelemetry.proto.logs.v1.LogRecord") +} + +func init() { + proto.RegisterFile("opentelemetry/proto/logs/v1/logs.proto", fileDescriptor_d1c030a3ec7e961e) +} + +var fileDescriptor_d1c030a3ec7e961e = []byte{ + // 785 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x95, 0xdd, 0x6e, 0x22, 0x37, + 0x14, 0xc7, 0xeb, 0x84, 0x40, 0xe2, 0x10, 0xd6, 0x75, 0xb3, 0xc9, 0x2c, 0xa9, 0xb2, 0xa3, 0xb4, + 0xdd, 0xd2, 0x54, 0xcb, 0x28, 0x03, 0x55, 0xab, 0xf6, 0x6a, 0x42, 0x06, 0x84, 0x96, 0x05, 0x64, + 0x60, 0xfb, 0x71, 0x33, 0x1a, 0xc0, 0x45, 0x23, 0x0d, 0x36, 0xf2, 0x18, 0x04, 0xcf, 0xd0, 0xc7, + 0xea, 0xcd, 0xaa, 0x57, 0xfb, 0x08, 0x55, 0x5e, 0xa4, 0xd5, 0x98, 0x8f, 0x5d, 0xd0, 0x98, 0x5c, + 0x61, 0x9f, 0xdf, 0xf9, 0xff, 0x7d, 0xce, 0x91, 0xf1, 0xc0, 0x57, 0x7c, 0x42, 0x99, 0xa4, 0x21, + 0x1d, 0x53, 0x29, 0x16, 0xd6, 0x44, 0x70, 0xc9, 0xad, 0x90, 0x8f, 0x22, 0x6b, 0x76, 0xa7, 0x7e, + 0x8b, 0x2a, 0x84, 0xaf, 0xb6, 0xf2, 0x96, 0xc1, 0xa2, 0xe2, 0xb3, 0xbb, 0xfc, 0x6d, 0x92, 0xc9, + 0x80, 0x8f, 0xc7, 0x9c, 0xc5, 0x36, 0xcb, 0xd5, 0x52, 0x93, 0x2f, 0x26, 0xe5, 0x0a, 0x1a, 0xf1, + 0xa9, 0x18, 0xd0, 0x38, 0x7b, 0xbd, 0x5e, 0xe6, 0xdf, 0x7c, 0x00, 0x30, 0x4b, 0x56, 0x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, 0x0d, 0x3e, 0x3c, 0x5e, 0x83, 0x7f, 0x1f, 0xaf, 0x01, 0xbc, 0x0e, 0xf8, 0xbe, 0x07, + 0xeb, 0x3e, 0x7e, 0x18, 0xa3, 0x76, 0x1c, 0x6a, 0x83, 0x3f, 0xda, 0xa3, 0xdd, 0xe4, 0x80, 0x5b, + 0x5c, 0xd2, 0xd0, 0xa2, 0xf3, 0x09, 0x17, 0x92, 0x8a, 0xc8, 0xe2, 0x32, 0x9c, 0x58, 0x01, 0x93, + 0x54, 0x30, 0x3f, 0xb4, 0xb6, 0xb2, 0x5f, 0x2b, 0xeb, 0xd7, 0x23, 0xca, 0xd6, 0x1f, 0xe7, 0x7e, + 0x5a, 0x85, 0x4a, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x15, 0xaa, 0xeb, 0xc2, 0x07, 0x00, + 0x00, +} + +func (m *ResourceLogs) 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 *ResourceLogs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ResourceLogs) 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.InstrumentationLibraryLogs) > 0 { + for iNdEx := len(m.InstrumentationLibraryLogs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InstrumentationLibraryLogs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Resource != nil { + { + size, err := m.Resource.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *InstrumentationLibraryLogs) 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 *InstrumentationLibraryLogs) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InstrumentationLibraryLogs) 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.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 = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.InstrumentationLibrary != nil { + { + size, err := m.InstrumentationLibrary.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LogRecord) 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 *LogRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LogRecord) 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.SpanId) > 0 { + i -= len(m.SpanId) + copy(dAtA[i:], m.SpanId) + i = encodeVarintLogs(dAtA, i, uint64(len(m.SpanId))) + i-- + dAtA[i] = 0x52 + } + if len(m.TraceId) > 0 { + i -= len(m.TraceId) + copy(dAtA[i:], m.TraceId) + i = encodeVarintLogs(dAtA, i, uint64(len(m.TraceId))) + i-- + dAtA[i] = 0x4a + } + if m.Flags != 0 { + i -= 4 + encoding_binary.LittleEndian.PutUint32(dAtA[i:], uint32(m.Flags)) + i-- + dAtA[i] = 0x45 + } + if m.DroppedAttributesCount != 0 { + i = encodeVarintLogs(dAtA, i, uint64(m.DroppedAttributesCount)) + i-- + dAtA[i] = 0x38 + } + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.Body != nil { + { + size, err := m.Body.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogs(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintLogs(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if len(m.SeverityText) > 0 { + i -= len(m.SeverityText) + copy(dAtA[i:], m.SeverityText) + i = encodeVarintLogs(dAtA, i, uint64(len(m.SeverityText))) + i-- + dAtA[i] = 0x1a + } + if m.SeverityNumber != 0 { + i = encodeVarintLogs(dAtA, i, uint64(m.SeverityNumber)) + i-- + dAtA[i] = 0x10 + } + if m.TimeUnixNano != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TimeUnixNano)) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func encodeVarintLogs(dAtA []byte, offset int, v uint64) int { + offset -= sovLogs(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ResourceLogs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Resource != nil { + l = m.Resource.Size() + n += 1 + l + sovLogs(uint64(l)) + } + if len(m.InstrumentationLibraryLogs) > 0 { + for _, e := range m.InstrumentationLibraryLogs { + l = e.Size() + n += 1 + l + sovLogs(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *InstrumentationLibraryLogs) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.InstrumentationLibrary != nil { + l = m.InstrumentationLibrary.Size() + n += 1 + l + sovLogs(uint64(l)) + } + if len(m.Logs) > 0 { + for _, e := range m.Logs { + l = e.Size() + n += 1 + l + sovLogs(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LogRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TimeUnixNano != 0 { + n += 9 + } + if m.SeverityNumber != 0 { + n += 1 + sovLogs(uint64(m.SeverityNumber)) + } + l = len(m.SeverityText) + if l > 0 { + n += 1 + l + sovLogs(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovLogs(uint64(l)) + } + if m.Body != nil { + l = m.Body.Size() + n += 1 + l + sovLogs(uint64(l)) + } + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovLogs(uint64(l)) + } + } + if m.DroppedAttributesCount != 0 { + n += 1 + sovLogs(uint64(m.DroppedAttributesCount)) + } + if m.Flags != 0 { + n += 5 + } + l = len(m.TraceId) + if l > 0 { + n += 1 + l + sovLogs(uint64(l)) + } + l = len(m.SpanId) + if l > 0 { + n += 1 + l + sovLogs(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovLogs(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLogs(x uint64) (n int) { + return sovLogs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ResourceLogs) 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 ErrIntOverflowLogs + } + 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: ResourceLogs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ResourceLogs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Resource", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Resource == nil { + m.Resource = &v1.Resource{} + } + if err := m.Resource.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibraryLogs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InstrumentationLibraryLogs = append(m.InstrumentationLibraryLogs, &InstrumentationLibraryLogs{}) + if err := m.InstrumentationLibraryLogs[len(m.InstrumentationLibraryLogs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogs + } + 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 *InstrumentationLibraryLogs) 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 ErrIntOverflowLogs + } + 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: InstrumentationLibraryLogs: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: InstrumentationLibraryLogs: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InstrumentationLibrary", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.InstrumentationLibrary == nil { + m.InstrumentationLibrary = &v11.InstrumentationLibrary{} + } + if err := m.InstrumentationLibrary.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Logs = append(m.Logs, &LogRecord{}) + if err := m.Logs[len(m.Logs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogs + } + 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 *LogRecord) 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 ErrIntOverflowLogs + } + 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: LogRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LogRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) + } + m.TimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SeverityNumber", wireType) + } + m.SeverityNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SeverityNumber |= SeverityNumber(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SeverityText", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + 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 ErrInvalidLengthLogs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SeverityText = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + 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 ErrIntOverflowLogs + } + 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 ErrInvalidLengthLogs + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Body", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Body == nil { + m.Body = &v11.AnyValue{} + } + if err := m.Body.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &v11.KeyValue{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DroppedAttributesCount", wireType) + } + m.DroppedAttributesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DroppedAttributesCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 5 { + return fmt.Errorf("proto: wrong wireType = %d for field Flags", wireType) + } + m.Flags = 0 + if (iNdEx + 4) > l { + return io.ErrUnexpectedEOF + } + m.Flags = uint32(encoding_binary.LittleEndian.Uint32(dAtA[iNdEx:])) + iNdEx += 4 + case 9: + 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 ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceId = append(m.TraceId[:0], dAtA[iNdEx:postIndex]...) + if m.TraceId == nil { + m.TraceId = []byte{} + } + iNdEx = postIndex + case 10: + 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 ErrIntOverflowLogs + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthLogs + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthLogs + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpanId = append(m.SpanId[:0], dAtA[iNdEx:postIndex]...) + if m.SpanId == nil { + m.SpanId = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLogs(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthLogs + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthLogs + } + 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 skipLogs(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, ErrIntOverflowLogs + } + 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, ErrIntOverflowLogs + } + 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, ErrIntOverflowLogs + } + 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, ErrInvalidLengthLogs + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLogs + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLogs + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLogs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLogs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLogs = fmt.Errorf("proto: unexpected end of group") +) diff --git a/exporters/otlp/internal/opentelemetry-proto-gen/metrics/v1/metrics.pb.go b/exporters/otlp/internal/opentelemetry-proto-gen/metrics/v1/metrics.pb.go index 88be6b7f1..eadfe5c13 100644 --- a/exporters/otlp/internal/opentelemetry-proto-gen/metrics/v1/metrics.pb.go +++ b/exporters/otlp/internal/opentelemetry-proto-gen/metrics/v1/metrics.pb.go @@ -25,86 +25,16 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Type is the type of values a metric has. -type MetricDescriptor_Type int32 +// AggregationTemporality defines how a metric aggregator reports aggregated +// values. It describes how those values relate to the time interval over +// which they are aggregated. +type AggregationTemporality int32 const ( - // INVALID_TYPE is the default Type, it MUST not be used. - MetricDescriptor_INVALID_TYPE MetricDescriptor_Type = 0 - // INT64 values are signed 64-bit integers. - // - // A Metric of this Type MUST store its values as Int64DataPoint. - MetricDescriptor_INT64 MetricDescriptor_Type = 1 - // MONOTONIC_INT64 values are monotonically increasing signed 64-bit - // integers. - // - // A Metric of this Type MUST store its values as Int64DataPoint. - MetricDescriptor_MONOTONIC_INT64 MetricDescriptor_Type = 2 - // DOUBLE values are double-precision floating-point numbers. - // - // A Metric of this Type MUST store its values as DoubleDataPoint. - MetricDescriptor_DOUBLE MetricDescriptor_Type = 3 - // MONOTONIC_DOUBLE values are monotonically increasing double-precision - // floating-point numbers. - // - // A Metric of this Type MUST store its values as DoubleDataPoint. - MetricDescriptor_MONOTONIC_DOUBLE MetricDescriptor_Type = 4 - // Histogram measurement. - // Corresponding values are stored in HistogramDataPoint. - MetricDescriptor_HISTOGRAM MetricDescriptor_Type = 5 - // Summary value. Some frameworks implemented Histograms as a summary of observations - // (usually things like request durations and response sizes). While it - // also provides a total count of observations and a sum of all observed - // values, it calculates configurable percentiles over a sliding time - // window. - // Corresponding values are stored in SummaryDataPoint. - MetricDescriptor_SUMMARY MetricDescriptor_Type = 6 -) - -var MetricDescriptor_Type_name = map[int32]string{ - 0: "INVALID_TYPE", - 1: "INT64", - 2: "MONOTONIC_INT64", - 3: "DOUBLE", - 4: "MONOTONIC_DOUBLE", - 5: "HISTOGRAM", - 6: "SUMMARY", -} - -var MetricDescriptor_Type_value = map[string]int32{ - "INVALID_TYPE": 0, - "INT64": 1, - "MONOTONIC_INT64": 2, - "DOUBLE": 3, - "MONOTONIC_DOUBLE": 4, - "HISTOGRAM": 5, - "SUMMARY": 6, -} - -func (x MetricDescriptor_Type) String() string { - return proto.EnumName(MetricDescriptor_Type_name, int32(x)) -} - -func (MetricDescriptor_Type) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{3, 0} -} - -// Temporality is the temporal quality values of a metric have. It -// describes how those values relate to the time interval over which they -// are reported. -type MetricDescriptor_Temporality int32 - -const ( - // INVALID_TEMPORALITY is the default Temporality, it MUST not be - // used. - MetricDescriptor_INVALID_TEMPORALITY MetricDescriptor_Temporality = 0 - // INSTANTANEOUS is a metric whose values are measured at a particular - // instant. The values are not aggregated over any time interval and are - // unique per timestamp. As such, these metrics are not expected to have - // an associated start time. - MetricDescriptor_INSTANTANEOUS MetricDescriptor_Temporality = 1 - // DELTA is a metric whose values are the aggregation of measurements - // made over a time interval. Successive metrics contain aggregation of + // UNSPECIFIED is the default AggregationTemporality, it MUST not be used. + AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED AggregationTemporality = 0 + // DELTA is an AggregationTemporality for a metric aggregator which reports + // changes since last report time. Successive metrics contain aggregation of // values from continuous and non-overlapping intervals. // // The values for a DELTA metric are based only on the time interval @@ -127,13 +57,12 @@ const ( // 8. The 1 second collection cycle ends. A metric is exported for the // number of requests received over the interval of time t_0+1 to // t_0+2 with a value of 2. - MetricDescriptor_DELTA MetricDescriptor_Temporality = 2 - // CUMULATIVE is a metric whose values are the aggregation of - // successively made measurements from a fixed start time until the last - // reported measurement. This means that current values of a CUMULATIVE - // metric depend on all previous measurements since the start time. - // Because of this, the sender is required to retain this state in some - // form. If this state is lost or invalidated, the CUMULATIVE metric + AggregationTemporality_AGGREGATION_TEMPORALITY_DELTA AggregationTemporality = 1 + // CUMULATIVE is an AggregationTemporality for a metic aggregator which + // reports changes since a fixed start time. This means that current values + // of a CUMULATIVE metric depend on all previous measurements since the + // start time. Because of this, the sender is required to retain this state + // in some form. If this state is lost or invalidated, the CUMULATIVE metric // values MUST be reset and a new fixed start time following the last // reported measurement time sent MUST be used. // @@ -159,29 +88,32 @@ const ( // 12. The 1 second collection cycle ends. A metric is exported for the // number of requests received over the interval of time t_1 to // t_0+1 with a value of 1. - MetricDescriptor_CUMULATIVE MetricDescriptor_Temporality = 3 + // + // Note: Even though, when reporting changes since last report time, using + // CUMULATIVE is valid, it is not recommended. This may cause problems for + // systems that do not use start_time to determine when the aggregation + // value was reset (e.g. Prometheus). + AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE AggregationTemporality = 2 ) -var MetricDescriptor_Temporality_name = map[int32]string{ - 0: "INVALID_TEMPORALITY", - 1: "INSTANTANEOUS", - 2: "DELTA", - 3: "CUMULATIVE", +var AggregationTemporality_name = map[int32]string{ + 0: "AGGREGATION_TEMPORALITY_UNSPECIFIED", + 1: "AGGREGATION_TEMPORALITY_DELTA", + 2: "AGGREGATION_TEMPORALITY_CUMULATIVE", } -var MetricDescriptor_Temporality_value = map[string]int32{ - "INVALID_TEMPORALITY": 0, - "INSTANTANEOUS": 1, - "DELTA": 2, - "CUMULATIVE": 3, +var AggregationTemporality_value = map[string]int32{ + "AGGREGATION_TEMPORALITY_UNSPECIFIED": 0, + "AGGREGATION_TEMPORALITY_DELTA": 1, + "AGGREGATION_TEMPORALITY_CUMULATIVE": 2, } -func (x MetricDescriptor_Temporality) String() string { - return proto.EnumName(MetricDescriptor_Temporality_name, int32(x)) +func (x AggregationTemporality) String() string { + return proto.EnumName(AggregationTemporality_name, int32(x)) } -func (MetricDescriptor_Temporality) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{3, 1} +func (AggregationTemporality) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{0} } // A collection of InstrumentationLibraryMetrics from a Resource. @@ -304,66 +236,99 @@ func (m *InstrumentationLibraryMetrics) GetMetrics() []*Metric { // Defines a Metric which has one or more timeseries. // -// The data model and relation between entities is shown in the diagram below. +// The data model and relation between entities is shown in the +// diagram below. Here, "DataPoint" is the term used to refer to any +// one of the specific data point value types, and "points" is the term used +// to refer to any one of the lists of points contained in the Metric. // -// - Metric is composed of a MetricDescriptor and a list of data points. -// - MetricDescriptor contains a list of label keys (shown horizontally). -// - Data is a list of DataPoints (shown vertically). -// - DataPoint contains a list of label values and a value. +// - Metric is composed of a metadata and data. +// - Metadata part contains a name, description, unit. +// - Data is one of the possible types (Gauge, Sum, Histogram, etc.). +// - DataPoint contains timestamps, labels, and one of the possible value type +// fields. // // Metric -// +----------+ +------------------------+ -// |descriptor|-------->| MetricDescriptor | -// | | |+-----+-----+ +-----+ | -// | | ||label|label|...|label| | -// | data|--+ ||key1 |key2 | |keyN | | -// +----------+ | |+-----+-----+ +-----+ | -// | +------------------------+ -// | -// | +---------------------------+ -// | |DataPoint 1 | -// v |+------+------+ +------+ | -// +-----+ ||label |label |...|label | | -// | 1 |-->||value1|value2|...|valueN| | -// +-----+ |+------+------+ +------+ | -// | . | |+-----+ | -// | . | ||value| | -// | . | |+-----+ | -// | . | +---------------------------+ -// | . | . -// | . | . -// | . | . -// | . | +---------------------------+ -// | . | |DataPoint M | -// +-----+ |+------+------+ +------+ | -// | M |-->||label |label |...|label | | -// +-----+ ||value1|value2|...|valueN| | -// |+------+------+ +------+ | -// |+-----+ | -// ||value| | -// |+-----+ | -// +---------------------------+ +// +------------+ +// |name | +// |description | +// |unit | +---------------------------+ +// |data |---> |Gauge, Sum, Histogram, ... | +// +------------+ +---------------------------+ // -//----------------------------------------------------------------------- -// DataPoint is a value of specific type corresponding to a given moment in -// time. Each DataPoint is timestamped. +// Data [One of Gauge, Sum, Histogram, ...] +// +-----------+ +// |... | // Metadata about the Data. +// |points |--+ +// +-----------+ | +// | +---------------------------+ +// | |DataPoint 1 | +// v |+------+------+ +------+ | +// +-----+ ||label |label |...|label | | +// | 1 |-->||value1|value2|...|valueN| | +// +-----+ |+------+------+ +------+ | +// | . | |+-----+ | +// | . | ||value| | +// | . | |+-----+ | +// | . | +---------------------------+ +// | . | . +// | . | . +// | . | . +// | . | +---------------------------+ +// | . | |DataPoint M | +// +-----+ |+------+------+ +------+ | +// | M |-->||label |label |...|label | | +// +-----+ ||value1|value2|...|valueN| | +// |+------+------+ +------+ | +// |+-----+ | +// ||value| | +// |+-----+ | +// +---------------------------+ // -// DataPoint is strongly typed: each DataPoint type has a specific Protobuf message -// depending on the value type of the metric and thus there are currently 4 DataPoint -// messages, which correspond to the types of metric values. +// All DataPoint types have three common fields: +// - Labels zero or more key-value pairs associated with the data point. +// - StartTimeUnixNano MUST be set to the start of the interval when the data's +// type includes an AggregationTemporality. This field is not set otherwise. +// - TimeUnixNano MUST be set to: +// - the moment when an aggregation is reported (independent of the +// aggregation temporality). +// - the instantaneous time of the event. type Metric struct { - // metric_descriptor describes the Metric. - MetricDescriptor *MetricDescriptor `protobuf:"bytes,1,opt,name=metric_descriptor,json=metricDescriptor,proto3" json:"metric_descriptor,omitempty"` - // Data is a list of one or more DataPoints for a single metric. Only one of the - // following fields is used for the data, depending on the type of the metric defined - // by MetricDescriptor.type field. - Int64DataPoints []*Int64DataPoint `protobuf:"bytes,2,rep,name=int64_data_points,json=int64DataPoints,proto3" json:"int64_data_points,omitempty"` - DoubleDataPoints []*DoubleDataPoint `protobuf:"bytes,3,rep,name=double_data_points,json=doubleDataPoints,proto3" json:"double_data_points,omitempty"` - HistogramDataPoints []*HistogramDataPoint `protobuf:"bytes,4,rep,name=histogram_data_points,json=histogramDataPoints,proto3" json:"histogram_data_points,omitempty"` - SummaryDataPoints []*SummaryDataPoint `protobuf:"bytes,5,rep,name=summary_data_points,json=summaryDataPoints,proto3" json:"summary_data_points,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // name of the metric, including its DNS name prefix. It must be unique. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // description of the metric, which can be used in documentation. + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // unit in which the metric value is reported. Follows the format + // described by http://unitsofmeasure.org/ucum.html. + Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"` + // Data determines the aggregation type (if any) of the metric, what is the + // reported value type for the data points, as well as the relatationship to + // the time interval over which they are reported. + // + // TODO: Update table after the decision on: + // https://github.com/open-telemetry/opentelemetry-specification/issues/731. + // By default, metrics recording using the OpenTelemetry API are exported as + // (the table does not include MeasurementValueType to avoid extra rows): + // + // Instrument Type + // ---------------------------------------------- + // Counter Sum(aggregation_temporality=delta;is_monotonic=true) + // UpDownCounter Sum(aggregation_temporality=delta;is_monotonic=false) + // ValueRecorder TBD + // SumObserver Sum(aggregation_temporality=cumulative;is_monotonic=true) + // UpDownSumObserver Sum(aggregation_temporality=cumulative;is_monotonic=false) + // ValueObserver Gauge() + // + // Types that are valid to be assigned to Data: + // *Metric_IntGauge + // *Metric_DoubleGauge + // *Metric_IntSum + // *Metric_DoubleSum + // *Metric_IntHistogram + // *Metric_DoubleHistogram + Data isMetric_Data `protobuf_oneof:"data"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *Metric) Reset() { *m = Metric{} } @@ -399,164 +364,148 @@ func (m *Metric) XXX_DiscardUnknown() { var xxx_messageInfo_Metric proto.InternalMessageInfo -func (m *Metric) GetMetricDescriptor() *MetricDescriptor { +type isMetric_Data interface { + isMetric_Data() + MarshalTo([]byte) (int, error) + Size() int +} + +type Metric_IntGauge struct { + IntGauge *IntGauge `protobuf:"bytes,4,opt,name=int_gauge,json=intGauge,proto3,oneof" json:"int_gauge,omitempty"` +} +type Metric_DoubleGauge struct { + DoubleGauge *DoubleGauge `protobuf:"bytes,5,opt,name=double_gauge,json=doubleGauge,proto3,oneof" json:"double_gauge,omitempty"` +} +type Metric_IntSum struct { + IntSum *IntSum `protobuf:"bytes,6,opt,name=int_sum,json=intSum,proto3,oneof" json:"int_sum,omitempty"` +} +type Metric_DoubleSum struct { + DoubleSum *DoubleSum `protobuf:"bytes,7,opt,name=double_sum,json=doubleSum,proto3,oneof" json:"double_sum,omitempty"` +} +type Metric_IntHistogram struct { + IntHistogram *IntHistogram `protobuf:"bytes,8,opt,name=int_histogram,json=intHistogram,proto3,oneof" json:"int_histogram,omitempty"` +} +type Metric_DoubleHistogram struct { + DoubleHistogram *DoubleHistogram `protobuf:"bytes,9,opt,name=double_histogram,json=doubleHistogram,proto3,oneof" json:"double_histogram,omitempty"` +} + +func (*Metric_IntGauge) isMetric_Data() {} +func (*Metric_DoubleGauge) isMetric_Data() {} +func (*Metric_IntSum) isMetric_Data() {} +func (*Metric_DoubleSum) isMetric_Data() {} +func (*Metric_IntHistogram) isMetric_Data() {} +func (*Metric_DoubleHistogram) isMetric_Data() {} + +func (m *Metric) GetData() isMetric_Data { if m != nil { - return m.MetricDescriptor + return m.Data } return nil } -func (m *Metric) GetInt64DataPoints() []*Int64DataPoint { - if m != nil { - return m.Int64DataPoints - } - return nil -} - -func (m *Metric) GetDoubleDataPoints() []*DoubleDataPoint { - if m != nil { - return m.DoubleDataPoints - } - return nil -} - -func (m *Metric) GetHistogramDataPoints() []*HistogramDataPoint { - if m != nil { - return m.HistogramDataPoints - } - return nil -} - -func (m *Metric) GetSummaryDataPoints() []*SummaryDataPoint { - if m != nil { - return m.SummaryDataPoints - } - return nil -} - -// Defines a metric type and its schema. -type MetricDescriptor struct { - // name of the metric, including its DNS name prefix. It must be unique. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // description of the metric, which can be used in documentation. - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` - // unit in which the metric value is reported. Follows the format - // described by http://unitsofmeasure.org/ucum.html. - Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"` - // type is the type of values this metric has. - Type MetricDescriptor_Type `protobuf:"varint,4,opt,name=type,proto3,enum=opentelemetry.proto.metrics.v1.MetricDescriptor_Type" json:"type,omitempty"` - // temporality is the Temporality of values this metric has. - Temporality MetricDescriptor_Temporality `protobuf:"varint,5,opt,name=temporality,proto3,enum=opentelemetry.proto.metrics.v1.MetricDescriptor_Temporality" json:"temporality,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MetricDescriptor) Reset() { *m = MetricDescriptor{} } -func (m *MetricDescriptor) String() string { return proto.CompactTextString(m) } -func (*MetricDescriptor) ProtoMessage() {} -func (*MetricDescriptor) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{3} -} -func (m *MetricDescriptor) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MetricDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MetricDescriptor.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 *MetricDescriptor) XXX_Merge(src proto.Message) { - xxx_messageInfo_MetricDescriptor.Merge(m, src) -} -func (m *MetricDescriptor) XXX_Size() int { - return m.Size() -} -func (m *MetricDescriptor) XXX_DiscardUnknown() { - xxx_messageInfo_MetricDescriptor.DiscardUnknown(m) -} - -var xxx_messageInfo_MetricDescriptor proto.InternalMessageInfo - -func (m *MetricDescriptor) GetName() string { +func (m *Metric) GetName() string { if m != nil { return m.Name } return "" } -func (m *MetricDescriptor) GetDescription() string { +func (m *Metric) GetDescription() string { if m != nil { return m.Description } return "" } -func (m *MetricDescriptor) GetUnit() string { +func (m *Metric) GetUnit() string { if m != nil { return m.Unit } return "" } -func (m *MetricDescriptor) GetType() MetricDescriptor_Type { - if m != nil { - return m.Type +func (m *Metric) GetIntGauge() *IntGauge { + if x, ok := m.GetData().(*Metric_IntGauge); ok { + return x.IntGauge } - return MetricDescriptor_INVALID_TYPE + return nil } -func (m *MetricDescriptor) GetTemporality() MetricDescriptor_Temporality { - if m != nil { - return m.Temporality +func (m *Metric) GetDoubleGauge() *DoubleGauge { + if x, ok := m.GetData().(*Metric_DoubleGauge); ok { + return x.DoubleGauge } - return MetricDescriptor_INVALID_TEMPORALITY + return nil } -// Int64DataPoint is a single data point in a timeseries that describes the time-varying -// values of a int64 metric. -type Int64DataPoint struct { - // The set of labels that uniquely identify this timeseries. - Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` - // start_time_unix_nano is the time when the cumulative value was reset to zero. - // This is used for Counter type only. For Gauge the value is not specified and - // defaults to 0. - // - // The cumulative value is over the time interval (start_time_unix_nano, time_unix_nano]. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. - // - // Value of 0 indicates that the timestamp is unspecified. In that case the timestamp - // may be decided by the backend. - StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` - // time_unix_nano is the moment when this value was recorded. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. - TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` - // value itself. - Value int64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` +func (m *Metric) GetIntSum() *IntSum { + if x, ok := m.GetData().(*Metric_IntSum); ok { + return x.IntSum + } + return nil } -func (m *Int64DataPoint) Reset() { *m = Int64DataPoint{} } -func (m *Int64DataPoint) String() string { return proto.CompactTextString(m) } -func (*Int64DataPoint) ProtoMessage() {} -func (*Int64DataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{4} +func (m *Metric) GetDoubleSum() *DoubleSum { + if x, ok := m.GetData().(*Metric_DoubleSum); ok { + return x.DoubleSum + } + return nil } -func (m *Int64DataPoint) XXX_Unmarshal(b []byte) error { + +func (m *Metric) GetIntHistogram() *IntHistogram { + if x, ok := m.GetData().(*Metric_IntHistogram); ok { + return x.IntHistogram + } + return nil +} + +func (m *Metric) GetDoubleHistogram() *DoubleHistogram { + if x, ok := m.GetData().(*Metric_DoubleHistogram); ok { + return x.DoubleHistogram + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Metric) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*Metric_IntGauge)(nil), + (*Metric_DoubleGauge)(nil), + (*Metric_IntSum)(nil), + (*Metric_DoubleSum)(nil), + (*Metric_IntHistogram)(nil), + (*Metric_DoubleHistogram)(nil), + } +} + +// Gauge represents the type of a int scalar metric that always exports the +// "current value" for every data point. It should be used for an "unknown" +// aggregation. +// +// A Gauge does not support different aggregation temporalities. Given the +// aggregation is unknown, points cannot be combined using the same +// aggregation, regardless of aggregation temporalities. Therefore, +// AggregationTemporality is not included. Consequently, this also means +// "StartTimeUnixNano" is ignored for all data points. +type IntGauge struct { + DataPoints []*IntDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IntGauge) Reset() { *m = IntGauge{} } +func (m *IntGauge) String() string { return proto.CompactTextString(m) } +func (*IntGauge) ProtoMessage() {} +func (*IntGauge) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{3} +} +func (m *IntGauge) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Int64DataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IntGauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Int64DataPoint.Marshal(b, m, deterministic) + return xxx_messageInfo_IntGauge.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -566,76 +515,474 @@ func (m *Int64DataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *Int64DataPoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_Int64DataPoint.Merge(m, src) +func (m *IntGauge) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntGauge.Merge(m, src) } -func (m *Int64DataPoint) XXX_Size() int { +func (m *IntGauge) XXX_Size() int { return m.Size() } -func (m *Int64DataPoint) XXX_DiscardUnknown() { - xxx_messageInfo_Int64DataPoint.DiscardUnknown(m) +func (m *IntGauge) XXX_DiscardUnknown() { + xxx_messageInfo_IntGauge.DiscardUnknown(m) } -var xxx_messageInfo_Int64DataPoint proto.InternalMessageInfo +var xxx_messageInfo_IntGauge proto.InternalMessageInfo -func (m *Int64DataPoint) GetLabels() []*v11.StringKeyValue { +func (m *IntGauge) GetDataPoints() []*IntDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +// Gauge represents the type of a double scalar metric that always exports the +// "current value" for every data point. It should be used for an "unknown" +// aggregation. +// +// A Gauge does not support different aggregation temporalities. Given the +// aggregation is unknown, points cannot be combined using the same +// aggregation, regardless of aggregation temporalities. Therefore, +// AggregationTemporality is not included. Consequently, this also means +// "StartTimeUnixNano" is ignored for all data points. +type DoubleGauge struct { + DataPoints []*DoubleDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DoubleGauge) Reset() { *m = DoubleGauge{} } +func (m *DoubleGauge) String() string { return proto.CompactTextString(m) } +func (*DoubleGauge) ProtoMessage() {} +func (*DoubleGauge) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{4} +} +func (m *DoubleGauge) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DoubleGauge) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DoubleGauge.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 *DoubleGauge) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleGauge.Merge(m, src) +} +func (m *DoubleGauge) XXX_Size() int { + return m.Size() +} +func (m *DoubleGauge) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleGauge.DiscardUnknown(m) +} + +var xxx_messageInfo_DoubleGauge proto.InternalMessageInfo + +func (m *DoubleGauge) GetDataPoints() []*DoubleDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +// Sum represents the type of a numeric int scalar metric that is calculated as +// a sum of all reported measurements over a time interval. +type IntSum struct { + DataPoints []*IntDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` + // If "true" means that the sum is monotonic. + IsMonotonic bool `protobuf:"varint,3,opt,name=is_monotonic,json=isMonotonic,proto3" json:"is_monotonic,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IntSum) Reset() { *m = IntSum{} } +func (m *IntSum) String() string { return proto.CompactTextString(m) } +func (*IntSum) ProtoMessage() {} +func (*IntSum) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{5} +} +func (m *IntSum) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IntSum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IntSum.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 *IntSum) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntSum.Merge(m, src) +} +func (m *IntSum) XXX_Size() int { + return m.Size() +} +func (m *IntSum) XXX_DiscardUnknown() { + xxx_messageInfo_IntSum.DiscardUnknown(m) +} + +var xxx_messageInfo_IntSum proto.InternalMessageInfo + +func (m *IntSum) GetDataPoints() []*IntDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +func (m *IntSum) GetAggregationTemporality() AggregationTemporality { + if m != nil { + return m.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +func (m *IntSum) GetIsMonotonic() bool { + if m != nil { + return m.IsMonotonic + } + return false +} + +// Sum represents the type of a numeric double scalar metric that is calculated +// as a sum of all reported measurements over a time interval. +type DoubleSum struct { + DataPoints []*DoubleDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` + // If "true" means that the sum is monotonic. + IsMonotonic bool `protobuf:"varint,3,opt,name=is_monotonic,json=isMonotonic,proto3" json:"is_monotonic,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DoubleSum) Reset() { *m = DoubleSum{} } +func (m *DoubleSum) String() string { return proto.CompactTextString(m) } +func (*DoubleSum) ProtoMessage() {} +func (*DoubleSum) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{6} +} +func (m *DoubleSum) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DoubleSum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DoubleSum.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 *DoubleSum) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleSum.Merge(m, src) +} +func (m *DoubleSum) XXX_Size() int { + return m.Size() +} +func (m *DoubleSum) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleSum.DiscardUnknown(m) +} + +var xxx_messageInfo_DoubleSum proto.InternalMessageInfo + +func (m *DoubleSum) GetDataPoints() []*DoubleDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +func (m *DoubleSum) GetAggregationTemporality() AggregationTemporality { + if m != nil { + return m.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +func (m *DoubleSum) GetIsMonotonic() bool { + if m != nil { + return m.IsMonotonic + } + return false +} + +// Represents the type of a metric that is calculated by aggregating as a +// Histogram of all reported int measurements over a time interval. +type IntHistogram struct { + DataPoints []*IntHistogramDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IntHistogram) Reset() { *m = IntHistogram{} } +func (m *IntHistogram) String() string { return proto.CompactTextString(m) } +func (*IntHistogram) ProtoMessage() {} +func (*IntHistogram) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{7} +} +func (m *IntHistogram) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IntHistogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IntHistogram.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 *IntHistogram) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntHistogram.Merge(m, src) +} +func (m *IntHistogram) XXX_Size() int { + return m.Size() +} +func (m *IntHistogram) XXX_DiscardUnknown() { + xxx_messageInfo_IntHistogram.DiscardUnknown(m) +} + +var xxx_messageInfo_IntHistogram proto.InternalMessageInfo + +func (m *IntHistogram) GetDataPoints() []*IntHistogramDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +func (m *IntHistogram) GetAggregationTemporality() AggregationTemporality { + if m != nil { + return m.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +// Represents the type of a metric that is calculated by aggregating as a +// Histogram of all reported double measurements over a time interval. +type DoubleHistogram struct { + DataPoints []*DoubleHistogramDataPoint `protobuf:"bytes,1,rep,name=data_points,json=dataPoints,proto3" json:"data_points,omitempty"` + // aggregation_temporality describes if the aggregator reports delta changes + // since last report time, or cumulative changes since a fixed start time. + AggregationTemporality AggregationTemporality `protobuf:"varint,2,opt,name=aggregation_temporality,json=aggregationTemporality,proto3,enum=opentelemetry.proto.metrics.v1.AggregationTemporality" json:"aggregation_temporality,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DoubleHistogram) Reset() { *m = DoubleHistogram{} } +func (m *DoubleHistogram) String() string { return proto.CompactTextString(m) } +func (*DoubleHistogram) ProtoMessage() {} +func (*DoubleHistogram) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{8} +} +func (m *DoubleHistogram) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DoubleHistogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DoubleHistogram.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 *DoubleHistogram) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleHistogram.Merge(m, src) +} +func (m *DoubleHistogram) XXX_Size() int { + return m.Size() +} +func (m *DoubleHistogram) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleHistogram.DiscardUnknown(m) +} + +var xxx_messageInfo_DoubleHistogram proto.InternalMessageInfo + +func (m *DoubleHistogram) GetDataPoints() []*DoubleHistogramDataPoint { + if m != nil { + return m.DataPoints + } + return nil +} + +func (m *DoubleHistogram) GetAggregationTemporality() AggregationTemporality { + if m != nil { + return m.AggregationTemporality + } + return AggregationTemporality_AGGREGATION_TEMPORALITY_UNSPECIFIED +} + +// IntDataPoint is a single data point in a timeseries that describes the +// time-varying values of a int64 metric. +type IntDataPoint struct { + // The set of labels that uniquely identify this timeseries. + Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. + // + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. + StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // value itself. + Value int64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*IntExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IntDataPoint) Reset() { *m = IntDataPoint{} } +func (m *IntDataPoint) String() string { return proto.CompactTextString(m) } +func (*IntDataPoint) ProtoMessage() {} +func (*IntDataPoint) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{9} +} +func (m *IntDataPoint) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IntDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IntDataPoint.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 *IntDataPoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntDataPoint.Merge(m, src) +} +func (m *IntDataPoint) XXX_Size() int { + return m.Size() +} +func (m *IntDataPoint) XXX_DiscardUnknown() { + xxx_messageInfo_IntDataPoint.DiscardUnknown(m) +} + +var xxx_messageInfo_IntDataPoint proto.InternalMessageInfo + +func (m *IntDataPoint) GetLabels() []*v11.StringKeyValue { if m != nil { return m.Labels } return nil } -func (m *Int64DataPoint) GetStartTimeUnixNano() uint64 { +func (m *IntDataPoint) GetStartTimeUnixNano() uint64 { if m != nil { return m.StartTimeUnixNano } return 0 } -func (m *Int64DataPoint) GetTimeUnixNano() uint64 { +func (m *IntDataPoint) GetTimeUnixNano() uint64 { if m != nil { return m.TimeUnixNano } return 0 } -func (m *Int64DataPoint) GetValue() int64 { +func (m *IntDataPoint) GetValue() int64 { if m != nil { return m.Value } return 0 } -// DoubleDataPoint is a single data point in a timeseries that describes the time-varying -// value of a double metric. +func (m *IntDataPoint) GetExemplars() []*IntExemplar { + if m != nil { + return m.Exemplars + } + return nil +} + +// DoubleDataPoint is a single data point in a timeseries that describes the +// time-varying value of a double metric. type DoubleDataPoint struct { // The set of labels that uniquely identify this timeseries. Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` - // start_time_unix_nano is the time when the cumulative value was reset to zero. - // This is used for Counter type only. For Gauge the value is not specified and - // defaults to 0. + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. // - // The cumulative value is over the time interval (start_time_unix_nano, time_unix_nano]. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. // - // Value of 0 indicates that the timestamp is unspecified. In that case the timestamp - // may be decided by the backend. + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` - // time_unix_nano is the moment when this value was recorded. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` // value itself. - Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + Value float64 `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*DoubleExemplar `protobuf:"bytes,5,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *DoubleDataPoint) Reset() { *m = DoubleDataPoint{} } func (m *DoubleDataPoint) String() string { return proto.CompactTextString(m) } func (*DoubleDataPoint) ProtoMessage() {} func (*DoubleDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{5} + return fileDescriptor_3c3112f9fa006917, []int{10} } func (m *DoubleDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -692,74 +1039,89 @@ func (m *DoubleDataPoint) GetValue() float64 { return 0 } -// HistogramDataPoint is a single data point in a timeseries that describes the time-varying -// values of a Histogram. A Histogram contains summary statistics for a population of values, -// it may optionally contain the distribution of those values across a set of buckets. -type HistogramDataPoint struct { +func (m *DoubleDataPoint) GetExemplars() []*DoubleExemplar { + if m != nil { + return m.Exemplars + } + return nil +} + +// IntHistogramDataPoint is a single data point in a timeseries that describes +// the time-varying values of a Histogram of int values. A Histogram contains +// summary statistics for a population of values, it may optionally contain +// the distribution of those values across a set of buckets. +type IntHistogramDataPoint struct { // The set of labels that uniquely identify this timeseries. Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` - // start_time_unix_nano is the time when the cumulative value was reset to zero. + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. // - // The cumulative value is over the time interval (start_time_unix_nano, time_unix_nano]. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. // - // Value of 0 indicates that the timestamp is unspecified. In that case the timestamp - // may be decided by the backend. - // Note: this field is always unspecified and ignored if MetricDescriptor.type==GAUGE_HISTOGRAM. + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` - // time_unix_nano is the moment when this value was recorded. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` - // count is the number of values in the population. Must be non-negative. This value - // must be equal to the sum of the "count" fields in buckets if a histogram is provided. - Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` + // count is the number of values in the population. Must be non-negative. This + // value must be equal to the sum of the "count" fields in buckets if a + // histogram is provided. + Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` // sum of the values in the population. If count is zero then this field - // must be zero. This value must be equal to the sum of the "sum" fields in buckets if - // a histogram is provided. - Sum float64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` - // buckets is an optional field contains the values of histogram for each bucket. + // must be zero. This value must be equal to the sum of the "sum" fields in + // buckets if a histogram is provided. + Sum int64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` + // bucket_counts is an optional field contains the count values of histogram + // for each bucket. // - // The sum of the values in the buckets "count" field must equal the value in the count field. + // The sum of the bucket_counts must equal the value in the count field. // - // The number of elements in buckets array must be by one greater than the - // number of elements in bucket_bounds array. - // - // Note: if HistogramDataPoint.bucket_options defines bucket bounds then this field - // must also be present and number of elements in this field must be equal to the - // number of buckets defined by bucket_options. - Buckets []*HistogramDataPoint_Bucket `protobuf:"bytes,6,rep,name=buckets,proto3" json:"buckets,omitempty"` + // The number of elements in bucket_counts array must be by one greater than + // the number of elements in explicit_bounds array. + BucketCounts []uint64 `protobuf:"fixed64,6,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` // explicit_bounds specifies buckets with explicitly defined bounds for values. // The bucket boundaries are described by "bounds" field. // // This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket // at index i are: // - // [0, bounds[i]) for i == 0 + // (-infinity, bounds[i]) for i == 0 // [bounds[i-1], bounds[i]) for 0 < i < N-1 // [bounds[i], +infinity) for i == N-1 - // The values in bounds array must be strictly increasing and > 0. + // The values in bounds array must be strictly increasing. // - // Note: only [a, b) intervals are currently supported for each bucket. If we decides - // to also support (a, b] intervals we should add support for these by defining a boolean - // value which decides what type of intervals to use. - ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // Note: only [a, b) intervals are currently supported for each bucket except the first one. + // If we decide to also support (a, b] intervals we should add support for these by defining + // a boolean value which decides what type of intervals to use. + ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*IntExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *HistogramDataPoint) Reset() { *m = HistogramDataPoint{} } -func (m *HistogramDataPoint) String() string { return proto.CompactTextString(m) } -func (*HistogramDataPoint) ProtoMessage() {} -func (*HistogramDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{6} +func (m *IntHistogramDataPoint) Reset() { *m = IntHistogramDataPoint{} } +func (m *IntHistogramDataPoint) String() string { return proto.CompactTextString(m) } +func (*IntHistogramDataPoint) ProtoMessage() {} +func (*IntHistogramDataPoint) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{11} } -func (m *HistogramDataPoint) XXX_Unmarshal(b []byte) error { +func (m *IntHistogramDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HistogramDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IntHistogramDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HistogramDataPoint.Marshal(b, m, deterministic) + return xxx_messageInfo_IntHistogramDataPoint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -769,241 +1131,150 @@ func (m *HistogramDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *HistogramDataPoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_HistogramDataPoint.Merge(m, src) +func (m *IntHistogramDataPoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntHistogramDataPoint.Merge(m, src) } -func (m *HistogramDataPoint) XXX_Size() int { +func (m *IntHistogramDataPoint) XXX_Size() int { return m.Size() } -func (m *HistogramDataPoint) XXX_DiscardUnknown() { - xxx_messageInfo_HistogramDataPoint.DiscardUnknown(m) +func (m *IntHistogramDataPoint) XXX_DiscardUnknown() { + xxx_messageInfo_IntHistogramDataPoint.DiscardUnknown(m) } -var xxx_messageInfo_HistogramDataPoint proto.InternalMessageInfo +var xxx_messageInfo_IntHistogramDataPoint proto.InternalMessageInfo -func (m *HistogramDataPoint) GetLabels() []*v11.StringKeyValue { +func (m *IntHistogramDataPoint) GetLabels() []*v11.StringKeyValue { if m != nil { return m.Labels } return nil } -func (m *HistogramDataPoint) GetStartTimeUnixNano() uint64 { +func (m *IntHistogramDataPoint) GetStartTimeUnixNano() uint64 { if m != nil { return m.StartTimeUnixNano } return 0 } -func (m *HistogramDataPoint) GetTimeUnixNano() uint64 { +func (m *IntHistogramDataPoint) GetTimeUnixNano() uint64 { if m != nil { return m.TimeUnixNano } return 0 } -func (m *HistogramDataPoint) GetCount() uint64 { +func (m *IntHistogramDataPoint) GetCount() uint64 { if m != nil { return m.Count } return 0 } -func (m *HistogramDataPoint) GetSum() float64 { +func (m *IntHistogramDataPoint) GetSum() int64 { if m != nil { return m.Sum } return 0 } -func (m *HistogramDataPoint) GetBuckets() []*HistogramDataPoint_Bucket { +func (m *IntHistogramDataPoint) GetBucketCounts() []uint64 { if m != nil { - return m.Buckets + return m.BucketCounts } return nil } -func (m *HistogramDataPoint) GetExplicitBounds() []float64 { +func (m *IntHistogramDataPoint) GetExplicitBounds() []float64 { if m != nil { return m.ExplicitBounds } return nil } -// Bucket contains values for a bucket. -type HistogramDataPoint_Bucket struct { - // The number of values in each bucket of the histogram, as described by - // bucket_options. - Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"` - // exemplar is an optional representative value of the bucket. - Exemplar *HistogramDataPoint_Bucket_Exemplar `protobuf:"bytes,2,opt,name=exemplar,proto3" json:"exemplar,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HistogramDataPoint_Bucket) Reset() { *m = HistogramDataPoint_Bucket{} } -func (m *HistogramDataPoint_Bucket) String() string { return proto.CompactTextString(m) } -func (*HistogramDataPoint_Bucket) ProtoMessage() {} -func (*HistogramDataPoint_Bucket) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{6, 0} -} -func (m *HistogramDataPoint_Bucket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HistogramDataPoint_Bucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HistogramDataPoint_Bucket.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 *HistogramDataPoint_Bucket) XXX_Merge(src proto.Message) { - xxx_messageInfo_HistogramDataPoint_Bucket.Merge(m, src) -} -func (m *HistogramDataPoint_Bucket) XXX_Size() int { - return m.Size() -} -func (m *HistogramDataPoint_Bucket) XXX_DiscardUnknown() { - xxx_messageInfo_HistogramDataPoint_Bucket.DiscardUnknown(m) -} - -var xxx_messageInfo_HistogramDataPoint_Bucket proto.InternalMessageInfo - -func (m *HistogramDataPoint_Bucket) GetCount() uint64 { +func (m *IntHistogramDataPoint) GetExemplars() []*IntExemplar { if m != nil { - return m.Count - } - return 0 -} - -func (m *HistogramDataPoint_Bucket) GetExemplar() *HistogramDataPoint_Bucket_Exemplar { - if m != nil { - return m.Exemplar + return m.Exemplars } return nil } -// Exemplars are example points that may be used to annotate aggregated -// Histogram values. They are metadata that gives information about a -// particular value added to a Histogram bucket. -type HistogramDataPoint_Bucket_Exemplar struct { - // Value of the exemplar point. It determines which bucket the exemplar belongs to. - // If bucket_options define bounds for this bucket then this value must be within - // the defined bounds. - Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` - // time_unix_nano is the moment when this exemplar was recorded. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. - TimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` - // exemplar_attachments are contextual information about the example value. - // Keys in this list must be unique. - Attachments []*v11.StringKeyValue `protobuf:"bytes,3,rep,name=attachments,proto3" json:"attachments,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *HistogramDataPoint_Bucket_Exemplar) Reset() { *m = HistogramDataPoint_Bucket_Exemplar{} } -func (m *HistogramDataPoint_Bucket_Exemplar) String() string { return proto.CompactTextString(m) } -func (*HistogramDataPoint_Bucket_Exemplar) ProtoMessage() {} -func (*HistogramDataPoint_Bucket_Exemplar) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{6, 0, 0} -} -func (m *HistogramDataPoint_Bucket_Exemplar) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *HistogramDataPoint_Bucket_Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_HistogramDataPoint_Bucket_Exemplar.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 *HistogramDataPoint_Bucket_Exemplar) XXX_Merge(src proto.Message) { - xxx_messageInfo_HistogramDataPoint_Bucket_Exemplar.Merge(m, src) -} -func (m *HistogramDataPoint_Bucket_Exemplar) XXX_Size() int { - return m.Size() -} -func (m *HistogramDataPoint_Bucket_Exemplar) XXX_DiscardUnknown() { - xxx_messageInfo_HistogramDataPoint_Bucket_Exemplar.DiscardUnknown(m) -} - -var xxx_messageInfo_HistogramDataPoint_Bucket_Exemplar proto.InternalMessageInfo - -func (m *HistogramDataPoint_Bucket_Exemplar) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 -} - -func (m *HistogramDataPoint_Bucket_Exemplar) GetTimeUnixNano() uint64 { - if m != nil { - return m.TimeUnixNano - } - return 0 -} - -func (m *HistogramDataPoint_Bucket_Exemplar) GetAttachments() []*v11.StringKeyValue { - if m != nil { - return m.Attachments - } - return nil -} - -// SummaryDataPoint is a single data point in a timeseries that describes the time-varying -// values of a Summary metric. -type SummaryDataPoint struct { +// HistogramDataPoint is a single data point in a timeseries that describes the +// time-varying values of a Histogram of double values. A Histogram contains +// summary statistics for a population of values, it may optionally contain the +// distribution of those values across a set of buckets. +type DoubleHistogramDataPoint struct { // The set of labels that uniquely identify this timeseries. Labels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` - // start_time_unix_nano is the time when the cumulative value was reset to zero. + // start_time_unix_nano is the last time when the aggregation value was reset + // to "zero". For some metric types this is ignored, see data types for more + // details. // - // The cumulative value is over the time interval (start_time_unix_nano, time_unix_nano]. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // The aggregation value is over the time interval (start_time_unix_nano, + // time_unix_nano]. // - // Value of 0 indicates that the timestamp is unspecified. In that case the timestamp - // may be decided by the backend. + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + // + // Value of 0 indicates that the timestamp is unspecified. In that case the + // timestamp may be decided by the backend. StartTimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=start_time_unix_nano,json=startTimeUnixNano,proto3" json:"start_time_unix_nano,omitempty"` - // time_unix_nano is the moment when this value was recorded. - // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970. + // time_unix_nano is the moment when this aggregation value was reported. + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. TimeUnixNano uint64 `protobuf:"fixed64,3,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` - // The total number of recorded values since start_time. Optional since - // some systems don't expose this. - Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"` - // The total sum of recorded values since start_time. Optional since some - // systems don't expose this. If count is zero then this field must be zero. + // count is the number of values in the population. Must be non-negative. This + // value must be equal to the sum of the "count" fields in buckets if a + // histogram is provided. + Count uint64 `protobuf:"fixed64,4,opt,name=count,proto3" json:"count,omitempty"` + // sum of the values in the population. If count is zero then this field + // must be zero. This value must be equal to the sum of the "sum" fields in + // buckets if a histogram is provided. Sum float64 `protobuf:"fixed64,5,opt,name=sum,proto3" json:"sum,omitempty"` - // A list of values at different percentiles of the distribution calculated - // from the current snapshot. The percentiles must be strictly increasing. - PercentileValues []*SummaryDataPoint_ValueAtPercentile `protobuf:"bytes,6,rep,name=percentile_values,json=percentileValues,proto3" json:"percentile_values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` + // bucket_counts is an optional field contains the count values of histogram + // for each bucket. + // + // The sum of the bucket_counts must equal the value in the count field. + // + // The number of elements in bucket_counts array must be by one greater than + // the number of elements in explicit_bounds array. + BucketCounts []uint64 `protobuf:"fixed64,6,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` + // explicit_bounds specifies buckets with explicitly defined bounds for values. + // The bucket boundaries are described by "bounds" field. + // + // This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket + // at index i are: + // + // (-infinity, bounds[i]) for i == 0 + // [bounds[i-1], bounds[i]) for 0 < i < N-1 + // [bounds[i], +infinity) for i == N-1 + // The values in bounds array must be strictly increasing. + // + // Note: only [a, b) intervals are currently supported for each bucket except the first one. + // If we decide to also support (a, b] intervals we should add support for these by defining + // a boolean value which decides what type of intervals to use. + ExplicitBounds []float64 `protobuf:"fixed64,7,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"` + // (Optional) List of exemplars collected from + // measurements that were used to form the data point + Exemplars []*DoubleExemplar `protobuf:"bytes,8,rep,name=exemplars,proto3" json:"exemplars,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (m *SummaryDataPoint) Reset() { *m = SummaryDataPoint{} } -func (m *SummaryDataPoint) String() string { return proto.CompactTextString(m) } -func (*SummaryDataPoint) ProtoMessage() {} -func (*SummaryDataPoint) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{7} +func (m *DoubleHistogramDataPoint) Reset() { *m = DoubleHistogramDataPoint{} } +func (m *DoubleHistogramDataPoint) String() string { return proto.CompactTextString(m) } +func (*DoubleHistogramDataPoint) ProtoMessage() {} +func (*DoubleHistogramDataPoint) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{12} } -func (m *SummaryDataPoint) XXX_Unmarshal(b []byte) error { +func (m *DoubleHistogramDataPoint) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SummaryDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *DoubleHistogramDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SummaryDataPoint.Marshal(b, m, deterministic) + return xxx_messageInfo_DoubleHistogramDataPoint.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1013,91 +1284,115 @@ func (m *SummaryDataPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *SummaryDataPoint) XXX_Merge(src proto.Message) { - xxx_messageInfo_SummaryDataPoint.Merge(m, src) +func (m *DoubleHistogramDataPoint) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleHistogramDataPoint.Merge(m, src) } -func (m *SummaryDataPoint) XXX_Size() int { +func (m *DoubleHistogramDataPoint) XXX_Size() int { return m.Size() } -func (m *SummaryDataPoint) XXX_DiscardUnknown() { - xxx_messageInfo_SummaryDataPoint.DiscardUnknown(m) +func (m *DoubleHistogramDataPoint) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleHistogramDataPoint.DiscardUnknown(m) } -var xxx_messageInfo_SummaryDataPoint proto.InternalMessageInfo +var xxx_messageInfo_DoubleHistogramDataPoint proto.InternalMessageInfo -func (m *SummaryDataPoint) GetLabels() []*v11.StringKeyValue { +func (m *DoubleHistogramDataPoint) GetLabels() []*v11.StringKeyValue { if m != nil { return m.Labels } return nil } -func (m *SummaryDataPoint) GetStartTimeUnixNano() uint64 { +func (m *DoubleHistogramDataPoint) GetStartTimeUnixNano() uint64 { if m != nil { return m.StartTimeUnixNano } return 0 } -func (m *SummaryDataPoint) GetTimeUnixNano() uint64 { +func (m *DoubleHistogramDataPoint) GetTimeUnixNano() uint64 { if m != nil { return m.TimeUnixNano } return 0 } -func (m *SummaryDataPoint) GetCount() uint64 { +func (m *DoubleHistogramDataPoint) GetCount() uint64 { if m != nil { return m.Count } return 0 } -func (m *SummaryDataPoint) GetSum() float64 { +func (m *DoubleHistogramDataPoint) GetSum() float64 { if m != nil { return m.Sum } return 0 } -func (m *SummaryDataPoint) GetPercentileValues() []*SummaryDataPoint_ValueAtPercentile { +func (m *DoubleHistogramDataPoint) GetBucketCounts() []uint64 { if m != nil { - return m.PercentileValues + return m.BucketCounts } return nil } -// Represents the value at a given percentile of a distribution. -// -// To record Min and Max values following conventions are used: -// - The 100th percentile is equivalent to the maximum value observed. -// - The 0th percentile is equivalent to the minimum value observed. -// -// See the following issue for more context: -// https://github.com/open-telemetry/opentelemetry-proto/issues/125 -type SummaryDataPoint_ValueAtPercentile struct { - // The percentile of a distribution. Must be in the interval - // [0.0, 100.0]. - Percentile float64 `protobuf:"fixed64,1,opt,name=percentile,proto3" json:"percentile,omitempty"` - // The value at the given percentile of a distribution. - Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` +func (m *DoubleHistogramDataPoint) GetExplicitBounds() []float64 { + if m != nil { + return m.ExplicitBounds + } + return nil +} + +func (m *DoubleHistogramDataPoint) GetExemplars() []*DoubleExemplar { + if m != nil { + return m.Exemplars + } + return nil +} + +// A representation of an exemplar, which is a sample input int measurement. +// Exemplars also hold information about the environment when the measurement +// was recorded, for example the span and trace ID of the active span when the +// exemplar was recorded. +type IntExemplar struct { + // The set of labels that were filtered out by the aggregator, but recorded + // alongside the original measurement. Only labels that were filtered out + // by the aggregator should be included + FilteredLabels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels,omitempty"` + // time_unix_nano is the exact time when this exemplar was recorded + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // Numerical int value of the measurement that was recorded. + Value int64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) Span ID of the exemplar trace. + // span_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + SpanId []byte `protobuf:"bytes,4,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // (Optional) Trace ID of the exemplar trace. + // trace_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + TraceId []byte `protobuf:"bytes,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` } -func (m *SummaryDataPoint_ValueAtPercentile) Reset() { *m = SummaryDataPoint_ValueAtPercentile{} } -func (m *SummaryDataPoint_ValueAtPercentile) String() string { return proto.CompactTextString(m) } -func (*SummaryDataPoint_ValueAtPercentile) ProtoMessage() {} -func (*SummaryDataPoint_ValueAtPercentile) Descriptor() ([]byte, []int) { - return fileDescriptor_3c3112f9fa006917, []int{7, 0} +func (m *IntExemplar) Reset() { *m = IntExemplar{} } +func (m *IntExemplar) String() string { return proto.CompactTextString(m) } +func (*IntExemplar) ProtoMessage() {} +func (*IntExemplar) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{13} } -func (m *SummaryDataPoint_ValueAtPercentile) XXX_Unmarshal(b []byte) error { +func (m *IntExemplar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *SummaryDataPoint_ValueAtPercentile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *IntExemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_SummaryDataPoint_ValueAtPercentile.Marshal(b, m, deterministic) + return xxx_messageInfo_IntExemplar.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1107,46 +1402,167 @@ func (m *SummaryDataPoint_ValueAtPercentile) XXX_Marshal(b []byte, deterministic return b[:n], nil } } -func (m *SummaryDataPoint_ValueAtPercentile) XXX_Merge(src proto.Message) { - xxx_messageInfo_SummaryDataPoint_ValueAtPercentile.Merge(m, src) +func (m *IntExemplar) XXX_Merge(src proto.Message) { + xxx_messageInfo_IntExemplar.Merge(m, src) } -func (m *SummaryDataPoint_ValueAtPercentile) XXX_Size() int { +func (m *IntExemplar) XXX_Size() int { return m.Size() } -func (m *SummaryDataPoint_ValueAtPercentile) XXX_DiscardUnknown() { - xxx_messageInfo_SummaryDataPoint_ValueAtPercentile.DiscardUnknown(m) +func (m *IntExemplar) XXX_DiscardUnknown() { + xxx_messageInfo_IntExemplar.DiscardUnknown(m) } -var xxx_messageInfo_SummaryDataPoint_ValueAtPercentile proto.InternalMessageInfo +var xxx_messageInfo_IntExemplar proto.InternalMessageInfo -func (m *SummaryDataPoint_ValueAtPercentile) GetPercentile() float64 { +func (m *IntExemplar) GetFilteredLabels() []*v11.StringKeyValue { if m != nil { - return m.Percentile + return m.FilteredLabels + } + return nil +} + +func (m *IntExemplar) GetTimeUnixNano() uint64 { + if m != nil { + return m.TimeUnixNano } return 0 } -func (m *SummaryDataPoint_ValueAtPercentile) GetValue() float64 { +func (m *IntExemplar) GetValue() int64 { if m != nil { return m.Value } return 0 } +func (m *IntExemplar) GetSpanId() []byte { + if m != nil { + return m.SpanId + } + return nil +} + +func (m *IntExemplar) GetTraceId() []byte { + if m != nil { + return m.TraceId + } + return nil +} + +// A representation of an exemplar, which is a sample input double measurement. +// Exemplars also hold information about the environment when the measurement +// was recorded, for example the span and trace ID of the active span when the +// exemplar was recorded. +type DoubleExemplar struct { + // The set of labels that were filtered out by the aggregator, but recorded + // alongside the original measurement. Only labels that were filtered out + // by the aggregator should be included + FilteredLabels []*v11.StringKeyValue `protobuf:"bytes,1,rep,name=filtered_labels,json=filteredLabels,proto3" json:"filtered_labels,omitempty"` + // time_unix_nano is the exact time when this exemplar was recorded + // + // Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January + // 1970. + TimeUnixNano uint64 `protobuf:"fixed64,2,opt,name=time_unix_nano,json=timeUnixNano,proto3" json:"time_unix_nano,omitempty"` + // Numerical double value of the measurement that was recorded. + Value float64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"` + // (Optional) Span ID of the exemplar trace. + // span_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + SpanId []byte `protobuf:"bytes,4,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"` + // (Optional) Trace ID of the exemplar trace. + // trace_id may be missing if the measurement is not recorded inside a trace + // or if the trace is not sampled. + TraceId []byte `protobuf:"bytes,5,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DoubleExemplar) Reset() { *m = DoubleExemplar{} } +func (m *DoubleExemplar) String() string { return proto.CompactTextString(m) } +func (*DoubleExemplar) ProtoMessage() {} +func (*DoubleExemplar) Descriptor() ([]byte, []int) { + return fileDescriptor_3c3112f9fa006917, []int{14} +} +func (m *DoubleExemplar) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DoubleExemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DoubleExemplar.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 *DoubleExemplar) XXX_Merge(src proto.Message) { + xxx_messageInfo_DoubleExemplar.Merge(m, src) +} +func (m *DoubleExemplar) XXX_Size() int { + return m.Size() +} +func (m *DoubleExemplar) XXX_DiscardUnknown() { + xxx_messageInfo_DoubleExemplar.DiscardUnknown(m) +} + +var xxx_messageInfo_DoubleExemplar proto.InternalMessageInfo + +func (m *DoubleExemplar) GetFilteredLabels() []*v11.StringKeyValue { + if m != nil { + return m.FilteredLabels + } + return nil +} + +func (m *DoubleExemplar) GetTimeUnixNano() uint64 { + if m != nil { + return m.TimeUnixNano + } + return 0 +} + +func (m *DoubleExemplar) GetValue() float64 { + if m != nil { + return m.Value + } + return 0 +} + +func (m *DoubleExemplar) GetSpanId() []byte { + if m != nil { + return m.SpanId + } + return nil +} + +func (m *DoubleExemplar) GetTraceId() []byte { + if m != nil { + return m.TraceId + } + return nil +} + func init() { - proto.RegisterEnum("opentelemetry.proto.metrics.v1.MetricDescriptor_Type", MetricDescriptor_Type_name, MetricDescriptor_Type_value) - proto.RegisterEnum("opentelemetry.proto.metrics.v1.MetricDescriptor_Temporality", MetricDescriptor_Temporality_name, MetricDescriptor_Temporality_value) + proto.RegisterEnum("opentelemetry.proto.metrics.v1.AggregationTemporality", AggregationTemporality_name, AggregationTemporality_value) proto.RegisterType((*ResourceMetrics)(nil), "opentelemetry.proto.metrics.v1.ResourceMetrics") proto.RegisterType((*InstrumentationLibraryMetrics)(nil), "opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics") proto.RegisterType((*Metric)(nil), "opentelemetry.proto.metrics.v1.Metric") - proto.RegisterType((*MetricDescriptor)(nil), "opentelemetry.proto.metrics.v1.MetricDescriptor") - proto.RegisterType((*Int64DataPoint)(nil), "opentelemetry.proto.metrics.v1.Int64DataPoint") + proto.RegisterType((*IntGauge)(nil), "opentelemetry.proto.metrics.v1.IntGauge") + proto.RegisterType((*DoubleGauge)(nil), "opentelemetry.proto.metrics.v1.DoubleGauge") + proto.RegisterType((*IntSum)(nil), "opentelemetry.proto.metrics.v1.IntSum") + proto.RegisterType((*DoubleSum)(nil), "opentelemetry.proto.metrics.v1.DoubleSum") + proto.RegisterType((*IntHistogram)(nil), "opentelemetry.proto.metrics.v1.IntHistogram") + proto.RegisterType((*DoubleHistogram)(nil), "opentelemetry.proto.metrics.v1.DoubleHistogram") + proto.RegisterType((*IntDataPoint)(nil), "opentelemetry.proto.metrics.v1.IntDataPoint") proto.RegisterType((*DoubleDataPoint)(nil), "opentelemetry.proto.metrics.v1.DoubleDataPoint") - proto.RegisterType((*HistogramDataPoint)(nil), "opentelemetry.proto.metrics.v1.HistogramDataPoint") - proto.RegisterType((*HistogramDataPoint_Bucket)(nil), "opentelemetry.proto.metrics.v1.HistogramDataPoint.Bucket") - proto.RegisterType((*HistogramDataPoint_Bucket_Exemplar)(nil), "opentelemetry.proto.metrics.v1.HistogramDataPoint.Bucket.Exemplar") - proto.RegisterType((*SummaryDataPoint)(nil), "opentelemetry.proto.metrics.v1.SummaryDataPoint") - proto.RegisterType((*SummaryDataPoint_ValueAtPercentile)(nil), "opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtPercentile") + proto.RegisterType((*IntHistogramDataPoint)(nil), "opentelemetry.proto.metrics.v1.IntHistogramDataPoint") + proto.RegisterType((*DoubleHistogramDataPoint)(nil), "opentelemetry.proto.metrics.v1.DoubleHistogramDataPoint") + proto.RegisterType((*IntExemplar)(nil), "opentelemetry.proto.metrics.v1.IntExemplar") + proto.RegisterType((*DoubleExemplar)(nil), "opentelemetry.proto.metrics.v1.DoubleExemplar") } func init() { @@ -1154,72 +1570,75 @@ func init() { } var fileDescriptor_3c3112f9fa006917 = []byte{ - // 1040 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0xdf, 0x6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xaa, 0xac, 0x22, 0xbb, - 0x13, 0x42, 0xa2, 0x4f, 0xc9, 0xd5, 0x66, 0xb0, 0xdd, 0x80, 0xc2, 0x0d, 0x37, 0xbc, 0x03, 0x30, - 0x75, 0x8c, 0x8f, 0x3c, 0x85, 0x4c, 0xa7, 0x21, 0x93, 0x9a, 0x86, 0xea, 0x6b, 0xf4, 0xf3, 0xf5, - 0x0e, 0xfa, 0xe5, 0x7a, 0x07, 0xbd, 0xb9, 0xde, 0x41, 0xf0, 0x36, 0x13, 0x4b, 0x14, 0x57, 0xd7, - 0xe2, 0xdf, 0x93, 0xdd, 0x70, 0xa3, 0x8b, 0x5e, 0xf4, 0xce, 0xe7, 0x43, 0x98, 0x28, 0x0b, 0x49, - 0x9d, 0x32, 0xbd, 0xf2, 0x84, 0x2f, 0xa9, 0x1f, 0x94, 0x85, 0x74, 0xbc, 0x32, 0xe3, 0x92, 0xfa, - 0xdc, 0x76, 0xca, 0x33, 0xde, 0xfb, 0x2a, 0xc1, 0xfe, 0x39, 0xe5, 0xa9, 0xbf, 0x0e, 0x83, 0x9c, - 0x42, 0x3f, 0xfe, 0x33, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x39, 0xe1, 0x06, 0x63, 0x0c, 0x00, 0x00, + // 1086 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x41, 0x6f, 0x1b, 0x45, + 0x14, 0xce, 0xd8, 0xc9, 0xda, 0x7e, 0x76, 0x13, 0x33, 0x2a, 0xed, 0x52, 0xa9, 0x21, 0x71, 0x51, + 0x1a, 0xda, 0xc6, 0x56, 0x82, 0x8a, 0xb8, 0x20, 0xe1, 0x24, 0x26, 0x31, 0x38, 0xa9, 0x35, 0x71, + 0x22, 0x05, 0x21, 0xad, 0xc6, 0xde, 0xc1, 0x8c, 0xd8, 0x9d, 0xb1, 0x76, 0x67, 0xa3, 0xe4, 0x07, + 0x70, 0x83, 0x13, 0xfc, 0x17, 0xfe, 0x02, 0x47, 0x38, 0x20, 0xb8, 0x20, 0x55, 0xb9, 0x72, 0xe2, + 0xc2, 0x89, 0x03, 0xda, 0xd9, 0xdd, 0xc4, 0x4e, 0x36, 0xb1, 0xab, 0x14, 0x29, 0xbd, 0xbd, 0x79, + 0xf3, 0xde, 0x37, 0xdf, 0xfb, 0xde, 0x7b, 0xde, 0x36, 0xf0, 0x4c, 0x0e, 0x98, 0x50, 0xcc, 0x61, + 0x2e, 0x53, 0xde, 0x49, 0x6d, 0xe0, 0x49, 0x25, 0x6b, 0xa1, 0xcd, 0x7b, 0x7e, 0xed, 0x68, 0x35, + 0x31, 0xab, 0xfa, 0x02, 0xcf, 0x8f, 0x44, 0x47, 0xce, 0x6a, 0x12, 0x72, 0xb4, 0xfa, 0xe0, 0x49, + 0x1a, 0x5a, 0x4f, 0xba, 0xae, 0x14, 0x21, 0x58, 0x64, 0x45, 0x69, 0x0f, 0xaa, 0x69, 0xb1, 0x1e, + 0xf3, 0x65, 0xe0, 0xf5, 0x58, 0x18, 0x9d, 0xd8, 0x51, 0x7c, 0xe5, 0x25, 0x82, 0x39, 0x12, 0xbb, + 0x76, 0xa2, 0x27, 0x71, 0x03, 0xf2, 0x49, 0x94, 0x89, 0x16, 0xd0, 0x72, 0x71, 0xed, 0xfd, 0x6a, + 0x1a, 0xc5, 0x33, 0xa8, 0xa3, 0xd5, 0x6a, 0x82, 0x41, 0xce, 0x52, 0xf1, 0xb7, 0x08, 0xde, 0xe5, + 0xc2, 0x57, 0x5e, 0xe0, 0x32, 0xa1, 0xa8, 0xe2, 0x52, 0x58, 0x0e, 0xef, 0x7a, 0xd4, 0x3b, 0xb1, + 0xe2, 0xea, 0xcc, 0xcc, 0x42, 0x76, 0xb9, 0xb8, 0xf6, 0x71, 0xf5, 0x7a, 0x05, 0xaa, 0xcd, 0x51, + 0x98, 0x56, 0x84, 0x12, 0xf3, 0x25, 0x0f, 0xf9, 0x75, 0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x37, 0x1b, 0xad, 0x4e, 0xbd, 0x8c, 0xf0, 0x12, 0x54, 0xae, 0x0a, 0xd9, 0xd8, 0xdf, 0xd9, + 0x6f, 0xd5, 0x3b, 0xcd, 0x83, 0x46, 0x39, 0xb3, 0xfe, 0x23, 0xfa, 0xf9, 0x74, 0x1e, 0xfd, 0x72, + 0x3a, 0x8f, 0x5e, 0x9e, 0xce, 0x23, 0x58, 0xe4, 0x72, 0xcc, 0x34, 0xae, 0x97, 0xe2, 0xff, 0xde, + 0xb6, 0xc3, 0x8b, 0x36, 0xfa, 0x62, 0xaf, 0x7f, 0x31, 0x85, 0xcb, 0x9a, 0x54, 0xcc, 0xa9, 0xb1, + 0xe3, 0x81, 0xf4, 0x14, 0xf3, 0xfc, 0x9a, 0x54, 0xce, 0xa0, 0xc6, 0x85, 0x62, 0x9e, 0xa0, 0x4e, + 0x6d, 0x24, 0x7a, 0x45, 0x3f, 0xb0, 0xd2, 0x67, 0x62, 0xe8, 0x2f, 0x19, 0x5d, 0x43, 0x7b, 0x3f, + 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x7c, 0x51, 0xc2, 0xe2, 0xf2, 0x10, 0x00, 0x00, } func (m *ResourceMetrics) Marshal() (dAtA []byte, err error) { @@ -1352,110 +1771,14 @@ func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.SummaryDataPoints) > 0 { - for iNdEx := len(m.SummaryDataPoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.SummaryDataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x2a - } - } - if len(m.HistogramDataPoints) > 0 { - for iNdEx := len(m.HistogramDataPoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.HistogramDataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } - if len(m.DoubleDataPoints) > 0 { - for iNdEx := len(m.DoubleDataPoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.DoubleDataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - if len(m.Int64DataPoints) > 0 { - for iNdEx := len(m.Int64DataPoints) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Int64DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - } - if m.MetricDescriptor != nil { + if m.Data != nil { { - size, err := m.MetricDescriptor.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.Data.Size() + i -= size + if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { return 0, err } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MetricDescriptor) 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 *MetricDescriptor) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MetricDescriptor) 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.Temporality != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.Temporality)) - i-- - dAtA[i] = 0x28 - } - if m.Type != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.Type)) - i-- - dAtA[i] = 0x20 } if len(m.Unit) > 0 { i -= len(m.Unit) @@ -1481,7 +1804,133 @@ func (m *MetricDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *Int64DataPoint) Marshal() (dAtA []byte, err error) { +func (m *Metric_IntGauge) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_IntGauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IntGauge != nil { + { + size, err := m.IntGauge.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *Metric_DoubleGauge) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_DoubleGauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DoubleGauge != nil { + { + size, err := m.DoubleGauge.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *Metric_IntSum) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_IntSum) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IntSum != nil { + { + size, err := m.IntSum.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + return len(dAtA) - i, nil +} +func (m *Metric_DoubleSum) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_DoubleSum) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DoubleSum != nil { + { + size, err := m.DoubleSum.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + return len(dAtA) - i, nil +} +func (m *Metric_IntHistogram) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_IntHistogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.IntHistogram != nil { + { + size, err := m.IntHistogram.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + return len(dAtA) - i, nil +} +func (m *Metric_DoubleHistogram) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Metric_DoubleHistogram) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.DoubleHistogram != nil { + { + size, err := m.DoubleHistogram.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + return len(dAtA) - i, nil +} +func (m *IntGauge) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1491,12 +1940,12 @@ func (m *Int64DataPoint) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Int64DataPoint) MarshalTo(dAtA []byte) (int, error) { +func (m *IntGauge) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Int64DataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IntGauge) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1505,10 +1954,311 @@ func (m *Int64DataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Value != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.Value)) + if len(m.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DoubleGauge) 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 *DoubleGauge) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DoubleGauge) 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.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *IntSum) 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 *IntSum) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IntSum) 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.IsMonotonic { i-- - dAtA[i] = 0x20 + if m.IsMonotonic { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.AggregationTemporality != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.AggregationTemporality)) + i-- + dAtA[i] = 0x10 + } + if len(m.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DoubleSum) 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 *DoubleSum) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DoubleSum) 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.IsMonotonic { + i-- + if m.IsMonotonic { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.AggregationTemporality != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.AggregationTemporality)) + i-- + dAtA[i] = 0x10 + } + if len(m.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *IntHistogram) 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 *IntHistogram) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IntHistogram) 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.AggregationTemporality != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.AggregationTemporality)) + i-- + dAtA[i] = 0x10 + } + if len(m.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DoubleHistogram) 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 *DoubleHistogram) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DoubleHistogram) 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.AggregationTemporality != 0 { + i = encodeVarintMetrics(dAtA, i, uint64(m.AggregationTemporality)) + i-- + dAtA[i] = 0x10 + } + if len(m.DataPoints) > 0 { + for iNdEx := len(m.DataPoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DataPoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *IntDataPoint) 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 *IntDataPoint) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IntDataPoint) 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.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Value != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Value)) + i-- + dAtA[i] = 0x21 } if m.TimeUnixNano != 0 { i -= 8 @@ -1563,6 +2313,20 @@ func (m *DoubleDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } if m.Value != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) @@ -1598,7 +2362,7 @@ func (m *DoubleDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *HistogramDataPoint) Marshal() (dAtA []byte, err error) { +func (m *IntHistogramDataPoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1608,12 +2372,12 @@ func (m *HistogramDataPoint) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HistogramDataPoint) MarshalTo(dAtA []byte) (int, error) { +func (m *IntHistogramDataPoint) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IntHistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1622,40 +2386,50 @@ func (m *HistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } if len(m.ExplicitBounds) > 0 { for iNdEx := len(m.ExplicitBounds) - 1; iNdEx >= 0; iNdEx-- { - f4 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) + f9 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f4)) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f9)) } i = encodeVarintMetrics(dAtA, i, uint64(len(m.ExplicitBounds)*8)) i-- dAtA[i] = 0x3a } - if len(m.Buckets) > 0 { - for iNdEx := len(m.Buckets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Buckets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 + if len(m.BucketCounts) > 0 { + for iNdEx := len(m.BucketCounts) - 1; iNdEx >= 0; iNdEx-- { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.BucketCounts[iNdEx])) } + i = encodeVarintMetrics(dAtA, i, uint64(len(m.BucketCounts)*8)) + i-- + dAtA[i] = 0x32 } if m.Sum != 0 { i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Sum)))) + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Sum)) i-- dAtA[i] = 0x29 } if m.Count != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.Count)) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Count)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x21 } if m.TimeUnixNano != 0 { i -= 8 @@ -1686,7 +2460,7 @@ func (m *HistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *HistogramDataPoint_Bucket) Marshal() (dAtA []byte, err error) { +func (m *DoubleHistogramDataPoint) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1696,12 +2470,12 @@ func (m *HistogramDataPoint_Bucket) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HistogramDataPoint_Bucket) MarshalTo(dAtA []byte) (int, error) { +func (m *DoubleHistogramDataPoint) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HistogramDataPoint_Bucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *DoubleHistogramDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1710,54 +2484,10 @@ func (m *HistogramDataPoint_Bucket) MarshalToSizedBuffer(dAtA []byte) (int, erro i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Exemplar != nil { - { - size, err := m.Exemplar.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if m.Count != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.Count)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func (m *HistogramDataPoint_Bucket_Exemplar) 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 *HistogramDataPoint_Bucket_Exemplar) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HistogramDataPoint_Bucket_Exemplar) 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.Attachments) > 0 { - for iNdEx := len(m.Attachments) - 1; iNdEx >= 0; iNdEx-- { + if len(m.Exemplars) > 0 { + for iNdEx := len(m.Exemplars) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.Attachments[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Exemplars[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1765,61 +2495,27 @@ func (m *HistogramDataPoint_Bucket_Exemplar) MarshalToSizedBuffer(dAtA []byte) ( i = encodeVarintMetrics(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0x42 } } - if m.TimeUnixNano != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TimeUnixNano)) - i-- - dAtA[i] = 0x11 - } - if m.Value != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) - i-- - dAtA[i] = 0x9 - } - return len(dAtA) - i, nil -} - -func (m *SummaryDataPoint) 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 *SummaryDataPoint) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SummaryDataPoint) 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.PercentileValues) > 0 { - for iNdEx := len(m.PercentileValues) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PercentileValues[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintMetrics(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x32 + if len(m.ExplicitBounds) > 0 { + for iNdEx := len(m.ExplicitBounds) - 1; iNdEx >= 0; iNdEx-- { + f10 := math.Float64bits(float64(m.ExplicitBounds[iNdEx])) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(f10)) } + i = encodeVarintMetrics(dAtA, i, uint64(len(m.ExplicitBounds)*8)) + i-- + dAtA[i] = 0x3a + } + if len(m.BucketCounts) > 0 { + for iNdEx := len(m.BucketCounts) - 1; iNdEx >= 0; iNdEx-- { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.BucketCounts[iNdEx])) + } + i = encodeVarintMetrics(dAtA, i, uint64(len(m.BucketCounts)*8)) + i-- + dAtA[i] = 0x32 } if m.Sum != 0 { i -= 8 @@ -1828,9 +2524,10 @@ func (m *SummaryDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x29 } if m.Count != 0 { - i = encodeVarintMetrics(dAtA, i, uint64(m.Count)) + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Count)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x21 } if m.TimeUnixNano != 0 { i -= 8 @@ -1861,7 +2558,7 @@ func (m *SummaryDataPoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SummaryDataPoint_ValueAtPercentile) Marshal() (dAtA []byte, err error) { +func (m *IntExemplar) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1871,12 +2568,12 @@ func (m *SummaryDataPoint_ValueAtPercentile) Marshal() (dAtA []byte, err error) return dAtA[:n], nil } -func (m *SummaryDataPoint_ValueAtPercentile) MarshalTo(dAtA []byte) (int, error) { +func (m *IntExemplar) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *SummaryDataPoint_ValueAtPercentile) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *IntExemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1885,17 +2582,112 @@ func (m *SummaryDataPoint_ValueAtPercentile) MarshalToSizedBuffer(dAtA []byte) ( i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } + if len(m.TraceId) > 0 { + i -= len(m.TraceId) + copy(dAtA[i:], m.TraceId) + i = encodeVarintMetrics(dAtA, i, uint64(len(m.TraceId))) + i-- + dAtA[i] = 0x2a + } + if len(m.SpanId) > 0 { + i -= len(m.SpanId) + copy(dAtA[i:], m.SpanId) + i = encodeVarintMetrics(dAtA, i, uint64(len(m.SpanId))) + i-- + dAtA[i] = 0x22 + } + if m.Value != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.Value)) + i-- + dAtA[i] = 0x19 + } + if m.TimeUnixNano != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TimeUnixNano)) + i-- + dAtA[i] = 0x11 + } + if len(m.FilteredLabels) > 0 { + for iNdEx := len(m.FilteredLabels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FilteredLabels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DoubleExemplar) 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 *DoubleExemplar) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DoubleExemplar) 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.TraceId) > 0 { + i -= len(m.TraceId) + copy(dAtA[i:], m.TraceId) + i = encodeVarintMetrics(dAtA, i, uint64(len(m.TraceId))) + i-- + dAtA[i] = 0x2a + } + if len(m.SpanId) > 0 { + i -= len(m.SpanId) + copy(dAtA[i:], m.SpanId) + i = encodeVarintMetrics(dAtA, i, uint64(len(m.SpanId))) + i-- + dAtA[i] = 0x22 + } if m.Value != 0 { i -= 8 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) i-- + dAtA[i] = 0x19 + } + if m.TimeUnixNano != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(m.TimeUnixNano)) + i-- dAtA[i] = 0x11 } - if m.Percentile != 0 { - i -= 8 - encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Percentile)))) - i-- - dAtA[i] = 0x9 + if len(m.FilteredLabels) > 0 { + for iNdEx := len(m.FilteredLabels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FilteredLabels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetrics(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } return len(dAtA) - i, nil } @@ -1956,46 +2748,6 @@ func (m *InstrumentationLibraryMetrics) Size() (n int) { } func (m *Metric) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.MetricDescriptor != nil { - l = m.MetricDescriptor.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - if len(m.Int64DataPoints) > 0 { - for _, e := range m.Int64DataPoints { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if len(m.DoubleDataPoints) > 0 { - for _, e := range m.DoubleDataPoints { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if len(m.HistogramDataPoints) > 0 { - for _, e := range m.HistogramDataPoints { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if len(m.SummaryDataPoints) > 0 { - for _, e := range m.SummaryDataPoints { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *MetricDescriptor) Size() (n int) { if m == nil { return 0 } @@ -2013,11 +2765,8 @@ func (m *MetricDescriptor) Size() (n int) { if l > 0 { n += 1 + l + sovMetrics(uint64(l)) } - if m.Type != 0 { - n += 1 + sovMetrics(uint64(m.Type)) - } - if m.Temporality != 0 { - n += 1 + sovMetrics(uint64(m.Temporality)) + if m.Data != nil { + n += m.Data.Size() } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -2025,7 +2774,205 @@ func (m *MetricDescriptor) Size() (n int) { return n } -func (m *Int64DataPoint) Size() (n int) { +func (m *Metric_IntGauge) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IntGauge != nil { + l = m.IntGauge.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} +func (m *Metric_DoubleGauge) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DoubleGauge != nil { + l = m.DoubleGauge.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} +func (m *Metric_IntSum) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IntSum != nil { + l = m.IntSum.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} +func (m *Metric_DoubleSum) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DoubleSum != nil { + l = m.DoubleSum.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} +func (m *Metric_IntHistogram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.IntHistogram != nil { + l = m.IntHistogram.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} +func (m *Metric_DoubleHistogram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DoubleHistogram != nil { + l = m.DoubleHistogram.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + return n +} +func (m *IntGauge) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DoubleGauge) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IntSum) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.AggregationTemporality != 0 { + n += 1 + sovMetrics(uint64(m.AggregationTemporality)) + } + if m.IsMonotonic { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DoubleSum) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.AggregationTemporality != 0 { + n += 1 + sovMetrics(uint64(m.AggregationTemporality)) + } + if m.IsMonotonic { + n += 2 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IntHistogram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.AggregationTemporality != 0 { + n += 1 + sovMetrics(uint64(m.AggregationTemporality)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *DoubleHistogram) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DataPoints) > 0 { + for _, e := range m.DataPoints { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.AggregationTemporality != 0 { + n += 1 + sovMetrics(uint64(m.AggregationTemporality)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IntDataPoint) Size() (n int) { if m == nil { return 0 } @@ -2044,7 +2991,13 @@ func (m *Int64DataPoint) Size() (n int) { n += 9 } if m.Value != 0 { - n += 1 + sovMetrics(uint64(m.Value)) + n += 9 + } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) @@ -2073,13 +3026,19 @@ func (m *DoubleDataPoint) Size() (n int) { if m.Value != 0 { n += 9 } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *HistogramDataPoint) Size() (n int) { +func (m *IntHistogramDataPoint) Size() (n int) { if m == nil { return 0 } @@ -2098,37 +3057,95 @@ func (m *HistogramDataPoint) Size() (n int) { n += 9 } if m.Count != 0 { - n += 1 + sovMetrics(uint64(m.Count)) + n += 9 } if m.Sum != 0 { n += 9 } - if len(m.Buckets) > 0 { - for _, e := range m.Buckets { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } + if len(m.BucketCounts) > 0 { + n += 1 + sovMetrics(uint64(len(m.BucketCounts)*8)) + len(m.BucketCounts)*8 } if len(m.ExplicitBounds) > 0 { n += 1 + sovMetrics(uint64(len(m.ExplicitBounds)*8)) + len(m.ExplicitBounds)*8 } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } return n } -func (m *HistogramDataPoint_Bucket) Size() (n int) { +func (m *DoubleHistogramDataPoint) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Count != 0 { - n += 1 + sovMetrics(uint64(m.Count)) + if len(m.Labels) > 0 { + for _, e := range m.Labels { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } } - if m.Exemplar != nil { - l = m.Exemplar.Size() + if m.StartTimeUnixNano != 0 { + n += 9 + } + if m.TimeUnixNano != 0 { + n += 9 + } + if m.Count != 0 { + n += 9 + } + if m.Sum != 0 { + n += 9 + } + if len(m.BucketCounts) > 0 { + n += 1 + sovMetrics(uint64(len(m.BucketCounts)*8)) + len(m.BucketCounts)*8 + } + if len(m.ExplicitBounds) > 0 { + n += 1 + sovMetrics(uint64(len(m.ExplicitBounds)*8)) + len(m.ExplicitBounds)*8 + } + if len(m.Exemplars) > 0 { + for _, e := range m.Exemplars { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IntExemplar) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FilteredLabels) > 0 { + for _, e := range m.FilteredLabels { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } + } + if m.TimeUnixNano != 0 { + n += 9 + } + if m.Value != 0 { + n += 9 + } + l = len(m.SpanId) + if l > 0 { + n += 1 + l + sovMetrics(uint64(l)) + } + l = len(m.TraceId) + if l > 0 { n += 1 + l + sovMetrics(uint64(l)) } if m.XXX_unrecognized != nil { @@ -2137,78 +3154,32 @@ func (m *HistogramDataPoint_Bucket) Size() (n int) { return n } -func (m *HistogramDataPoint_Bucket_Exemplar) Size() (n int) { +func (m *DoubleExemplar) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Value != 0 { - n += 9 + if len(m.FilteredLabels) > 0 { + for _, e := range m.FilteredLabels { + l = e.Size() + n += 1 + l + sovMetrics(uint64(l)) + } } if m.TimeUnixNano != 0 { n += 9 } - if len(m.Attachments) > 0 { - for _, e := range m.Attachments { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SummaryDataPoint) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.Labels) > 0 { - for _, e := range m.Labels { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if m.StartTimeUnixNano != 0 { - n += 9 - } - if m.TimeUnixNano != 0 { - n += 9 - } - if m.Count != 0 { - n += 1 + sovMetrics(uint64(m.Count)) - } - if m.Sum != 0 { - n += 9 - } - if len(m.PercentileValues) > 0 { - for _, e := range m.PercentileValues { - l = e.Size() - n += 1 + l + sovMetrics(uint64(l)) - } - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n -} - -func (m *SummaryDataPoint_ValueAtPercentile) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Percentile != 0 { - n += 9 - } if m.Value != 0 { n += 9 } + l = len(m.SpanId) + if l > 0 { + n += 1 + l + sovMetrics(uint64(l)) + } + l = len(m.TraceId) + if l > 0 { + n += 1 + l + sovMetrics(uint64(l)) + } if m.XXX_unrecognized != nil { n += len(m.XXX_unrecognized) } @@ -2498,232 +3469,6 @@ func (m *Metric) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: Metric: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetricDescriptor", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.MetricDescriptor == nil { - m.MetricDescriptor = &MetricDescriptor{} - } - if err := m.MetricDescriptor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Int64DataPoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Int64DataPoints = append(m.Int64DataPoints, &Int64DataPoint{}) - if err := m.Int64DataPoints[len(m.Int64DataPoints)-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 DoubleDataPoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.DoubleDataPoints = append(m.DoubleDataPoints, &DoubleDataPoint{}) - if err := m.DoubleDataPoints[len(m.DoubleDataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field HistogramDataPoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.HistogramDataPoints = append(m.HistogramDataPoints, &HistogramDataPoint{}) - if err := m.HistogramDataPoints[len(m.HistogramDataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SummaryDataPoints", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SummaryDataPoints = append(m.SummaryDataPoints, &SummaryDataPoint{}) - if err := m.SummaryDataPoints[len(m.SummaryDataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetrics(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMetrics - } - 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 *MetricDescriptor) 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 ErrIntOverflowMetrics - } - 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: MetricDescriptor: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MetricDescriptor: 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) @@ -2821,10 +3566,10 @@ func (m *MetricDescriptor) Unmarshal(dAtA []byte) error { m.Unit = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IntGauge", wireType) } - m.Type = 0 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetrics @@ -2834,16 +3579,32 @@ func (m *MetricDescriptor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Type |= MetricDescriptor_Type(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Temporality", wireType) + if msglen < 0 { + return ErrInvalidLengthMetrics } - m.Temporality = 0 + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &IntGauge{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_IntGauge{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DoubleGauge", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetrics @@ -2853,7 +3614,700 @@ func (m *MetricDescriptor) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Temporality |= MetricDescriptor_Temporality(b&0x7F) << shift + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DoubleGauge{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_DoubleGauge{v} + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IntSum", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &IntSum{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_IntSum{v} + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DoubleSum", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DoubleSum{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_DoubleSum{v} + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IntHistogram", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &IntHistogram{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_IntHistogram{v} + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DoubleHistogram", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &DoubleHistogram{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.Data = &Metric_DoubleHistogram{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *IntGauge) 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 ErrIntOverflowMetrics + } + 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: IntGauge: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IntGauge: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataPoints = append(m.DataPoints, &IntDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *DoubleGauge) 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 ErrIntOverflowMetrics + } + 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: DoubleGauge: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DoubleGauge: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataPoints = append(m.DataPoints, &DoubleDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *IntSum) 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 ErrIntOverflowMetrics + } + 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: IntSum: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IntSum: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataPoints = append(m.DataPoints, &IntDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationTemporality", wireType) + } + m.AggregationTemporality = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AggregationTemporality |= AggregationTemporality(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsMonotonic", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsMonotonic = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *DoubleSum) 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 ErrIntOverflowMetrics + } + 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: DoubleSum: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DoubleSum: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataPoints = append(m.DataPoints, &DoubleDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationTemporality", wireType) + } + m.AggregationTemporality = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AggregationTemporality |= AggregationTemporality(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsMonotonic", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsMonotonic = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *IntHistogram) 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 ErrIntOverflowMetrics + } + 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: IntHistogram: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IntHistogram: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataPoints = append(m.DataPoints, &IntHistogramDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationTemporality", wireType) + } + m.AggregationTemporality = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AggregationTemporality |= AggregationTemporality(b&0x7F) << shift if b < 0x80 { break } @@ -2883,7 +4337,7 @@ func (m *MetricDescriptor) Unmarshal(dAtA []byte) error { } return nil } -func (m *Int64DataPoint) Unmarshal(dAtA []byte) error { +func (m *DoubleHistogram) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -2906,10 +4360,117 @@ func (m *Int64DataPoint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Int64DataPoint: wiretype end group for non-group") + return fmt.Errorf("proto: DoubleHistogram: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Int64DataPoint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DoubleHistogram: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DataPoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DataPoints = append(m.DataPoints, &DoubleHistogramDataPoint{}) + if err := m.DataPoints[len(m.DataPoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AggregationTemporality", wireType) + } + m.AggregationTemporality = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AggregationTemporality |= AggregationTemporality(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *IntDataPoint) 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 ErrIntOverflowMetrics + } + 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: IntDataPoint: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IntDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -2967,10 +4528,20 @@ func (m *Int64DataPoint) Unmarshal(dAtA []byte) error { m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 case 4: - if wireType != 0 { + if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } m.Value = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.Value = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetrics @@ -2980,11 +4551,26 @@ func (m *Int64DataPoint) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.Value |= int64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Exemplars = append(m.Exemplars, &IntExemplar{}) + if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMetrics(dAtA[iNdEx:]) @@ -3104,6 +4690,40 @@ func (m *DoubleDataPoint) Unmarshal(dAtA []byte) error { v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Value = float64(math.Float64frombits(v)) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Exemplars = append(m.Exemplars, &DoubleExemplar{}) + if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMetrics(dAtA[iNdEx:]) @@ -3129,7 +4749,7 @@ func (m *DoubleDataPoint) Unmarshal(dAtA []byte) error { } return nil } -func (m *HistogramDataPoint) Unmarshal(dAtA []byte) error { +func (m *IntHistogramDataPoint) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3152,10 +4772,10 @@ func (m *HistogramDataPoint) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HistogramDataPoint: wiretype end group for non-group") + return fmt.Errorf("proto: IntHistogramDataPoint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HistogramDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IntHistogramDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3213,69 +4833,77 @@ func (m *HistogramDataPoint) Unmarshal(dAtA []byte) error { m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 case 4: - if wireType != 0 { + if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) } m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF } + m.Count = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 case 5: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) } - var v uint64 + m.Sum = 0 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + m.Sum = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - m.Sum = float64(math.Float64frombits(v)) case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Buckets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BucketCounts = append(m.BucketCounts, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } } + if packedLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.BucketCounts) == 0 { + m.BucketCounts = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BucketCounts = append(m.BucketCounts, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BucketCounts", wireType) } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Buckets = append(m.Buckets, &HistogramDataPoint_Bucket{}) - if err := m.Buckets[len(m.Buckets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 7: if wireType == 1 { var v uint64 @@ -3330,82 +4958,9 @@ func (m *HistogramDataPoint) Unmarshal(dAtA []byte) error { } else { return fmt.Errorf("proto: wrong wireType = %d for field ExplicitBounds", wireType) } - default: - iNdEx = preIndex - skippy, err := skipMetrics(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMetrics - } - 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 *HistogramDataPoint_Bucket) 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 ErrIntOverflowMetrics - } - 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: Bucket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Bucket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) - } - m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Exemplar", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3432,10 +4987,8 @@ func (m *HistogramDataPoint_Bucket) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Exemplar == nil { - m.Exemplar = &HistogramDataPoint_Bucket_Exemplar{} - } - if err := m.Exemplar.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Exemplars = append(m.Exemplars, &IntExemplar{}) + if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3464,7 +5017,7 @@ func (m *HistogramDataPoint_Bucket) Unmarshal(dAtA []byte) error { } return nil } -func (m *HistogramDataPoint_Bucket_Exemplar) Unmarshal(dAtA []byte) error { +func (m *DoubleHistogramDataPoint) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3487,119 +5040,10 @@ func (m *HistogramDataPoint_Bucket_Exemplar) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Exemplar: wiretype end group for non-group") + return fmt.Errorf("proto: DoubleHistogramDataPoint: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Exemplar: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) - } - var v uint64 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - m.Value = float64(math.Float64frombits(v)) - case 2: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) - } - m.TimeUnixNano = 0 - if (iNdEx + 8) > l { - return io.ErrUnexpectedEOF - } - m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) - iNdEx += 8 - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Attachments", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthMetrics - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthMetrics - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Attachments = append(m.Attachments, &v11.StringKeyValue{}) - if err := m.Attachments[len(m.Attachments)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipMetrics(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthMetrics - } - if (iNdEx + skippy) < 0 { - return ErrInvalidLengthMetrics - } - 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 *SummaryDataPoint) 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 ErrIntOverflowMetrics - } - 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: SummaryDataPoint: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SummaryDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DoubleHistogramDataPoint: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3657,24 +5101,15 @@ func (m *SummaryDataPoint) Unmarshal(dAtA []byte) error { m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 case 4: - if wireType != 0 { + if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Count", wireType) } m.Count = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowMetrics - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Count |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF } + m.Count = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 case 5: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Sum", wireType) @@ -3687,8 +5122,114 @@ func (m *SummaryDataPoint) Unmarshal(dAtA []byte) error { iNdEx += 8 m.Sum = float64(math.Float64frombits(v)) case 6: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BucketCounts = append(m.BucketCounts, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.BucketCounts) == 0 { + m.BucketCounts = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.BucketCounts = append(m.BucketCounts, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field BucketCounts", wireType) + } + case 7: + if wireType == 1 { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.ExplicitBounds = append(m.ExplicitBounds, v2) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + elementCount = packedLen / 8 + if elementCount != 0 && len(m.ExplicitBounds) == 0 { + m.ExplicitBounds = make([]float64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + v2 := float64(math.Float64frombits(v)) + m.ExplicitBounds = append(m.ExplicitBounds, v2) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field ExplicitBounds", wireType) + } + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PercentileValues", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Exemplars", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3715,8 +5256,8 @@ func (m *SummaryDataPoint) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.PercentileValues = append(m.PercentileValues, &SummaryDataPoint_ValueAtPercentile{}) - if err := m.PercentileValues[len(m.PercentileValues)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Exemplars = append(m.Exemplars, &DoubleExemplar{}) + if err := m.Exemplars[len(m.Exemplars)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3745,7 +5286,7 @@ func (m *SummaryDataPoint) Unmarshal(dAtA []byte) error { } return nil } -func (m *SummaryDataPoint_ValueAtPercentile) Unmarshal(dAtA []byte) error { +func (m *IntExemplar) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3768,24 +5309,233 @@ func (m *SummaryDataPoint_ValueAtPercentile) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ValueAtPercentile: wiretype end group for non-group") + return fmt.Errorf("proto: IntExemplar: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ValueAtPercentile: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: IntExemplar: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 1 { - return fmt.Errorf("proto: wrong wireType = %d for field Percentile", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FilteredLabels", wireType) } - var v uint64 + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FilteredLabels = append(m.FilteredLabels, &v11.StringKeyValue{}) + if err := m.FilteredLabels[len(m.FilteredLabels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) + } + m.TimeUnixNano = 0 if (iNdEx + 8) > l { return io.ErrUnexpectedEOF } - v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 - m.Percentile = float64(math.Float64frombits(v)) + case 3: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + m.Value = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.Value = int64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 4: + 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 ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpanId = append(m.SpanId[:0], dAtA[iNdEx:postIndex]...) + if m.SpanId == nil { + m.SpanId = []byte{} + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceId = append(m.TraceId[:0], dAtA[iNdEx:postIndex]...) + if m.TraceId == nil { + m.TraceId = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetrics(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMetrics + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthMetrics + } + 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 *DoubleExemplar) 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 ErrIntOverflowMetrics + } + 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: DoubleExemplar: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DoubleExemplar: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FilteredLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FilteredLabels = append(m.FilteredLabels, &v11.StringKeyValue{}) + if err := m.FilteredLabels[len(m.FilteredLabels)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex case 2: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field TimeUnixNano", wireType) + } + m.TimeUnixNano = 0 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + m.TimeUnixNano = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + case 3: if wireType != 1 { return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } @@ -3796,6 +5546,74 @@ func (m *SummaryDataPoint_ValueAtPercentile) Unmarshal(dAtA []byte) error { v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) iNdEx += 8 m.Value = float64(math.Float64frombits(v)) + case 4: + 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 ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpanId = append(m.SpanId[:0], dAtA[iNdEx:postIndex]...) + if m.SpanId == nil { + m.SpanId = []byte{} + } + iNdEx = postIndex + case 5: + 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 ErrIntOverflowMetrics + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetrics + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetrics + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TraceId = append(m.TraceId[:0], dAtA[iNdEx:postIndex]...) + if m.TraceId == nil { + m.TraceId = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipMetrics(dAtA[iNdEx:]) diff --git a/exporters/otlp/internal/opentelemetry-proto-gen/trace/v1/trace.pb.go b/exporters/otlp/internal/opentelemetry-proto-gen/trace/v1/trace.pb.go index ec89c03b8..c15803192 100644 --- a/exporters/otlp/internal/opentelemetry-proto-gen/trace/v1/trace.pb.go +++ b/exporters/otlp/internal/opentelemetry-proto-gen/trace/v1/trace.pb.go @@ -35,39 +35,39 @@ const ( Span_SPAN_KIND_UNSPECIFIED Span_SpanKind = 0 // Indicates that the span represents an internal operation within an application, // as opposed to an operations happening at the boundaries. Default value. - Span_INTERNAL Span_SpanKind = 1 + Span_SPAN_KIND_INTERNAL Span_SpanKind = 1 // Indicates that the span covers server-side handling of an RPC or other // remote network request. - Span_SERVER Span_SpanKind = 2 + Span_SPAN_KIND_SERVER Span_SpanKind = 2 // Indicates that the span describes a request to some remote service. - Span_CLIENT Span_SpanKind = 3 + Span_SPAN_KIND_CLIENT Span_SpanKind = 3 // Indicates that the span describes a producer sending a message to a broker. // Unlike CLIENT and SERVER, there is often no direct critical path latency relationship // between producer and consumer spans. A PRODUCER span ends when the message was accepted // by the broker while the logical processing of the message might span a much longer time. - Span_PRODUCER Span_SpanKind = 4 + Span_SPAN_KIND_PRODUCER Span_SpanKind = 4 // Indicates that the span describes consumer receiving a message from a broker. // Like the PRODUCER kind, there is often no direct critical path latency relationship // between producer and consumer spans. - Span_CONSUMER Span_SpanKind = 5 + Span_SPAN_KIND_CONSUMER Span_SpanKind = 5 ) var Span_SpanKind_name = map[int32]string{ 0: "SPAN_KIND_UNSPECIFIED", - 1: "INTERNAL", - 2: "SERVER", - 3: "CLIENT", - 4: "PRODUCER", - 5: "CONSUMER", + 1: "SPAN_KIND_INTERNAL", + 2: "SPAN_KIND_SERVER", + 3: "SPAN_KIND_CLIENT", + 4: "SPAN_KIND_PRODUCER", + 5: "SPAN_KIND_CONSUMER", } var Span_SpanKind_value = map[string]int32{ "SPAN_KIND_UNSPECIFIED": 0, - "INTERNAL": 1, - "SERVER": 2, - "CLIENT": 3, - "PRODUCER": 4, - "CONSUMER": 5, + "SPAN_KIND_INTERNAL": 1, + "SPAN_KIND_SERVER": 2, + "SPAN_KIND_CLIENT": 3, + "SPAN_KIND_PRODUCER": 4, + "SPAN_KIND_CONSUMER": 5, } func (x Span_SpanKind) String() string { @@ -83,63 +83,63 @@ func (Span_SpanKind) EnumDescriptor() ([]byte, []int) { type Status_StatusCode int32 const ( - Status_Ok Status_StatusCode = 0 - Status_Cancelled Status_StatusCode = 1 - Status_UnknownError Status_StatusCode = 2 - Status_InvalidArgument Status_StatusCode = 3 - Status_DeadlineExceeded Status_StatusCode = 4 - Status_NotFound Status_StatusCode = 5 - Status_AlreadyExists Status_StatusCode = 6 - Status_PermissionDenied Status_StatusCode = 7 - Status_ResourceExhausted Status_StatusCode = 8 - Status_FailedPrecondition Status_StatusCode = 9 - Status_Aborted Status_StatusCode = 10 - Status_OutOfRange Status_StatusCode = 11 - Status_Unimplemented Status_StatusCode = 12 - Status_InternalError Status_StatusCode = 13 - Status_Unavailable Status_StatusCode = 14 - Status_DataLoss Status_StatusCode = 15 - Status_Unauthenticated Status_StatusCode = 16 + Status_STATUS_CODE_OK Status_StatusCode = 0 + Status_STATUS_CODE_CANCELLED Status_StatusCode = 1 + Status_STATUS_CODE_UNKNOWN_ERROR Status_StatusCode = 2 + Status_STATUS_CODE_INVALID_ARGUMENT Status_StatusCode = 3 + Status_STATUS_CODE_DEADLINE_EXCEEDED Status_StatusCode = 4 + Status_STATUS_CODE_NOT_FOUND Status_StatusCode = 5 + Status_STATUS_CODE_ALREADY_EXISTS Status_StatusCode = 6 + Status_STATUS_CODE_PERMISSION_DENIED Status_StatusCode = 7 + Status_STATUS_CODE_RESOURCE_EXHAUSTED Status_StatusCode = 8 + Status_STATUS_CODE_FAILED_PRECONDITION Status_StatusCode = 9 + Status_STATUS_CODE_ABORTED Status_StatusCode = 10 + Status_STATUS_CODE_OUT_OF_RANGE Status_StatusCode = 11 + Status_STATUS_CODE_UNIMPLEMENTED Status_StatusCode = 12 + Status_STATUS_CODE_INTERNAL_ERROR Status_StatusCode = 13 + Status_STATUS_CODE_UNAVAILABLE Status_StatusCode = 14 + Status_STATUS_CODE_DATA_LOSS Status_StatusCode = 15 + Status_STATUS_CODE_UNAUTHENTICATED Status_StatusCode = 16 ) var Status_StatusCode_name = map[int32]string{ - 0: "Ok", - 1: "Cancelled", - 2: "UnknownError", - 3: "InvalidArgument", - 4: "DeadlineExceeded", - 5: "NotFound", - 6: "AlreadyExists", - 7: "PermissionDenied", - 8: "ResourceExhausted", - 9: "FailedPrecondition", - 10: "Aborted", - 11: "OutOfRange", - 12: "Unimplemented", - 13: "InternalError", - 14: "Unavailable", - 15: "DataLoss", - 16: "Unauthenticated", + 0: "STATUS_CODE_OK", + 1: "STATUS_CODE_CANCELLED", + 2: "STATUS_CODE_UNKNOWN_ERROR", + 3: "STATUS_CODE_INVALID_ARGUMENT", + 4: "STATUS_CODE_DEADLINE_EXCEEDED", + 5: "STATUS_CODE_NOT_FOUND", + 6: "STATUS_CODE_ALREADY_EXISTS", + 7: "STATUS_CODE_PERMISSION_DENIED", + 8: "STATUS_CODE_RESOURCE_EXHAUSTED", + 9: "STATUS_CODE_FAILED_PRECONDITION", + 10: "STATUS_CODE_ABORTED", + 11: "STATUS_CODE_OUT_OF_RANGE", + 12: "STATUS_CODE_UNIMPLEMENTED", + 13: "STATUS_CODE_INTERNAL_ERROR", + 14: "STATUS_CODE_UNAVAILABLE", + 15: "STATUS_CODE_DATA_LOSS", + 16: "STATUS_CODE_UNAUTHENTICATED", } var Status_StatusCode_value = map[string]int32{ - "Ok": 0, - "Cancelled": 1, - "UnknownError": 2, - "InvalidArgument": 3, - "DeadlineExceeded": 4, - "NotFound": 5, - "AlreadyExists": 6, - "PermissionDenied": 7, - "ResourceExhausted": 8, - "FailedPrecondition": 9, - "Aborted": 10, - "OutOfRange": 11, - "Unimplemented": 12, - "InternalError": 13, - "Unavailable": 14, - "DataLoss": 15, - "Unauthenticated": 16, + "STATUS_CODE_OK": 0, + "STATUS_CODE_CANCELLED": 1, + "STATUS_CODE_UNKNOWN_ERROR": 2, + "STATUS_CODE_INVALID_ARGUMENT": 3, + "STATUS_CODE_DEADLINE_EXCEEDED": 4, + "STATUS_CODE_NOT_FOUND": 5, + "STATUS_CODE_ALREADY_EXISTS": 6, + "STATUS_CODE_PERMISSION_DENIED": 7, + "STATUS_CODE_RESOURCE_EXHAUSTED": 8, + "STATUS_CODE_FAILED_PRECONDITION": 9, + "STATUS_CODE_ABORTED": 10, + "STATUS_CODE_OUT_OF_RANGE": 11, + "STATUS_CODE_UNIMPLEMENTED": 12, + "STATUS_CODE_INTERNAL_ERROR": 13, + "STATUS_CODE_UNAVAILABLE": 14, + "STATUS_CODE_DATA_LOSS": 15, + "STATUS_CODE_UNAUTHENTICATED": 16, } func (x Status_StatusCode) String() string { @@ -725,7 +725,7 @@ func (m *Status) GetCode() Status_StatusCode { if m != nil { return m.Code } - return Status_Ok + return Status_STATUS_CODE_OK } func (m *Status) GetMessage() string { @@ -751,72 +751,75 @@ func init() { } var fileDescriptor_5c407ac9c675a601 = []byte{ - // 1031 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 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xdf, 0x52, 0x00, 0xef, 0xe0, 0x28, 0x07, 0xa9, 0xa3, 0x53, 0xf7, 0x1e, 0x2a, - 0xc3, 0x46, 0x9b, 0x88, 0x31, 0x0b, 0x02, 0x46, 0x5d, 0x07, 0xb9, 0x50, 0x1a, 0x8a, 0x53, 0x21, - 0x7f, 0x12, 0xbe, 0x52, 0x52, 0xb9, 0x29, 0x74, 0x1f, 0x36, 0xbb, 0x62, 0x41, 0x02, 0x4e, 0x5b, - 0x6a, 0x62, 0x7f, 0xe6, 0xdd, 0x34, 0x7a, 0x00, 0x6e, 0x87, 0x11, 0x1a, 0x70, 0xc1, 0xfc, 0xe5, - 0x98, 0x31, 0xca, 0x68, 0x64, 0xad, 0x27, 0xf5, 0xbe, 0x9c, 0x0b, 0xea, 0x66, 0xd1, 0x16, 0x94, - 0x5b, 0x81, 0x62, 0x84, 0x9e, 0xf9, 0x4b, 0x1e, 0xea, 0xd0, 0xcd, 0x19, 0x5a, 0x9f, 0xa9, 0x29, - 0x0f, 0x43, 0x2e, 0x45, 0x87, 0x09, 0xce, 0xa8, 0x9b, 0x47, 0x0f, 0x61, 0x2b, 0x79, 0x9d, 0xfa, - 0xcb, 0xb7, 0x64, 0x1e, 0x6a, 0x46, 0xdd, 0x02, 0x7a, 0x04, 0x68, 0x9f, 0xf0, 0x80, 0xd1, 0xbe, - 0x62, 0x63, 0x29, 0x28, 0x37, 0x6f, 0x17, 0x77, 0x03, 0x15, 0x21, 0xdf, 0x3a, 0x91, 0xca, 0x80, - 0x00, 0x55, 0x00, 0x8e, 0xe6, 0xfa, 0xe8, 0x47, 0x4c, 0xc4, 0x84, 0xb9, 0x45, 0x23, 0x3a, 0x14, - 0x7c, 0x3a, 0x33, 0xc7, 0x26, 0x0c, 0xa4, 0x64, 0x42, 0x5d, 0xa1, 0x99, 0x12, 0x24, 0x88, 0x3c, - 0x95, 0xd1, 0x26, 0x14, 0x87, 0x82, 0x2c, 0x08, 0x0f, 0xc8, 0x49, 0xc0, 0xdc, 0x8a, 0xe9, 0xbc, - 0x43, 0x34, 0x39, 0x94, 0x61, 0xe8, 0x6e, 0x1a, 0xcb, 0x43, 0x41, 0xe6, 0xfa, 0x2d, 0x13, 0x9a, - 0x8f, 0x89, 0x29, 0xe3, 0xbe, 0xfe, 0xc5, 0xf9, 0xf3, 0x7c, 0xc7, 0xf9, 0xeb, 0x7c, 0xc7, 0xf9, - 0xf7, 0x7c, 0xc7, 0x81, 0x67, 0x5c, 0xae, 0x9d, 0xd0, 0x6b, 0x38, 0x36, 0xab, 0xbe, 0x09, 0xf6, - 0x9d, 0x1f, 0xbe, 0x9f, 0x5c, 0x85, 0x73, 0xd9, 0x94, 0x9a, 0x05, 0x4d, 0xb6, 0x9c, 0x19, 0x33, - 0x2a, 0x6c, 0x4a, 0x1d, 0xcc, 0x9a, 0x3c, 0x6e, 0xb5, 0xb9, 0x82, 0x7e, 0x69, 0x8b, 0xbf, 0x9c, - 0x30, 0x71, 0xf1, 0x77, 0xea, 0x24, 0x67, 0x63, 0x9f, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x47, - 0x96, 0xd8, 0x1b, 0x75, 0x09, 0x00, 0x00, + // 1088 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4f, 0x6f, 0xe3, 0xc4, + 0x1b, 0x5e, 0xb7, 0x4e, 0xda, 0x7d, 0xdb, 0x66, 0xbd, 0xb3, 0xfb, 0xdb, 0xba, 0xff, 0xf3, 0x0b, + 0x2b, 0x11, 0x58, 0x6d, 0x42, 0x8b, 0x90, 0x16, 0x09, 0x04, 0xae, 0x3d, 0xed, 0x5a, 0x75, 0xed, + 0x30, 0xb6, 0xcb, 0xc2, 0xc5, 0x72, 0x9b, 0x51, 0x65, 0x35, 0x19, 0x47, 0xb6, 0x53, 0xb5, 0x07, + 0xbe, 0x02, 0x37, 0x0e, 0x48, 0x7c, 0x1c,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, 0x88, 0xc1, 0xf2, 0x1d, + 0xe9, 0x15, 0x45, 0x7f, 0x76, 0x6b, 0x62, 0x45, 0xaf, 0xef, 0xcc, 0x8c, 0xbc, 0xb8, 0x3d, 0x29, + 0xf4, 0x06, 0x2a, 0xe3, 0x65, 0x37, 0xa6, 0x97, 0xcd, 0x73, 0x24, 0x39, 0xa1, 0xf1, 0x0b, 0x80, + 0xcc, 0xef, 0x68, 0x05, 0xe6, 0x05, 0x20, 0x88, 0xba, 0x22, 0xc7, 0x45, 0x32, 0x27, 0xee, 0x66, + 0x17, 0x2d, 0xc3, 0x1c, 0x07, 0x73, 0xcf, 0x8c, 0xf0, 0x54, 0xf9, 0xd5, 0xec, 0xa2, 0x2d, 0x58, + 0xc8, 0x39, 0x69, 0x16, 0x66, 0x54, 0x9d, 0xad, 0x4b, 0xcd, 0xc7, 0x04, 0x84, 0xc9, 0xe5, 0x16, + 0xf4, 0x12, 0x6a, 0x83, 0x30, 0xa1, 0x2c, 0x0b, 0x46, 0x01, 0x64, 0x11, 0x60, 0x31, 0xb7, 0xba, + 0x79, 0x18, 0x04, 0x32, 0x0b, 0xfb, 0x54, 0xad, 0x08, 0xbe, 0x38, 0xa3, 0xaf, 0x40, 0x3e, 0x8b, + 0x58, 0x57, 0xad, 0xd6, 0xa5, 0x66, 0x6d, 0xe7, 0xd5, 0xfd, 0x05, 0x89, 0x8f, 0x83, 0x88, 0x75, + 0x89, 0x20, 0xa2, 0x36, 0x3c, 0x4f, 0xb3, 0x30, 0xc9, 0x82, 0x2c, 0xea, 0xd3, 0x60, 0xc8, 0xa2, + 0x8b, 0x80, 0x85, 0x2c, 0x56, 0xe7, 0xea, 0x52, 0xb3, 0x4a, 0x9e, 0x0a, 0x9f, 0x17, 0xf5, 0xa9, + 0xcf, 0xa2, 0x0b, 0x3b, 0x64, 0x31, 0x7a, 0x05, 0x88, 0xb2, 0xee, 0x24, 0x7c, 0x5e, 0xc0, 0x9f, + 0x50, 0xd6, 0x2d, 0x81,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x8e, 0xeb, 0x2a, 0x4f, 0xd0, 0x16, 0xac, 0x4d, 0xf0, 0x7c, 0xef, + 0x2d, 0xb6, 0x3d, 0x53, 0xd7, 0xb8, 0xb0, 0xb2, 0xfb, 0xa3, 0xf4, 0xfb, 0xd5, 0xa6, 0xf4, 0xc7, + 0xd5, 0xa6, 0xf4, 0xf7, 0xd5, 0xa6, 0x04, 0x5b, 0x51, 0x3c, 0x75, 0xf3, 0x76, 0xc1, 0xe3, 0xa7, + 0x0e, 0x37, 0x76, 0xa4, 0xef, 0xbf, 0x39, 0x9d, 0x84, 0x47, 0x71, 0x3b, 0xce, 0x68, 0xaf, 0x4d, + 0x2f, 0x06, 0x71, 0x92, 0xd1, 0x24, 0x6d, 0xc7, 0x59, 0x6f, 0xd0, 0x8e, 0x58, 0x46, 0x13, 0x16, + 0xf6, 0xda, 0x25, 0xf4, 0x6b, 0x11, 0xfc, 0xf5, 0x29, 0x65, 0xd7, 0xff, 0x2c, 0x8f, 0xab, 0xc2, + 0xf6, 0xe9, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xf7, 0xd2, 0xe8, 0x80, 0x0a, 0x00, 0x00, } func (m *ResourceSpans) Marshal() (dAtA []byte, err error) { diff --git a/exporters/otlp/internal/transform/metric.go b/exporters/otlp/internal/transform/metric.go index 56a5f9320..e32187159 100644 --- a/exporters/otlp/internal/transform/metric.go +++ b/exporters/otlp/internal/transform/metric.go @@ -193,23 +193,26 @@ func sink(ctx context.Context, in <-chan result) ([]*metricpb.ResourceMetrics, e rb.InstrumentationLibraryBatches[res.InstrumentationLibrary] = mb } - mID := res.Metric.GetMetricDescriptor().String() + mID := res.Metric.GetName() m, ok := mb[mID] if !ok { mb[mID] = res.Metric continue } - if len(res.Metric.Int64DataPoints) > 0 { - m.Int64DataPoints = append(m.Int64DataPoints, res.Metric.Int64DataPoints...) - } - if len(res.Metric.DoubleDataPoints) > 0 { - m.DoubleDataPoints = append(m.DoubleDataPoints, res.Metric.DoubleDataPoints...) - } - if len(res.Metric.HistogramDataPoints) > 0 { - m.HistogramDataPoints = append(m.HistogramDataPoints, res.Metric.HistogramDataPoints...) - } - if len(res.Metric.SummaryDataPoints) > 0 { - m.SummaryDataPoints = append(m.SummaryDataPoints, res.Metric.SummaryDataPoints...) + switch res.Metric.Data.(type) { + case *metricpb.Metric_IntGauge: + m.GetIntGauge().DataPoints = append(m.GetIntGauge().DataPoints, res.Metric.GetIntGauge().DataPoints...) + case *metricpb.Metric_IntHistogram: + m.GetIntHistogram().DataPoints = append(m.GetIntHistogram().DataPoints, res.Metric.GetIntHistogram().DataPoints...) + case *metricpb.Metric_IntSum: + m.GetIntSum().DataPoints = append(m.GetIntSum().DataPoints, res.Metric.GetIntSum().DataPoints...) + case *metricpb.Metric_DoubleGauge: + m.GetDoubleGauge().DataPoints = append(m.GetDoubleGauge().DataPoints, res.Metric.GetDoubleGauge().DataPoints...) + case *metricpb.Metric_DoubleHistogram: + m.GetDoubleHistogram().DataPoints = append(m.GetDoubleHistogram().DataPoints, res.Metric.GetDoubleHistogram().DataPoints...) + case *metricpb.Metric_DoubleSum: + m.GetDoubleSum().DataPoints = append(m.GetDoubleSum().DataPoints, res.Metric.GetDoubleSum().DataPoints...) + default: } } @@ -284,13 +287,57 @@ func Record(r export.Record) (*metricpb.Metric, error) { if err != nil { return nil, err } - return scalar(r, value, time.Time{}, tm) + return gauge(r, value, time.Time{}, tm) default: return nil, fmt.Errorf("%w: %T", ErrUnimplementedAgg, agg) } } +func gauge(record export.Record, num metric.Number, start, end time.Time) (*metricpb.Metric, error) { + desc := record.Descriptor() + labels := record.Labels() + + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + + switch n := desc.NumberKind(); n { + case metric.Int64NumberKind: + m.Data = &metricpb.Metric_IntGauge{ + IntGauge: &metricpb.IntGauge{ + DataPoints: []*metricpb.IntDataPoint{ + { + Value: num.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, + }, + } + case metric.Float64NumberKind: + m.Data = &metricpb.Metric_DoubleGauge{ + DoubleGauge: &metricpb.DoubleGauge{ + DataPoints: []*metricpb.DoubleDataPoint{ + { + Value: num.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) + } + + return m, nil +} + // scalar transforms a Sum or LastValue Aggregator into an OTLP Metric. // For LastValue (Gauge), use start==time.Time{}. func scalar(record export.Record, num metric.Number, start, end time.Time) (*metricpb.Metric, error) { @@ -298,32 +345,36 @@ func scalar(record export.Record, num metric.Number, start, end time.Time) (*met labels := record.Labels() m := &metricpb.Metric{ - MetricDescriptor: &metricpb.MetricDescriptor{ - Name: desc.Name(), - Description: desc.Description(), - Unit: string(desc.Unit()), - }, + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), } switch n := desc.NumberKind(); n { case metric.Int64NumberKind: - m.MetricDescriptor.Type = metricpb.MetricDescriptor_INT64 - m.Int64DataPoints = []*metricpb.Int64DataPoint{ - { - Value: num.CoerceToInt64(n), - Labels: stringKeyValues(labels.Iter()), - StartTimeUnixNano: toNanos(start), - TimeUnixNano: toNanos(end), + m.Data = &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + DataPoints: []*metricpb.IntDataPoint{ + { + Value: num.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, }, } case metric.Float64NumberKind: - m.MetricDescriptor.Type = metricpb.MetricDescriptor_DOUBLE - m.DoubleDataPoints = []*metricpb.DoubleDataPoint{ - { - Value: num.CoerceToFloat64(n), - Labels: stringKeyValues(labels.Iter()), - StartTimeUnixNano: toNanos(start), - TimeUnixNano: toNanos(end), + m.Data = &metricpb.Metric_DoubleSum{ + DoubleSum: &metricpb.DoubleSum{ + DataPoints: []*metricpb.DoubleDataPoint{ + { + Value: num.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(start), + TimeUnixNano: toNanos(end), + }, + }, }, } default: @@ -360,34 +411,52 @@ func minMaxSumCount(record export.Record, a aggregation.MinMaxSumCount) (*metric return nil, err } - numKind := desc.NumberKind() - return &metricpb.Metric{ - MetricDescriptor: &metricpb.MetricDescriptor{ - Name: desc.Name(), - Description: desc.Description(), - Unit: string(desc.Unit()), - Type: metricpb.MetricDescriptor_SUMMARY, - }, - SummaryDataPoints: []*metricpb.SummaryDataPoint{ - { - Labels: stringKeyValues(labels.Iter()), - Count: uint64(count), - Sum: sum.CoerceToFloat64(numKind), - PercentileValues: []*metricpb.SummaryDataPoint_ValueAtPercentile{ + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + + buckets := []uint64{min.AsRaw(), max.AsRaw()} + bounds := []float64{0.0, 100.0} + + switch n := desc.NumberKind(); n { + case metric.Int64NumberKind: + m.Data = &metricpb.Metric_IntHistogram{ + IntHistogram: &metricpb.IntHistogram{ + DataPoints: []*metricpb.IntHistogramDataPoint{ { - Percentile: 0.0, - Value: min.CoerceToFloat64(numKind), - }, - { - Percentile: 100.0, - Value: max.CoerceToFloat64(numKind), + Sum: sum.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: buckets, + ExplicitBounds: bounds, }, }, - StartTimeUnixNano: toNanos(record.StartTime()), - TimeUnixNano: toNanos(record.EndTime()), }, - }, - }, nil + } + case metric.Float64NumberKind: + m.Data = &metricpb.Metric_DoubleHistogram{ + DoubleHistogram: &metricpb.DoubleHistogram{ + DataPoints: []*metricpb.DoubleHistogramDataPoint{ + { + Sum: sum.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: buckets, + ExplicitBounds: bounds, + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) + } + return m, nil } func histogramValues(a aggregation.Histogram) (boundaries []float64, counts []float64, err error) { @@ -422,33 +491,53 @@ func histogram(record export.Record, a aggregation.Histogram) (*metricpb.Metric, return nil, err } - buckets := make([]*metricpb.HistogramDataPoint_Bucket, len(counts)) + buckets := make([]uint64, len(counts)) for i := 0; i < len(counts); i++ { - buckets[i] = &metricpb.HistogramDataPoint_Bucket{ - Count: uint64(counts[i]), + buckets[i] = uint64(counts[i]) + } + m := &metricpb.Metric{ + Name: desc.Name(), + Description: desc.Description(), + Unit: string(desc.Unit()), + } + switch n := desc.NumberKind(); n { + case metric.Int64NumberKind: + m.Data = &metricpb.Metric_IntHistogram{ + IntHistogram: &metricpb.IntHistogram{ + DataPoints: []*metricpb.IntHistogramDataPoint{ + { + Sum: sum.CoerceToInt64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: buckets, + ExplicitBounds: boundaries, + }, + }, + }, } + case metric.Float64NumberKind: + m.Data = &metricpb.Metric_DoubleHistogram{ + DoubleHistogram: &metricpb.DoubleHistogram{ + DataPoints: []*metricpb.DoubleHistogramDataPoint{ + { + Sum: sum.CoerceToFloat64(n), + Labels: stringKeyValues(labels.Iter()), + StartTimeUnixNano: toNanos(record.StartTime()), + TimeUnixNano: toNanos(record.EndTime()), + Count: uint64(count), + BucketCounts: buckets, + ExplicitBounds: boundaries, + }, + }, + }, + } + default: + return nil, fmt.Errorf("%w: %v", ErrUnknownValueType, n) } - numKind := desc.NumberKind() - return &metricpb.Metric{ - MetricDescriptor: &metricpb.MetricDescriptor{ - Name: desc.Name(), - Description: desc.Description(), - Unit: string(desc.Unit()), - Type: metricpb.MetricDescriptor_HISTOGRAM, - }, - HistogramDataPoints: []*metricpb.HistogramDataPoint{ - { - Labels: stringKeyValues(labels.Iter()), - StartTimeUnixNano: toNanos(record.StartTime()), - TimeUnixNano: toNanos(record.EndTime()), - Count: uint64(count), - Sum: sum.CoerceToFloat64(numKind), - Buckets: buckets, - ExplicitBounds: boundaries, - }, - }, - }, nil + return m, nil } // stringKeyValues transforms a label iterator into an OTLP StringKeyValues. diff --git a/exporters/otlp/internal/transform/metric_test.go b/exporters/otlp/internal/transform/metric_test.go index aeb994507..4c8efb3a9 100644 --- a/exporters/otlp/internal/transform/metric_test.go +++ b/exporters/otlp/internal/transform/metric_test.go @@ -39,7 +39,6 @@ import ( "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" sumAgg "go.opentelemetry.io/otel/sdk/metric/aggregator/sum" "go.opentelemetry.io/otel/sdk/resource" - "go.opentelemetry.io/otel/unit" ) var ( @@ -117,65 +116,6 @@ func TestMinMaxSumCountValue(t *testing.T) { } } -func TestMinMaxSumCountMetricDescriptor(t *testing.T) { - tests := []struct { - name string - metricKind metric.Kind - description string - unit unit.Unit - numberKind metric.NumberKind - labels []label.KeyValue - expected *metricpb.MetricDescriptor - }{ - { - "mmsc-test-a", - metric.ValueRecorderKind, - "test-a-description", - unit.Dimensionless, - metric.Int64NumberKind, - []label.KeyValue{}, - &metricpb.MetricDescriptor{ - Name: "mmsc-test-a", - Description: "test-a-description", - Unit: "1", - Type: metricpb.MetricDescriptor_SUMMARY, - }, - }, - { - "mmsc-test-b", - metric.CounterKind, // This shouldn't change anything. - "test-b-description", - unit.Bytes, - metric.Float64NumberKind, // This shouldn't change anything. - []label.KeyValue{label.String("A", "1")}, - &metricpb.MetricDescriptor{ - Name: "mmsc-test-b", - Description: "test-b-description", - Unit: "By", - Type: metricpb.MetricDescriptor_SUMMARY, - }, - }, - } - - ctx := context.Background() - mmsc, ckpt := metrictest.Unslice2(minmaxsumcount.New(2, &metric.Descriptor{})) - if !assert.NoError(t, mmsc.Update(ctx, 1, &metric.Descriptor{})) { - return - } - require.NoError(t, mmsc.SynchronizedMove(ckpt, &metric.Descriptor{})) - for _, test := range tests { - desc := metric.NewDescriptor(test.name, test.metricKind, test.numberKind, - metric.WithDescription(test.description), - metric.WithUnit(test.unit)) - labels := label.NewSet(test.labels...) - record := export.NewRecord(&desc, &labels, nil, ckpt.Aggregation(), intervalStart, intervalEnd) - got, err := minMaxSumCount(record, ckpt.(aggregation.MinMaxSumCount)) - if assert.NoError(t, err) { - assert.Equal(t, test.expected, got.MetricDescriptor) - } - } -} - func TestMinMaxSumCountDatapoints(t *testing.T) { desc := metric.NewDescriptor("", metric.ValueRecorderKind, metric.Int64NumberKind) labels := label.NewSet() @@ -184,20 +124,12 @@ func TestMinMaxSumCountDatapoints(t *testing.T) { assert.NoError(t, mmsc.Update(context.Background(), 1, &desc)) assert.NoError(t, mmsc.Update(context.Background(), 10, &desc)) require.NoError(t, mmsc.SynchronizedMove(ckpt, &desc)) - expected := []*metricpb.SummaryDataPoint{ + expected := []*metricpb.IntHistogramDataPoint{ { - Count: 2, - Sum: 11, - PercentileValues: []*metricpb.SummaryDataPoint_ValueAtPercentile{ - { - Percentile: 0.0, - Value: 1, - }, - { - Percentile: 100.0, - Value: 10, - }, - }, + Count: 2, + Sum: 11, + ExplicitBounds: []float64{0.0, 100.0}, + BucketCounts: []uint64{1, 10}, StartTimeUnixNano: uint64(intervalStart.UnixNano()), TimeUnixNano: uint64(intervalEnd.UnixNano()), }, @@ -205,10 +137,11 @@ func TestMinMaxSumCountDatapoints(t *testing.T) { record := export.NewRecord(&desc, &labels, nil, ckpt.Aggregation(), intervalStart, intervalEnd) m, err := minMaxSumCount(record, ckpt.(aggregation.MinMaxSumCount)) if assert.NoError(t, err) { - assert.Equal(t, []*metricpb.Int64DataPoint(nil), m.Int64DataPoints) - assert.Equal(t, []*metricpb.DoubleDataPoint(nil), m.DoubleDataPoints) - assert.Equal(t, []*metricpb.HistogramDataPoint(nil), m.HistogramDataPoints) - assert.Equal(t, expected, m.SummaryDataPoints) + assert.Nil(t, m.GetIntGauge()) + assert.Equal(t, expected, m.GetIntHistogram().DataPoints) + assert.Nil(t, m.GetIntSum()) + assert.Nil(t, m.GetDoubleGauge()) + assert.Nil(t, m.GetDoubleHistogram()) } } @@ -222,62 +155,7 @@ func TestMinMaxSumCountPropagatesErrors(t *testing.T) { assert.Equal(t, aggregation.ErrNoData, err) } -func TestSumMetricDescriptor(t *testing.T) { - tests := []struct { - name string - metricKind metric.Kind - description string - unit unit.Unit - numberKind metric.NumberKind - labels []label.KeyValue - expected *metricpb.MetricDescriptor - }{ - { - "sum-test-a", - metric.CounterKind, - "test-a-description", - unit.Dimensionless, - metric.Int64NumberKind, - []label.KeyValue{}, - &metricpb.MetricDescriptor{ - Name: "sum-test-a", - Description: "test-a-description", - Unit: "1", - Type: metricpb.MetricDescriptor_INT64, - }, - }, - { - "sum-test-b", - metric.ValueObserverKind, // This shouldn't change anything. - "test-b-description", - unit.Milliseconds, - metric.Float64NumberKind, - []label.KeyValue{label.String("A", "1")}, - &metricpb.MetricDescriptor{ - Name: "sum-test-b", - Description: "test-b-description", - Unit: "ms", - Type: metricpb.MetricDescriptor_DOUBLE, - }, - }, - } - - for _, test := range tests { - desc := metric.NewDescriptor(test.name, test.metricKind, test.numberKind, - metric.WithDescription(test.description), - metric.WithUnit(test.unit), - ) - labels := label.NewSet(test.labels...) - emptyAgg := &sumAgg.New(1)[0] - record := export.NewRecord(&desc, &labels, nil, emptyAgg, intervalStart, intervalEnd) - got, err := scalar(record, 0, time.Time{}, time.Time{}) - if assert.NoError(t, err) { - assert.Equal(t, test.expected, got.MetricDescriptor) - } - } -} - -func TestSumInt64DataPoints(t *testing.T) { +func TestSumIntDataPoints(t *testing.T) { desc := metric.NewDescriptor("", metric.ValueRecorderKind, metric.Int64NumberKind) labels := label.NewSet() s, ckpt := metrictest.Unslice2(sumAgg.New(2)) @@ -290,18 +168,19 @@ func TestSumInt64DataPoints(t *testing.T) { require.NoError(t, err) if m, err := scalar(record, value, record.StartTime(), record.EndTime()); assert.NoError(t, err) { - assert.Equal(t, []*metricpb.Int64DataPoint{{ + assert.Nil(t, m.GetIntGauge()) + assert.Nil(t, m.GetIntHistogram()) + assert.Equal(t, []*metricpb.IntDataPoint{{ Value: 1, StartTimeUnixNano: uint64(intervalStart.UnixNano()), TimeUnixNano: uint64(intervalEnd.UnixNano()), - }}, m.Int64DataPoints) - assert.Equal(t, []*metricpb.DoubleDataPoint(nil), m.DoubleDataPoints) - assert.Equal(t, []*metricpb.HistogramDataPoint(nil), m.HistogramDataPoints) - assert.Equal(t, []*metricpb.SummaryDataPoint(nil), m.SummaryDataPoints) + }}, m.GetIntSum().DataPoints) + assert.Nil(t, m.GetDoubleGauge()) + assert.Nil(t, m.GetDoubleHistogram()) } } -func TestSumFloat64DataPoints(t *testing.T) { +func TestSumFloatDataPoints(t *testing.T) { desc := metric.NewDescriptor("", metric.ValueRecorderKind, metric.Float64NumberKind) labels := label.NewSet() s, ckpt := metrictest.Unslice2(sumAgg.New(2)) @@ -314,18 +193,20 @@ func TestSumFloat64DataPoints(t *testing.T) { require.NoError(t, err) if m, err := scalar(record, value, record.StartTime(), record.EndTime()); assert.NoError(t, err) { - assert.Equal(t, []*metricpb.Int64DataPoint(nil), m.Int64DataPoints) + assert.Nil(t, m.GetIntGauge()) + assert.Nil(t, m.GetIntHistogram()) + assert.Nil(t, m.GetIntSum()) + assert.Nil(t, m.GetDoubleGauge()) + assert.Nil(t, m.GetDoubleHistogram()) assert.Equal(t, []*metricpb.DoubleDataPoint{{ Value: 1, StartTimeUnixNano: uint64(intervalStart.UnixNano()), TimeUnixNano: uint64(intervalEnd.UnixNano()), - }}, m.DoubleDataPoints) - assert.Equal(t, []*metricpb.HistogramDataPoint(nil), m.HistogramDataPoints) - assert.Equal(t, []*metricpb.SummaryDataPoint(nil), m.SummaryDataPoints) + }}, m.GetDoubleSum().DataPoints) } } -func TestLastValueInt64DataPoints(t *testing.T) { +func TestLastValueIntDataPoints(t *testing.T) { desc := metric.NewDescriptor("", metric.ValueRecorderKind, metric.Int64NumberKind) labels := label.NewSet() s, ckpt := metrictest.Unslice2(lvAgg.New(2)) @@ -337,15 +218,17 @@ func TestLastValueInt64DataPoints(t *testing.T) { value, timestamp, err := sum.LastValue() require.NoError(t, err) - if m, err := scalar(record, value, time.Time{}, timestamp); assert.NoError(t, err) { - assert.Equal(t, []*metricpb.Int64DataPoint{{ + if m, err := gauge(record, value, time.Time{}, timestamp); assert.NoError(t, err) { + assert.Equal(t, []*metricpb.IntDataPoint{{ Value: 100, StartTimeUnixNano: 0, TimeUnixNano: uint64(timestamp.UnixNano()), - }}, m.Int64DataPoints) - assert.Equal(t, []*metricpb.DoubleDataPoint(nil), m.DoubleDataPoints) - assert.Equal(t, []*metricpb.HistogramDataPoint(nil), m.HistogramDataPoints) - assert.Equal(t, []*metricpb.SummaryDataPoint(nil), m.SummaryDataPoints) + }}, m.GetIntGauge().DataPoints) + assert.Nil(t, m.GetIntHistogram()) + assert.Nil(t, m.GetIntSum()) + assert.Nil(t, m.GetDoubleGauge()) + assert.Nil(t, m.GetDoubleHistogram()) + assert.Nil(t, m.GetDoubleSum()) } } diff --git a/exporters/otlp/internal/transform/span.go b/exporters/otlp/internal/transform/span.go index b728a0cd9..8066f2d2d 100644 --- a/exporters/otlp/internal/transform/span.go +++ b/exporters/otlp/internal/transform/span.go @@ -129,9 +129,9 @@ func status(status codes.Code, message string) *tracepb.Status { var c tracepb.Status_StatusCode switch status { case codes.Error: - c = tracepb.Status_UnknownError + c = tracepb.Status_STATUS_CODE_UNKNOWN_ERROR default: - c = tracepb.Status_Ok + c = tracepb.Status_STATUS_CODE_OK } return &tracepb.Status{ Code: c, @@ -196,15 +196,15 @@ func spanEvents(es []export.Event) []*tracepb.Span_Event { func spanKind(kind otel.SpanKind) tracepb.Span_SpanKind { switch kind { case otel.SpanKindInternal: - return tracepb.Span_INTERNAL + return tracepb.Span_SPAN_KIND_INTERNAL case otel.SpanKindClient: - return tracepb.Span_CLIENT + return tracepb.Span_SPAN_KIND_CLIENT case otel.SpanKindServer: - return tracepb.Span_SERVER + return tracepb.Span_SPAN_KIND_SERVER case otel.SpanKindProducer: - return tracepb.Span_PRODUCER + return tracepb.Span_SPAN_KIND_PRODUCER case otel.SpanKindConsumer: - return tracepb.Span_CONSUMER + return tracepb.Span_SPAN_KIND_CONSUMER default: return tracepb.Span_SPAN_KIND_UNSPECIFIED } diff --git a/exporters/otlp/internal/transform/span_test.go b/exporters/otlp/internal/transform/span_test.go index d915923a9..9612345e5 100644 --- a/exporters/otlp/internal/transform/span_test.go +++ b/exporters/otlp/internal/transform/span_test.go @@ -41,23 +41,23 @@ func TestSpanKind(t *testing.T) { }{ { otel.SpanKindInternal, - tracepb.Span_INTERNAL, + tracepb.Span_SPAN_KIND_INTERNAL, }, { otel.SpanKindClient, - tracepb.Span_CLIENT, + tracepb.Span_SPAN_KIND_CLIENT, }, { otel.SpanKindServer, - tracepb.Span_SERVER, + tracepb.Span_SPAN_KIND_SERVER, }, { otel.SpanKindProducer, - tracepb.Span_PRODUCER, + tracepb.Span_SPAN_KIND_PRODUCER, }, { otel.SpanKindConsumer, - tracepb.Span_CONSUMER, + tracepb.Span_SPAN_KIND_CONSUMER, }, { otel.SpanKind(-1), @@ -162,17 +162,17 @@ func TestStatus(t *testing.T) { { codes.Ok, "test Ok", - tracepb.Status_Ok, + tracepb.Status_STATUS_CODE_OK, }, { codes.Unset, "test Unset", - tracepb.Status_Ok, + tracepb.Status_STATUS_CODE_OK, }, { codes.Error, "test Error", - tracepb.Status_UnknownError, + tracepb.Status_STATUS_CODE_UNKNOWN_ERROR, }, } { expected := &tracepb.Status{Code: test.otlpStatus, Message: test.message} @@ -267,7 +267,7 @@ func TestSpanData(t *testing.T) { SpanId: []byte{0xFF, 0xFE, 0xFD, 0xFC, 0xFB, 0xFA, 0xF9, 0xF8}, ParentSpanId: []byte{0xEF, 0xEE, 0xED, 0xEC, 0xEB, 0xEA, 0xE9, 0xE8}, Name: spanData.Name, - Kind: tracepb.Span_SERVER, + Kind: tracepb.Span_SPAN_KIND_SERVER, StartTimeUnixNano: uint64(startTime.UnixNano()), EndTimeUnixNano: uint64(endTime.UnixNano()), Status: status(spanData.StatusCode, spanData.StatusMessage), diff --git a/exporters/otlp/otlp_integration_test.go b/exporters/otlp/otlp_integration_test.go index 25b2a206b..423c1e2e8 100644 --- a/exporters/otlp/otlp_integration_test.go +++ b/exporters/otlp/otlp_integration_test.go @@ -26,7 +26,6 @@ import ( "github.com/stretchr/testify/require" commonpb "go.opentelemetry.io/otel/exporters/otlp/internal/opentelemetry-proto-gen/common/v1" - metricpb "go.opentelemetry.io/otel/exporters/otlp/internal/opentelemetry-proto-gen/metrics/v1" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/api/metric" @@ -238,37 +237,58 @@ func newExporterEndToEndTest(t *testing.T, additionalOpts []otlp.ExporterOption) assert.Len(t, metrics, len(instruments), "not enough metrics exported") seen := make(map[string]struct{}, len(instruments)) for _, m := range metrics { - desc := m.GetMetricDescriptor() - data, ok := instruments[desc.Name] + data, ok := instruments[m.Name] if !ok { - assert.Failf(t, "unknown metrics", desc.Name) + assert.Failf(t, "unknown metrics", m.Name) continue } - seen[desc.Name] = struct{}{} + seen[m.Name] = struct{}{} switch data.iKind { - case metric.CounterKind, metric.ValueObserverKind: + case metric.CounterKind: switch data.nKind { case metricapi.Int64NumberKind: - assert.Equal(t, metricpb.MetricDescriptor_INT64.String(), desc.GetType().String()) - if dp := m.GetInt64DataPoints(); assert.Len(t, dp, 1) { - assert.Equal(t, data.val, dp[0].Value, "invalid value for %q", desc.Name) + if dp := m.GetIntSum().DataPoints; assert.Len(t, dp, 1) { + assert.Equal(t, data.val, dp[0].Value, "invalid value for %q", m.Name) } case metricapi.Float64NumberKind: - assert.Equal(t, metricpb.MetricDescriptor_DOUBLE.String(), desc.GetType().String()) - if dp := m.GetDoubleDataPoints(); assert.Len(t, dp, 1) { - assert.Equal(t, float64(data.val), dp[0].Value, "invalid value for %q", desc.Name) + if dp := m.GetDoubleSum().DataPoints; assert.Len(t, dp, 1) { + assert.Equal(t, float64(data.val), dp[0].Value, "invalid value for %q", m.Name) + } + default: + assert.Failf(t, "invalid number kind", data.nKind.String()) + } + case metric.ValueObserverKind: + switch data.nKind { + case metricapi.Int64NumberKind: + if dp := m.GetIntGauge().DataPoints; assert.Len(t, dp, 1) { + assert.Equal(t, data.val, dp[0].Value, "invalid value for %q", m.Name) + } + case metricapi.Float64NumberKind: + if dp := m.GetDoubleGauge().DataPoints; assert.Len(t, dp, 1) { + assert.Equal(t, float64(data.val), dp[0].Value, "invalid value for %q", m.Name) } default: assert.Failf(t, "invalid number kind", data.nKind.String()) } case metric.ValueRecorderKind: - assert.Equal(t, metricpb.MetricDescriptor_SUMMARY.String(), desc.GetType().String()) - m.GetSummaryDataPoints() - if dp := m.GetSummaryDataPoints(); assert.Len(t, dp, 1) { - count := dp[0].Count - assert.Equal(t, uint64(1), count, "invalid count for %q", desc.Name) - assert.Equal(t, float64(data.val*int64(count)), dp[0].Sum, "invalid sum for %q (value %d)", desc.Name, data.val) + switch data.nKind { + case metricapi.Int64NumberKind: + assert.NotNil(t, m.GetIntHistogram()) + if dp := m.GetIntHistogram().DataPoints; assert.Len(t, dp, 1) { + count := dp[0].Count + assert.Equal(t, uint64(1), count, "invalid count for %q", m.Name) + assert.Equal(t, int64(data.val*int64(count)), dp[0].Sum, "invalid sum for %q (value %d)", m.Name, data.val) + } + case metricapi.Float64NumberKind: + assert.NotNil(t, m.GetDoubleHistogram()) + if dp := m.GetDoubleHistogram().DataPoints; assert.Len(t, dp, 1) { + count := dp[0].Count + assert.Equal(t, uint64(1), count, "invalid count for %q", m.Name) + assert.Equal(t, float64(data.val*int64(count)), dp[0].Sum, "invalid sum for %q (value %d)", m.Name, data.val) + } + default: + assert.Failf(t, "invalid number kind", data.nKind.String()) } default: assert.Failf(t, "invalid metrics kind", data.iKind.String()) diff --git a/exporters/otlp/otlp_metric_test.go b/exporters/otlp/otlp_metric_test.go index 3c9415e36..7ee044385 100644 --- a/exporters/otlp/otlp_metric_test.go +++ b/exporters/otlp/otlp_metric_test.go @@ -109,11 +109,6 @@ var ( testHistogramBoundaries = []float64{2.0, 4.0, 8.0} - md = &metricpb.MetricDescriptor{ - Name: "int64-count", - Type: metricpb.MetricDescriptor_INT64, - } - cpu1Labels = []*commonpb.StringKeyValue{ { Key: "CPU", @@ -189,19 +184,25 @@ func TestNoGroupingExport(t *testing.T) { { Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: cpu2Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + { + Value: 11, + Labels: cpu2Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -229,50 +230,48 @@ func TestValuerecorderMetricGroupingExport(t *testing.T) { { Metrics: []*metricpb.Metric{ { - MetricDescriptor: &metricpb.MetricDescriptor{ - Name: "valuerecorder", - Type: metricpb.MetricDescriptor_HISTOGRAM, - }, - HistogramDataPoints: []*metricpb.HistogramDataPoint{ - { - Labels: []*commonpb.StringKeyValue{ + Name: "valuerecorder", + Data: &metricpb.Metric_IntHistogram{ + IntHistogram: &metricpb.IntHistogram{ + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntHistogramDataPoint{ { - Key: "CPU", - Value: "1", + Labels: []*commonpb.StringKeyValue{ + { + Key: "CPU", + Value: "1", + }, + { + Key: "host", + Value: "test.com", + }, + }, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + Count: 2, + Sum: 11, + ExplicitBounds: testHistogramBoundaries, + BucketCounts: []uint64{1, 0, 0, 1}, }, { - Key: "host", - Value: "test.com", + Labels: []*commonpb.StringKeyValue{ + { + Key: "CPU", + Value: "1", + }, + { + Key: "host", + Value: "test.com", + }, + }, + Count: 2, + Sum: 11, + ExplicitBounds: testHistogramBoundaries, + BucketCounts: []uint64{1, 0, 0, 1}, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), }, }, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - Count: 2, - Sum: 11, - ExplicitBounds: testHistogramBoundaries, - Buckets: []*metricpb.HistogramDataPoint_Bucket{ - {Count: 1}, {Count: 0}, {Count: 0}, {Count: 1}, - }, - }, - { - Labels: []*commonpb.StringKeyValue{ - { - Key: "CPU", - Value: "1", - }, - { - Key: "host", - Value: "test.com", - }, - }, - Count: 2, - Sum: 11, - ExplicitBounds: testHistogramBoundaries, - Buckets: []*metricpb.HistogramDataPoint_Bucket{ - {Count: 1}, {Count: 0}, {Count: 0}, {Count: 1}, - }, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), }, }, }, @@ -282,9 +281,6 @@ func TestValuerecorderMetricGroupingExport(t *testing.T) { }, } runMetricExportTests(t, []record{r, r}, expected) - //changing the number kind should make no difference. - r.nKind = metric.Float64NumberKind - runMetricExportTests(t, []record{r, r}, expected) } func TestCountInt64MetricGroupingExport(t *testing.T) { @@ -306,19 +302,25 @@ func TestCountInt64MetricGroupingExport(t *testing.T) { { Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -349,40 +351,43 @@ func TestCountFloat64MetricGroupingExport(t *testing.T) { { Metrics: []*metricpb.Metric{ { - MetricDescriptor: &metricpb.MetricDescriptor{ - Name: "float64-count", - Type: metricpb.MetricDescriptor_DOUBLE, - }, - DoubleDataPoints: []*metricpb.DoubleDataPoint{ - { - Value: 11, - Labels: []*commonpb.StringKeyValue{ + Name: "float64-count", + Data: &metricpb.Metric_DoubleSum{ + DoubleSum: &metricpb.DoubleSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.DoubleDataPoint{ { - Key: "CPU", - Value: "1", + Value: 11, + Labels: []*commonpb.StringKeyValue{ + { + Key: "CPU", + Value: "1", + }, + { + Key: "host", + Value: "test.com", + }, + }, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), }, { - Key: "host", - Value: "test.com", + Value: 11, + Labels: []*commonpb.StringKeyValue{ + { + Key: "CPU", + Value: "1", + }, + { + Key: "host", + Value: "test.com", + }, + }, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), }, }, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: []*commonpb.StringKeyValue{ - { - Key: "CPU", - Value: "1", - }, - { - Key: "host", - Value: "test.com", - }, - }, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), }, }, }, @@ -438,25 +443,31 @@ func TestResourceMetricGroupingExport(t *testing.T) { { Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: cpu2Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + { + Value: 11, + Labels: cpu2Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -470,13 +481,19 @@ func TestResourceMetricGroupingExport(t *testing.T) { { Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -563,25 +580,31 @@ func TestResourceInstLibMetricGroupingExport(t *testing.T) { }, Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), - }, - { - Value: 11, - Labels: cpu2Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + { + Value: 11, + Labels: cpu2Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -594,13 +617,19 @@ func TestResourceInstLibMetricGroupingExport(t *testing.T) { }, Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -612,13 +641,19 @@ func TestResourceInstLibMetricGroupingExport(t *testing.T) { }, Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -636,13 +671,19 @@ func TestResourceInstLibMetricGroupingExport(t *testing.T) { }, Metrics: []*metricpb.Metric{ { - MetricDescriptor: md, - Int64DataPoints: []*metricpb.Int64DataPoint{ - { - Value: 11, - Labels: cpu1Labels, - StartTimeUnixNano: startTime(), - TimeUnixNano: pointTime(), + Name: "int64-count", + Data: &metricpb.Metric_IntSum{ + IntSum: &metricpb.IntSum{ + IsMonotonic: true, + AggregationTemporality: metricpb.AggregationTemporality_AGGREGATION_TEMPORALITY_CUMULATIVE, + DataPoints: []*metricpb.IntDataPoint{ + { + Value: 11, + Labels: cpu1Labels, + StartTimeUnixNano: startTime(), + TimeUnixNano: pointTime(), + }, + }, }, }, }, @@ -739,14 +780,25 @@ func runMetricExportTest(t *testing.T, exp *Exporter, rs []record, expected []me continue } for i, expected := range ilm.GetMetrics() { - assert.Equal(t, expected.GetMetricDescriptor(), g[i].GetMetricDescriptor()) - // Compare each list directly because there is no order - // guarantee with the concurrent processing design of the exporter - // and ElementsMatch does not apply to contained slices. - assert.ElementsMatch(t, expected.GetInt64DataPoints(), g[i].GetInt64DataPoints()) - assert.ElementsMatch(t, expected.GetDoubleDataPoints(), g[i].GetDoubleDataPoints()) - assert.ElementsMatch(t, expected.GetHistogramDataPoints(), g[i].GetHistogramDataPoints()) - assert.ElementsMatch(t, expected.GetSummaryDataPoints(), g[i].GetSummaryDataPoints()) + assert.Equal(t, expected.Name, g[i].Name) + assert.Equal(t, expected.Unit, g[i].Unit) + assert.Equal(t, expected.Description, g[i].Description) + switch g[i].Data.(type) { + case *metricpb.Metric_IntGauge: + assert.ElementsMatch(t, expected.GetIntGauge().DataPoints, g[i].GetIntGauge().DataPoints) + case *metricpb.Metric_IntHistogram: + assert.ElementsMatch(t, expected.GetIntHistogram().DataPoints, g[i].GetIntHistogram().DataPoints) + case *metricpb.Metric_IntSum: + assert.ElementsMatch(t, expected.GetIntSum().DataPoints, g[i].GetIntSum().DataPoints) + case *metricpb.Metric_DoubleGauge: + assert.ElementsMatch(t, expected.GetDoubleGauge().DataPoints, g[i].GetDoubleGauge().DataPoints) + case *metricpb.Metric_DoubleHistogram: + assert.ElementsMatch(t, expected.GetDoubleHistogram().DataPoints, g[i].GetDoubleHistogram().DataPoints) + case *metricpb.Metric_DoubleSum: + assert.ElementsMatch(t, expected.GetDoubleSum().DataPoints, g[i].GetDoubleSum().DataPoints) + default: + assert.Failf(t, "unknown data type", g[i].Name) + } } } } diff --git a/exporters/otlp/otlp_span_test.go b/exporters/otlp/otlp_span_test.go index 41dfafdbf..eb6ee72b4 100644 --- a/exporters/otlp/otlp_span_test.go +++ b/exporters/otlp/otlp_span_test.go @@ -196,7 +196,7 @@ func TestExportSpans(t *testing.T) { TraceId: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, SpanId: []byte{0, 0, 0, 0, 0, 0, 0, 1}, Name: "parent process", - Kind: tracepb.Span_SERVER, + Kind: tracepb.Span_SPAN_KIND_SERVER, StartTimeUnixNano: uint64(startTime.UnixNano()), EndTimeUnixNano: uint64(endTime.UnixNano()), Attributes: []*commonpb.KeyValue{ @@ -218,7 +218,7 @@ func TestExportSpans(t *testing.T) { }, }, Status: &tracepb.Status{ - Code: tracepb.Status_Ok, + Code: tracepb.Status_STATUS_CODE_OK, Message: "Ok", }, }, @@ -227,7 +227,7 @@ func TestExportSpans(t *testing.T) { SpanId: []byte{0, 0, 0, 0, 0, 0, 0, 2}, ParentSpanId: []byte{0, 0, 0, 0, 0, 0, 0, 1}, Name: "internal process", - Kind: tracepb.Span_INTERNAL, + Kind: tracepb.Span_SPAN_KIND_INTERNAL, StartTimeUnixNano: uint64(startTime.UnixNano()), EndTimeUnixNano: uint64(endTime.UnixNano()), Attributes: []*commonpb.KeyValue{ @@ -249,7 +249,7 @@ func TestExportSpans(t *testing.T) { }, }, Status: &tracepb.Status{ - Code: tracepb.Status_Ok, + Code: tracepb.Status_STATUS_CODE_OK, Message: "Ok", }, }, @@ -265,7 +265,7 @@ func TestExportSpans(t *testing.T) { TraceId: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}, SpanId: []byte{0, 0, 0, 0, 0, 0, 0, 1}, Name: "secondary parent process", - Kind: tracepb.Span_SERVER, + Kind: tracepb.Span_SPAN_KIND_SERVER, StartTimeUnixNano: uint64(startTime.UnixNano()), EndTimeUnixNano: uint64(endTime.UnixNano()), Attributes: []*commonpb.KeyValue{ @@ -287,7 +287,7 @@ func TestExportSpans(t *testing.T) { }, }, Status: &tracepb.Status{ - Code: tracepb.Status_Ok, + Code: tracepb.Status_STATUS_CODE_OK, Message: "Ok", }, }, @@ -319,7 +319,7 @@ func TestExportSpans(t *testing.T) { TraceId: []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2}, SpanId: []byte{0, 0, 0, 0, 0, 0, 0, 1}, Name: "parent process", - Kind: tracepb.Span_SERVER, + Kind: tracepb.Span_SPAN_KIND_SERVER, StartTimeUnixNano: uint64(startTime.UnixNano()), EndTimeUnixNano: uint64(endTime.UnixNano()), Attributes: []*commonpb.KeyValue{ @@ -341,7 +341,7 @@ func TestExportSpans(t *testing.T) { }, }, Status: &tracepb.Status{ - Code: tracepb.Status_UnknownError, + Code: tracepb.Status_STATUS_CODE_UNKNOWN_ERROR, Message: "Unauthenticated", }, },