From a9c04f85197921e4d20d678b0ad14e26f411f348 Mon Sep 17 00:00:00 2001 From: Aaron Abbott Date: Wed, 19 Jan 2022 20:38:32 +0000 Subject: [PATCH] Normalize unreproducible ocgrpc self-obs metrics in test fixtures --- .../cmd/recordfixtures/main.go | 4 +- .../internal/integrationtest/fixtures.pb.go | 312 +++++++++++++-- .../internal/integrationtest/fixtures.proto | 27 +- .../integrationtest/inmemoryocexporter.go | 68 +++- .../internal/integrationtest/metrics_test.go | 5 +- .../internal/integrationtest/testcase.go | 32 ++ .../basic_counter_metrics_expect.json | 369 +++++++++++++++++- ...ate_service_timeseries_metrics_expect.json | 186 ++++++++- .../delta_counter_metrics_expect.json | 369 +++++++++++++++++- .../exponential_histogram_metrics_expect.json | 369 +++++++++++++++++- ...ol_plane_metrics_agent_metrics_expect.json | 186 ++++++++- .../gke_metrics_agent_metrics_expect.json | 186 ++++++++- .../nonmonotonic_counter_metrics_expect.json | 369 +++++++++++++++++- .../ops_agent_host_metrics_expect.json | 186 ++++++++- .../ops_agent_self_metrics_expect.json | 186 ++++++++- .../fixtures/summary_metrics_expect.json | 369 +++++++++++++++++- .../unknown_domain_metrics_expect.json | 369 +++++++++++++++++- ...kloadgoogleapis_prefix_metrics_expect.json | 369 +++++++++++++++++- 18 files changed, 3894 insertions(+), 67 deletions(-) diff --git a/exporter/collector/internal/integrationtest/cmd/recordfixtures/main.go b/exporter/collector/internal/integrationtest/cmd/recordfixtures/main.go index 1f6fee014..43f4a6f56 100644 --- a/exporter/collector/internal/integrationtest/cmd/recordfixtures/main.go +++ b/exporter/collector/internal/integrationtest/cmd/recordfixtures/main.go @@ -71,11 +71,13 @@ func main() { require.NoError(t, testServerExporter.PushMetrics(ctx, metrics), "failed to export metrics to local test server") require.NoError(t, testServerExporter.Shutdown(ctx)) + selfObsMetrics, err := inMemoryOCExporter.Proto(ctx) + require.NoError(t, err) fixture := &integrationtest.MetricExpectFixture{ CreateMetricDescriptorRequests: testServer.CreateMetricDescriptorRequests(), CreateTimeSeriesRequests: testServer.CreateTimeSeriesRequests(), CreateServiceTimeSeriesRequests: testServer.CreateServiceTimeSeriesRequests(), - SelfObservabilityMetrics: inMemoryOCExporter.Proto(), + SelfObservabilityMetrics: selfObsMetrics, } test.SaveRecordedFixtures(t, fixture) }() diff --git a/exporter/collector/internal/integrationtest/fixtures.pb.go b/exporter/collector/internal/integrationtest/fixtures.pb.go index 7832f356d..1017eacf3 100644 --- a/exporter/collector/internal/integrationtest/fixtures.pb.go +++ b/exporter/collector/internal/integrationtest/fixtures.pb.go @@ -35,6 +35,60 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// Copied from +// https://github.com/googleapis/googleapis/blob/ab1bf9a5cef888843afb9ef3b70b79587d9a033b/google/api/metric.proto +type SelfObservabilityMetric_MetricKind int32 + +const ( + SelfObservabilityMetric_METRIC_KIND_UNSPECIFIED SelfObservabilityMetric_MetricKind = 0 + SelfObservabilityMetric_GAUGE SelfObservabilityMetric_MetricKind = 1 + SelfObservabilityMetric_DELTA SelfObservabilityMetric_MetricKind = 2 + SelfObservabilityMetric_CUMULATIVE SelfObservabilityMetric_MetricKind = 3 +) + +// Enum value maps for SelfObservabilityMetric_MetricKind. +var ( + SelfObservabilityMetric_MetricKind_name = map[int32]string{ + 0: "METRIC_KIND_UNSPECIFIED", + 1: "GAUGE", + 2: "DELTA", + 3: "CUMULATIVE", + } + SelfObservabilityMetric_MetricKind_value = map[string]int32{ + "METRIC_KIND_UNSPECIFIED": 0, + "GAUGE": 1, + "DELTA": 2, + "CUMULATIVE": 3, + } +) + +func (x SelfObservabilityMetric_MetricKind) Enum() *SelfObservabilityMetric_MetricKind { + p := new(SelfObservabilityMetric_MetricKind) + *p = x + return p +} + +func (x SelfObservabilityMetric_MetricKind) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (SelfObservabilityMetric_MetricKind) Descriptor() protoreflect.EnumDescriptor { + return file_fixtures_proto_enumTypes[0].Descriptor() +} + +func (SelfObservabilityMetric_MetricKind) Type() protoreflect.EnumType { + return &file_fixtures_proto_enumTypes[0] +} + +func (x SelfObservabilityMetric_MetricKind) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use SelfObservabilityMetric_MetricKind.Descriptor instead. +func (SelfObservabilityMetric_MetricKind) EnumDescriptor() ([]byte, []int) { + return file_fixtures_proto_rawDescGZIP(), []int{1, 0} +} + type MetricExpectFixture struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -113,8 +167,13 @@ type SelfObservabilityMetric struct { // metric name Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // stringified value - Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"` + // The GCM MetricKind that the metric would create + MetricKind SelfObservabilityMetric_MetricKind `protobuf:"varint,2,opt,name=metric_kind,json=metricKind,proto3,enum=fixtures.SelfObservabilityMetric_MetricKind" json:"metric_kind,omitempty"` + // Types that are assignable to Value: + // *SelfObservabilityMetric_Int64Value + // *SelfObservabilityMetric_Float64Value + // *SelfObservabilityMetric_HistogramValue + Value isSelfObservabilityMetric_Value `protobuf_oneof:"value"` // stringified labels Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } @@ -158,11 +217,39 @@ func (x *SelfObservabilityMetric) GetName() string { return "" } -func (x *SelfObservabilityMetric) GetVal() string { +func (x *SelfObservabilityMetric) GetMetricKind() SelfObservabilityMetric_MetricKind { if x != nil { - return x.Val + return x.MetricKind } - return "" + return SelfObservabilityMetric_METRIC_KIND_UNSPECIFIED +} + +func (m *SelfObservabilityMetric) GetValue() isSelfObservabilityMetric_Value { + if m != nil { + return m.Value + } + return nil +} + +func (x *SelfObservabilityMetric) GetInt64Value() int64 { + if x, ok := x.GetValue().(*SelfObservabilityMetric_Int64Value); ok { + return x.Int64Value + } + return 0 +} + +func (x *SelfObservabilityMetric) GetFloat64Value() float64 { + if x, ok := x.GetValue().(*SelfObservabilityMetric_Float64Value); ok { + return x.Float64Value + } + return 0 +} + +func (x *SelfObservabilityMetric) GetHistogramValue() *SelfObservabilityMetric_Histogram { + if x, ok := x.GetValue().(*SelfObservabilityMetric_HistogramValue); ok { + return x.HistogramValue + } + return nil } func (x *SelfObservabilityMetric) GetLabels() map[string]string { @@ -172,6 +259,100 @@ func (x *SelfObservabilityMetric) GetLabels() map[string]string { return nil } +type isSelfObservabilityMetric_Value interface { + isSelfObservabilityMetric_Value() +} + +type SelfObservabilityMetric_Int64Value struct { + Int64Value int64 `protobuf:"varint,5,opt,name=int64_value,json=int64Value,proto3,oneof"` +} + +type SelfObservabilityMetric_Float64Value struct { + Float64Value float64 `protobuf:"fixed64,6,opt,name=float64_value,json=float64Value,proto3,oneof"` +} + +type SelfObservabilityMetric_HistogramValue struct { + HistogramValue *SelfObservabilityMetric_Histogram `protobuf:"bytes,7,opt,name=histogram_value,json=histogramValue,proto3,oneof"` +} + +func (*SelfObservabilityMetric_Int64Value) isSelfObservabilityMetric_Value() {} + +func (*SelfObservabilityMetric_Float64Value) isSelfObservabilityMetric_Value() {} + +func (*SelfObservabilityMetric_HistogramValue) isSelfObservabilityMetric_Value() {} + +// A slimmed down explicit bucketed histogram +type SelfObservabilityMetric_Histogram struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Sum float64 `protobuf:"fixed64,1,opt,name=sum,proto3" json:"sum,omitempty"` + Count int64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"` + BucketBounds []float64 `protobuf:"fixed64,3,rep,packed,name=bucket_bounds,json=bucketBounds,proto3" json:"bucket_bounds,omitempty"` + BucketCounts []int64 `protobuf:"varint,4,rep,packed,name=bucket_counts,json=bucketCounts,proto3" json:"bucket_counts,omitempty"` +} + +func (x *SelfObservabilityMetric_Histogram) Reset() { + *x = SelfObservabilityMetric_Histogram{} + if protoimpl.UnsafeEnabled { + mi := &file_fixtures_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SelfObservabilityMetric_Histogram) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SelfObservabilityMetric_Histogram) ProtoMessage() {} + +func (x *SelfObservabilityMetric_Histogram) ProtoReflect() protoreflect.Message { + mi := &file_fixtures_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SelfObservabilityMetric_Histogram.ProtoReflect.Descriptor instead. +func (*SelfObservabilityMetric_Histogram) Descriptor() ([]byte, []int) { + return file_fixtures_proto_rawDescGZIP(), []int{1, 0} +} + +func (x *SelfObservabilityMetric_Histogram) GetSum() float64 { + if x != nil { + return x.Sum + } + return 0 +} + +func (x *SelfObservabilityMetric_Histogram) GetCount() int64 { + if x != nil { + return x.Count + } + return 0 +} + +func (x *SelfObservabilityMetric_Histogram) GetBucketBounds() []float64 { + if x != nil { + return x.BucketBounds + } + return nil +} + +func (x *SelfObservabilityMetric_Histogram) GetBucketCounts() []int64 { + if x != nil { + return x.BucketCounts + } + return nil +} + var File_fixtures_proto protoreflect.FileDescriptor var file_fixtures_proto_rawDesc = []byte{ @@ -208,26 +389,54 @@ var file_fixtures_proto_rawDesc = []byte{ 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x18, 0x73, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x74, - 0x72, 0x69, 0x63, 0x73, 0x22, 0xc1, 0x01, 0x0a, 0x17, 0x53, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, + 0x72, 0x69, 0x63, 0x73, 0x22, 0xf9, 0x04, 0x0a, 0x17, 0x53, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x76, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x76, 0x61, 0x6c, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x4d, 0x0a, 0x0b, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x5f, 0x6b, + 0x69, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2c, 0x2e, 0x66, 0x69, 0x78, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, + 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x4d, 0x65, 0x74, + 0x72, 0x69, 0x63, 0x4b, 0x69, 0x6e, 0x64, 0x52, 0x0a, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x4b, + 0x69, 0x6e, 0x64, 0x12, 0x21, 0x0a, 0x0b, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x69, 0x6e, 0x74, 0x36, + 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x25, 0x0a, 0x0d, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x36, + 0x34, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x48, 0x00, 0x52, + 0x0c, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x36, 0x34, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x56, 0x0a, + 0x0f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x66, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, - 0x69, 0x74, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x39, 0x0a, - 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, - 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, - 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x68, 0x5a, 0x66, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x6c, 0x6f, - 0x75, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, - 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, 0x2d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, - 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x65, - 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x74, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, + 0x72, 0x61, 0x6d, 0x48, 0x00, 0x52, 0x0e, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x66, 0x69, 0x78, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2e, 0x53, 0x65, 0x6c, 0x66, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x62, 0x69, 0x6c, 0x69, + 0x74, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x7d, 0x0a, 0x09, + 0x48, 0x69, 0x73, 0x74, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x75, 0x6d, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x73, 0x75, 0x6d, 0x12, 0x14, 0x0a, 0x05, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x62, 0x6f, 0x75, 0x6e, + 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x01, 0x52, 0x0c, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0c, 0x62, + 0x75, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x1a, 0x39, 0x0a, 0x0b, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4f, 0x0a, 0x0a, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, + 0x4b, 0x69, 0x6e, 0x64, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x4b, + 0x49, 0x4e, 0x44, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, + 0x44, 0x45, 0x4c, 0x54, 0x41, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x55, 0x4d, 0x55, 0x4c, + 0x41, 0x54, 0x49, 0x56, 0x45, 0x10, 0x03, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x42, 0x68, 0x5a, 0x66, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x47, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x74, 0x65, 0x6c, 0x65, 0x6d, 0x65, 0x74, 0x72, 0x79, + 0x2d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2d, 0x67, 0x6f, 0x2f, 0x65, + 0x78, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x72, 0x2f, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, + 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -242,25 +451,30 @@ func file_fixtures_proto_rawDescGZIP() []byte { return file_fixtures_proto_rawDescData } -var file_fixtures_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_fixtures_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_fixtures_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_fixtures_proto_goTypes = []interface{}{ - (*MetricExpectFixture)(nil), // 0: fixtures.MetricExpectFixture - (*SelfObservabilityMetric)(nil), // 1: fixtures.SelfObservabilityMetric - nil, // 2: fixtures.SelfObservabilityMetric.LabelsEntry - (*v3.CreateTimeSeriesRequest)(nil), // 3: google.monitoring.v3.CreateTimeSeriesRequest - (*v3.CreateMetricDescriptorRequest)(nil), // 4: google.monitoring.v3.CreateMetricDescriptorRequest + (SelfObservabilityMetric_MetricKind)(0), // 0: fixtures.SelfObservabilityMetric.MetricKind + (*MetricExpectFixture)(nil), // 1: fixtures.MetricExpectFixture + (*SelfObservabilityMetric)(nil), // 2: fixtures.SelfObservabilityMetric + (*SelfObservabilityMetric_Histogram)(nil), // 3: fixtures.SelfObservabilityMetric.Histogram + nil, // 4: fixtures.SelfObservabilityMetric.LabelsEntry + (*v3.CreateTimeSeriesRequest)(nil), // 5: google.monitoring.v3.CreateTimeSeriesRequest + (*v3.CreateMetricDescriptorRequest)(nil), // 6: google.monitoring.v3.CreateMetricDescriptorRequest } var file_fixtures_proto_depIdxs = []int32{ - 3, // 0: fixtures.MetricExpectFixture.create_time_series_requests:type_name -> google.monitoring.v3.CreateTimeSeriesRequest - 4, // 1: fixtures.MetricExpectFixture.create_metric_descriptor_requests:type_name -> google.monitoring.v3.CreateMetricDescriptorRequest - 3, // 2: fixtures.MetricExpectFixture.create_service_time_series_requests:type_name -> google.monitoring.v3.CreateTimeSeriesRequest - 1, // 3: fixtures.MetricExpectFixture.self_observability_metrics:type_name -> fixtures.SelfObservabilityMetric - 2, // 4: fixtures.SelfObservabilityMetric.labels:type_name -> fixtures.SelfObservabilityMetric.LabelsEntry - 5, // [5:5] is the sub-list for method output_type - 5, // [5:5] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name + 5, // 0: fixtures.MetricExpectFixture.create_time_series_requests:type_name -> google.monitoring.v3.CreateTimeSeriesRequest + 6, // 1: fixtures.MetricExpectFixture.create_metric_descriptor_requests:type_name -> google.monitoring.v3.CreateMetricDescriptorRequest + 5, // 2: fixtures.MetricExpectFixture.create_service_time_series_requests:type_name -> google.monitoring.v3.CreateTimeSeriesRequest + 2, // 3: fixtures.MetricExpectFixture.self_observability_metrics:type_name -> fixtures.SelfObservabilityMetric + 0, // 4: fixtures.SelfObservabilityMetric.metric_kind:type_name -> fixtures.SelfObservabilityMetric.MetricKind + 3, // 5: fixtures.SelfObservabilityMetric.histogram_value:type_name -> fixtures.SelfObservabilityMetric.Histogram + 4, // 6: fixtures.SelfObservabilityMetric.labels:type_name -> fixtures.SelfObservabilityMetric.LabelsEntry + 7, // [7:7] is the sub-list for method output_type + 7, // [7:7] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name } func init() { file_fixtures_proto_init() } @@ -293,19 +507,37 @@ func file_fixtures_proto_init() { return nil } } + file_fixtures_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SelfObservabilityMetric_Histogram); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + file_fixtures_proto_msgTypes[1].OneofWrappers = []interface{}{ + (*SelfObservabilityMetric_Int64Value)(nil), + (*SelfObservabilityMetric_Float64Value)(nil), + (*SelfObservabilityMetric_HistogramValue)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_fixtures_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, + NumEnums: 1, + NumMessages: 4, NumExtensions: 0, NumServices: 0, }, GoTypes: file_fixtures_proto_goTypes, DependencyIndexes: file_fixtures_proto_depIdxs, + EnumInfos: file_fixtures_proto_enumTypes, MessageInfos: file_fixtures_proto_msgTypes, }.Build() File_fixtures_proto = out.File diff --git a/exporter/collector/internal/integrationtest/fixtures.proto b/exporter/collector/internal/integrationtest/fixtures.proto index 30a1f30bc..a6dbd5598 100644 --- a/exporter/collector/internal/integrationtest/fixtures.proto +++ b/exporter/collector/internal/integrationtest/fixtures.proto @@ -28,8 +28,31 @@ message MetricExpectFixture { message SelfObservabilityMetric { // metric name string name = 1; - // stringified value - string val = 2; + + // Copied from + // https://github.com/googleapis/googleapis/blob/ab1bf9a5cef888843afb9ef3b70b79587d9a033b/google/api/metric.proto + enum MetricKind { + METRIC_KIND_UNSPECIFIED = 0; + GAUGE = 1; + DELTA = 2; + CUMULATIVE = 3; + } + // The GCM MetricKind that the metric would create + MetricKind metric_kind = 2; + + // A slimmed down explicit bucketed histogram + message Histogram { + double sum = 1; + int64 count = 2; + repeated double bucket_bounds = 3; + repeated int64 bucket_counts = 4; + } + + oneof value { + int64 int64_value = 5; + double float64_value = 6; + Histogram histogram_value = 7; + }; // stringified labels map labels = 3; } diff --git a/exporter/collector/internal/integrationtest/inmemoryocexporter.go b/exporter/collector/internal/integrationtest/inmemoryocexporter.go index 5f3347509..6b0e753e8 100644 --- a/exporter/collector/internal/integrationtest/inmemoryocexporter.go +++ b/exporter/collector/internal/integrationtest/inmemoryocexporter.go @@ -17,6 +17,7 @@ package integrationtest import ( "context" "fmt" + "log" "sort" "time" @@ -28,6 +29,16 @@ import ( "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector" ) +var ( + ocTypeToMetricKind = map[metricdata.Type]SelfObservabilityMetric_MetricKind{ + metricdata.TypeCumulativeInt64: SelfObservabilityMetric_CUMULATIVE, + metricdata.TypeCumulativeFloat64: SelfObservabilityMetric_CUMULATIVE, + metricdata.TypeGaugeInt64: SelfObservabilityMetric_GAUGE, + metricdata.TypeGaugeFloat64: SelfObservabilityMetric_GAUGE, + metricdata.TypeCumulativeDistribution: SelfObservabilityMetric_CUMULATIVE, + } +) + var _ metricexport.Exporter = (*InMemoryOCExporter)(nil) // OC stats/metrics exporter used to capture self observability metrics @@ -41,15 +52,18 @@ func (i *InMemoryOCExporter) ExportMetrics(ctx context.Context, data []*metricda return nil } -func (i *InMemoryOCExporter) Proto() []*SelfObservabilityMetric { +func (i *InMemoryOCExporter) Proto(ctx context.Context) ([]*SelfObservabilityMetric, error) { // Hack to flush stats, see https://tinyurl.com/5hfcxzk2 view.SetReportingPeriod(time.Minute) i.reader.ReadAndExport(i) var data []*metricdata.Metric + ctx, cancel := context.WithTimeout(ctx, time.Millisecond*100) + defer cancel() + select { - case <-time.NewTimer(time.Millisecond * 100).C: - return nil + case <-ctx.Done(): + return nil, ctx.Err() case data = <-i.c: } @@ -60,20 +74,52 @@ func (i *InMemoryOCExporter) Proto() []*SelfObservabilityMetric { for i := 0; i < len(d.Descriptor.LabelKeys); i++ { labels[d.Descriptor.LabelKeys[i].Key] = ts.LabelValues[i].Value } + metricKind, ok := ocTypeToMetricKind[d.Descriptor.Type] + if !ok { + return nil, fmt.Errorf("Got unsupported OC metric type %v", d.Descriptor.Type) + } for _, p := range ts.Points { - selfObsMetrics = append(selfObsMetrics, &SelfObservabilityMetric{ - Name: d.Descriptor.Name, - Val: fmt.Sprint(p.Value), - Labels: labels, - }) + selfObsMetric := &SelfObservabilityMetric{ + Name: d.Descriptor.Name, + MetricKind: metricKind, + Labels: labels, + } + + switch value := p.Value.(type) { + case int64: + selfObsMetric.Value = &SelfObservabilityMetric_Int64Value{Int64Value: value} + case float64: + selfObsMetric.Value = &SelfObservabilityMetric_Float64Value{Float64Value: value} + case *metricdata.Distribution: + bucketCounts := []int64{} + for _, bucket := range value.Buckets { + bucketCounts = append(bucketCounts, bucket.Count) + } + selfObsMetric.Value = &SelfObservabilityMetric_HistogramValue{ + HistogramValue: &SelfObservabilityMetric_Histogram{ + BucketBounds: value.BucketOptions.Bounds, + BucketCounts: bucketCounts, + Count: value.Count, + Sum: value.Sum, + }, + } + default: + // Probably don't care about any others so leaving them out for now + log.Printf("Can't handle OpenCensus metric data type %v, update the code", d.Descriptor.Type) + } + + selfObsMetrics = append(selfObsMetrics, selfObsMetric) } } } sort.Slice(selfObsMetrics, func(i, j int) bool { + if selfObsMetrics[i].Name == selfObsMetrics[j].Name { + return fmt.Sprint(selfObsMetrics[i].Labels) < fmt.Sprint(selfObsMetrics[j].Labels) + } return selfObsMetrics[i].Name < selfObsMetrics[j].Name }) - return selfObsMetrics + return selfObsMetrics, nil } // Shutdown unregisters the global OpenCensus views to reset state for the next test @@ -88,9 +134,9 @@ func (i *InMemoryOCExporter) Shutdown(ctx context.Context) error { func NewInMemoryOCViewExporter() (*InMemoryOCExporter, error) { // Reset our views in case any tests ran before this view.Unregister(collector.MetricViews()...) - view.Register(collector.MetricViews()...) view.Unregister(ocgrpc.DefaultClientViews...) - // TODO: Register ocgrpc.DefaultClientViews to test them + view.Register(collector.MetricViews()...) + view.Register(ocgrpc.DefaultClientViews...) return &InMemoryOCExporter{ c: make(chan []*metricdata.Metric, 1), diff --git a/exporter/collector/internal/integrationtest/metrics_test.go b/exporter/collector/internal/integrationtest/metrics_test.go index 90c7f8dd5..abbe99f1a 100644 --- a/exporter/collector/internal/integrationtest/metrics_test.go +++ b/exporter/collector/internal/integrationtest/metrics_test.go @@ -56,12 +56,15 @@ func TestMetrics(t *testing.T) { startTime, endTime, ) + + selfObsMetrics, err := inMemoryOCExporter.Proto(ctx) + require.NoError(t, err) diff := DiffProtos( &MetricExpectFixture{ CreateTimeSeriesRequests: testServer.CreateTimeSeriesRequests(), CreateMetricDescriptorRequests: testServer.CreateMetricDescriptorRequests(), CreateServiceTimeSeriesRequests: testServer.CreateServiceTimeSeriesRequests(), - SelfObservabilityMetrics: inMemoryOCExporter.Proto(), + SelfObservabilityMetrics: selfObsMetrics, }, expectFixture, ) diff --git a/exporter/collector/internal/integrationtest/testcase.go b/exporter/collector/internal/integrationtest/testcase.go index 0b45d3a49..22a4473d0 100644 --- a/exporter/collector/internal/integrationtest/testcase.go +++ b/exporter/collector/internal/integrationtest/testcase.go @@ -31,6 +31,17 @@ import ( "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/collector" ) +var ( + // selfObsMetricsToNormalize is the set of self-observability metrics which may not record + // the same value every time due to side effects. The values of these metrics get cleared + // and are not checked in the fixture. Their labels and types are still checked. + selfObsMetricsToNormalize = map[string]struct{}{ + "grpc.io/client/roundtrip_latency": {}, + "grpc.io/client/sent_bytes_per_rpc": {}, + "grpc.io/client/received_bytes_per_rpc": {}, + } +) + type MetricsTestCase struct { // Name of the test case Name string @@ -200,6 +211,27 @@ func normalizeFixture(fixture *MetricExpectFixture) { md.Name = "" } } + + for _, som := range fixture.SelfObservabilityMetrics { + if _, ok := selfObsMetricsToNormalize[som.Name]; ok { + // zero out the specific value type + switch value := som.Value.(type) { + case *SelfObservabilityMetric_Int64Value: + value.Int64Value = 0 + case *SelfObservabilityMetric_Float64Value: + value.Float64Value = 0 + case *SelfObservabilityMetric_HistogramValue: + bucketCounts := value.HistogramValue.BucketCounts + for i := range bucketCounts { + bucketCounts[i] = 0 + } + value.HistogramValue.Count = 0 + value.HistogramValue.Sum = 0 + default: + som.Value = nil + } + } + } } func (m *MetricsTestCase) SkipIfNeeded(t testing.TB) { diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/basic_counter_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/basic_counter_metrics_expect.json index b9ba19c20..2d0891757 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/basic_counter_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/basic_counter_metrics_expect.json @@ -55,10 +55,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "1", + "metricKind": "CUMULATIVE", + "int64Value": "1", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/create_service_timeseries_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/create_service_timeseries_metrics_expect.json index 910b37092..11258a011 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/create_service_timeseries_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/create_service_timeseries_metrics_expect.json @@ -36,10 +36,194 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "1", + "metricKind": "CUMULATIVE", + "int64Value": "1", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/delta_counter_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/delta_counter_metrics_expect.json index 485e5c557..4346b814c 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/delta_counter_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/delta_counter_metrics_expect.json @@ -55,10 +55,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "1", + "metricKind": "CUMULATIVE", + "int64Value": "1", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/exponential_histogram_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/exponential_histogram_metrics_expect.json index 539d37ffe..529398c0c 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/exponential_histogram_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/exponential_histogram_metrics_expect.json @@ -228,10 +228,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "2", + "metricKind": "CUMULATIVE", + "int64Value": "2", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "2", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/gke_control_plane_metrics_agent_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/gke_control_plane_metrics_agent_metrics_expect.json index c472defe8..fa12e87e5 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/gke_control_plane_metrics_agent_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/gke_control_plane_metrics_agent_metrics_expect.json @@ -1066,10 +1066,194 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "35", + "metricKind": "CUMULATIVE", + "int64Value": "35", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/gke_metrics_agent_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/gke_metrics_agent_metrics_expect.json index 5eb7329cb..babf813b1 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/gke_metrics_agent_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/gke_metrics_agent_metrics_expect.json @@ -4050,10 +4050,194 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "143", + "metricKind": "CUMULATIVE", + "int64Value": "143", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateServiceTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/nonmonotonic_counter_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/nonmonotonic_counter_metrics_expect.json index 75e1cf6ae..8b8b58950 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/nonmonotonic_counter_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/nonmonotonic_counter_metrics_expect.json @@ -54,10 +54,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "1", + "metricKind": "CUMULATIVE", + "int64Value": "1", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_host_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_host_metrics_expect.json index 9c3e9a99a..bb830bac8 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_host_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_host_metrics_expect.json @@ -3153,10 +3153,194 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "106", + "metricKind": "CUMULATIVE", + "int64Value": "106", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_self_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_self_metrics_expect.json index 72670516d..1bdc8b39b 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_self_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/ops_agent_self_metrics_expect.json @@ -60,10 +60,194 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "2", + "metricKind": "CUMULATIVE", + "int64Value": "2", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/summary_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/summary_metrics_expect.json index 5159d4700..00e10d1af 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/summary_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/summary_metrics_expect.json @@ -209,10 +209,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "5", + "metricKind": "CUMULATIVE", + "int64Value": "5", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "3", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/unknown_domain_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/unknown_domain_metrics_expect.json index 82551d055..efe549089 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/unknown_domain_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/unknown_domain_metrics_expect.json @@ -55,10 +55,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "1", + "metricKind": "CUMULATIVE", + "int64Value": "1", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] } diff --git a/exporter/collector/internal/integrationtest/testdata/fixtures/workloadgoogleapis_prefix_metrics_expect.json b/exporter/collector/internal/integrationtest/testdata/fixtures/workloadgoogleapis_prefix_metrics_expect.json index b9ba19c20..2d0891757 100644 --- a/exporter/collector/internal/integrationtest/testdata/fixtures/workloadgoogleapis_prefix_metrics_expect.json +++ b/exporter/collector/internal/integrationtest/testdata/fixtures/workloadgoogleapis_prefix_metrics_expect.json @@ -55,10 +55,377 @@ "selfObservabilityMetrics": [ { "name": "googlecloudmonitoring/point_count", - "val": "1", + "metricKind": "CUMULATIVE", + "int64Value": "1", "labels": { "status": "OK" } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/completed_rpcs", + "metricKind": "CUMULATIVE", + "int64Value": "1", + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries", + "grpc_client_status": "OK" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/received_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/roundtrip_latency", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 0.01, + 0.05, + 0.1, + 0.3, + 0.6, + 0.8, + 1, + 2, + 3, + 4, + 5, + 6, + 8, + 10, + 13, + 16, + 20, + 25, + 30, + 40, + 50, + 65, + 80, + 100, + 130, + 160, + 200, + 250, + 300, + 400, + 500, + 650, + 800, + 1000, + 2000, + 5000, + 10000, + 20000, + 50000, + 100000 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateMetricDescriptor" + } + }, + { + "name": "grpc.io/client/sent_bytes_per_rpc", + "metricKind": "CUMULATIVE", + "histogramValue": { + "bucketBounds": [ + 1024, + 2048, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216, + 67108864, + 268435456, + 1073741824, + 4294967296 + ], + "bucketCounts": [ + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0", + "0" + ] + }, + "labels": { + "grpc_client_method": "google.monitoring.v3.MetricService/CreateTimeSeries" + } } ] }