This repository was archived by the owner on Oct 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
This repository was archived by the owner on Oct 26, 2022. It is now read-only.
metric_kind is not required in TimeSeries #58
Copy link
Copy link
Open
Description
We have this validation:
cloud-operations-api-mock/internal/validation/mock_metric_validation.go
Lines 344 to 356 in e8bcc34
| // validateMetricKind check that if metric_kind is present, | |
| // it is the same as the metricKind of the associated metric. | |
| func validateMetricKind(timeSeries *monitoring.TimeSeries, descriptors map[string]*metric.MetricDescriptor) error { | |
| descriptor := descriptors[timeSeries.Metric.Type] | |
| if descriptor == nil { | |
| return statusMissingMetricDescriptor | |
| } | |
| if descriptor.MetricKind != timeSeries.MetricKind { | |
| return statusInvalidTimeSeriesMetricKind | |
| } | |
| return nil | |
| } |
However, the GCM documentation says:
The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.
When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either
GAUGE(the default) orCUMULATIVE.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels