diff --git a/output/cloud/expv2/pbcloud/metric.pb.go b/output/cloud/expv2/pbcloud/metric.pb.go index 3c5134dbe44e..ff96bd2ef3d4 100644 --- a/output/cloud/expv2/pbcloud/metric.pb.go +++ b/output/cloud/expv2/pbcloud/metric.pb.go @@ -25,28 +25,30 @@ const ( type MetricType int32 const ( - MetricType_METRICTYPE_UNSPECIFIED MetricType = 0 - MetricType_COUNTER MetricType = 1 - MetricType_GAUGE MetricType = 2 - MetricType_RATE MetricType = 3 - MetricType_TREND MetricType = 4 + // Metric of type METRICTYPE_UNSPECIFIED declared, but not allowed. + // See: https://protobuf.dev/programming-guides/dos-donts/#do-include-an-unspecified-value-in-an-enum. + MetricType_METRIC_TYPE_UNSPECIFIED MetricType = 0 + MetricType_METRIC_TYPE_COUNTER MetricType = 1 + MetricType_METRIC_TYPE_GAUGE MetricType = 2 + MetricType_METRIC_TYPE_RATE MetricType = 3 + MetricType_METRIC_TYPE_TREND MetricType = 4 ) // Enum value maps for MetricType. var ( MetricType_name = map[int32]string{ - 0: "METRICTYPE_UNSPECIFIED", - 1: "COUNTER", - 2: "GAUGE", - 3: "RATE", - 4: "TREND", + 0: "METRIC_TYPE_UNSPECIFIED", + 1: "METRIC_TYPE_COUNTER", + 2: "METRIC_TYPE_GAUGE", + 3: "METRIC_TYPE_RATE", + 4: "METRIC_TYPE_TREND", } MetricType_value = map[string]int32{ - "METRICTYPE_UNSPECIFIED": 0, - "COUNTER": 1, - "GAUGE": 2, - "RATE": 3, - "TREND": 4, + "METRIC_TYPE_UNSPECIFIED": 0, + "METRIC_TYPE_COUNTER": 1, + "METRIC_TYPE_GAUGE": 2, + "METRIC_TYPE_RATE": 3, + "METRIC_TYPE_TREND": 4, } ) @@ -84,6 +86,7 @@ type MetricSet struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Metrics []*Metric `protobuf:"bytes,1,rep,name=metrics,proto3" json:"metrics,omitempty"` } @@ -134,6 +137,7 @@ type Metric struct { // Required. Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Required. + // Can't be of type MetricType.METRICTYPE_UNSPECIFIED (which is zero value). Type MetricType `protobuf:"varint,2,opt,name=type,proto3,enum=metrics.MetricType" json:"type,omitempty"` // Optional. TimeSeries []*TimeSeries `protobuf:"bytes,3,rep,name=time_series,json=timeSeries,proto3" json:"time_series,omitempty"` @@ -182,7 +186,7 @@ func (x *Metric) GetType() MetricType { if x != nil { return x.Type } - return MetricType_METRICTYPE_UNSPECIFIED + return MetricType_METRIC_TYPE_UNSPECIFIED } func (x *Metric) GetTimeSeries() []*TimeSeries { @@ -256,9 +260,16 @@ type TimeSeries struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. + // + // At minimum two labels should be present: + // - name: "__name__", value: "metric name this time series belongs to/is contained within", + // - name: "test_run_id", value: "cloud test run ID this time series belongs to". Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` // time bucket size in seconds AggregationPeriod uint32 `protobuf:"varint,2,opt,name=aggregation_period,json=aggregationPeriod,proto3" json:"aggregation_period,omitempty"` + // Required. + // // Types that are assignable to Samples: // // *TimeSeries_CounterSamples @@ -382,6 +393,7 @@ type CounterSamples struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Values []*CounterValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` } @@ -429,6 +441,7 @@ type GaugeSamples struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Values []*GaugeValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` } @@ -476,6 +489,7 @@ type RateSamples struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Values []*RateValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` } @@ -523,6 +537,7 @@ type TrendHdrSamples struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Values []*TrendHdrValue `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"` } @@ -570,6 +585,7 @@ type CounterValue struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"` } @@ -625,6 +641,7 @@ type GaugeValue struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` // last observed value Last float64 `protobuf:"fixed64,2,opt,name=last,proto3" json:"last,omitempty"` @@ -715,6 +732,7 @@ type RateValue struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` NonzeroCount uint32 `protobuf:"varint,2,opt,name=nonzero_count,json=nonzeroCount,proto3" json:"nonzero_count,omitempty"` TotalCount uint32 `protobuf:"varint,3,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"` @@ -778,6 +796,7 @@ type TrendHdrValue struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields + // Required. Time *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=time,proto3" json:"time,omitempty"` // histogram parameter - value multiplier aka smallest value, default = 1.0 MinResolution float64 `protobuf:"fixed64,2,opt,name=min_resolution,json=minResolution,proto3" json:"min_resolution,omitempty"` @@ -1024,16 +1043,19 @@ var file_metric_proto_rawDesc = []byte{ 0x1b, 0x0a, 0x19, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x6c, 0x6f, 0x77, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x42, 0x1c, 0x0a, 0x1a, 0x5f, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f, 0x68, 0x69, 0x67, 0x68, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2a, 0x55, 0x0a, 0x0a, 0x4d, 0x65, - 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x4d, 0x45, 0x54, 0x52, - 0x49, 0x43, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, - 0x01, 0x12, 0x09, 0x0a, 0x05, 0x47, 0x41, 0x55, 0x47, 0x45, 0x10, 0x02, 0x12, 0x08, 0x0a, 0x04, - 0x52, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x09, 0x0a, 0x05, 0x54, 0x52, 0x45, 0x4e, 0x44, 0x10, - 0x04, 0x42, 0x27, 0x5a, 0x25, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, 0x6b, 0x36, - 0x2f, 0x6f, 0x74, 0x70, 0x75, 0x74, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x65, 0x78, 0x70, - 0x76, 0x32, 0x2f, 0x70, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x65, 0x72, 0x2a, 0x86, 0x01, 0x0a, 0x0a, 0x4d, + 0x65, 0x74, 0x72, 0x69, 0x63, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x4d, 0x45, 0x54, + 0x52, 0x49, 0x43, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x45, 0x52, 0x10, 0x01, 0x12, + 0x15, 0x0a, 0x11, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, + 0x41, 0x55, 0x47, 0x45, 0x10, 0x02, 0x12, 0x14, 0x0a, 0x10, 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, + 0x4d, 0x45, 0x54, 0x52, 0x49, 0x43, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x45, 0x4e, + 0x44, 0x10, 0x04, 0x42, 0x28, 0x5a, 0x26, 0x67, 0x6f, 0x2e, 0x6b, 0x36, 0x2e, 0x69, 0x6f, 0x2f, + 0x6b, 0x36, 0x2f, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2f, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, + 0x65, 0x78, 0x70, 0x76, 0x32, 0x2f, 0x70, 0x62, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/output/cloud/expv2/pbcloud/metric.proto b/output/cloud/expv2/pbcloud/metric.proto index e38ca910cf87..f8a7d6f41e90 100644 --- a/output/cloud/expv2/pbcloud/metric.proto +++ b/output/cloud/expv2/pbcloud/metric.proto @@ -2,22 +2,25 @@ syntax = "proto3"; package metrics; -option go_package = "go.k6.io/k6/otput/cloud/expv2/pbcloud"; +option go_package = "go.k6.io/k6/output/cloud/expv2/pbcloud"; import "google/protobuf/timestamp.proto"; // The type of a Metric. enum MetricType { - METRICTYPE_UNSPECIFIED = 0; - COUNTER = 1; - GAUGE = 2; - RATE = 3; - TREND = 4; + // Metric of type METRICTYPE_UNSPECIFIED declared, but not allowed. + // See: https://protobuf.dev/programming-guides/dos-donts/#do-include-an-unspecified-value-in-an-enum. + METRIC_TYPE_UNSPECIFIED = 0; + METRIC_TYPE_COUNTER = 1; + METRIC_TYPE_GAUGE = 2; + METRIC_TYPE_RATE = 3; + METRIC_TYPE_TREND = 4; } // MetricSet is the top-level container type // that is encoded and sent over the wire. message MetricSet { + // Required. repeated Metric metrics = 1; } @@ -26,6 +29,7 @@ message Metric { string name = 1; // Required. + // Can't be of type MetricType.METRICTYPE_UNSPECIFIED (which is zero value). MetricType type = 2; // Optional. @@ -43,11 +47,17 @@ message Label { // TimeSeries is a single metric with a unique set of labels.. message TimeSeries { + // Required. + // + // At minimum two labels should be present: + // - name: "__name__", value: "metric name this time series belongs to/is contained within", + // - name: "test_run_id", value: "cloud test run ID this time series belongs to". repeated Label labels = 1; // time bucket size in seconds uint32 aggregation_period = 2; + // Required. oneof samples { CounterSamples counter_samples = 3; GaugeSamples gauge_samples = 4; @@ -57,27 +67,34 @@ message TimeSeries { } message CounterSamples { + // Required. repeated CounterValue values = 1; } message GaugeSamples { + // Required. repeated GaugeValue values = 1; } message RateSamples { + // Required. repeated RateValue values = 1; } message TrendHdrSamples { + // Required. repeated TrendHdrValue values = 1; } message CounterValue { + // Required. google.protobuf.Timestamp time = 1; + double value = 2; } message GaugeValue { + // Required. google.protobuf.Timestamp time = 1; // last observed value @@ -91,12 +108,15 @@ message GaugeValue { } message RateValue { + // Required. google.protobuf.Timestamp time = 1; + uint32 nonzero_count = 2; uint32 total_count = 3; } message TrendHdrValue { + // Required. google.protobuf.Timestamp time = 1; // histogram parameter - value multiplier aka smallest value, default = 1.0