Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

metric_kind is not required in TimeSeries #58

Open
aabmass opened this issue Oct 23, 2020 · 0 comments
Open

metric_kind is not required in TimeSeries #58

aabmass opened this issue Oct 23, 2020 · 0 comments

Comments

@aabmass
Copy link

aabmass commented Oct 23, 2020

We have this validation:

// 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:

MetricKind

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) or CUMULATIVE.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant