-
Notifications
You must be signed in to change notification settings - Fork 1.1k
custom metrics API: simplification suggestion #2333
Copy link
Copy link
Closed
Labels
api: monitoringIssues related to the Cloud Monitoring API.Issues related to the Cloud Monitoring API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Metadata
Metadata
Assignees
Labels
api: monitoringIssues related to the Cloud Monitoring API.Issues related to the Cloud Monitoring API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Suggestion:
Remove the Metric class and have MetricDescriptor settable on CreateTimeSeriesRequest - or something similar.
Background:
Based on the user guide to create custom metrics, I have to create a MetricDescriptor:
Great, now I have a metricDescriptor. What can I do with it? Nothing really.
In order to write data, I'll need to create a TimeSeries, and that needs another representation of this metric/metricdescriptor called
Metric:OKay, so I can't reuse the
MetricDescriptor, I'll useMetric.But then on the
TimeSeries, I have.setMetricKind,.setMetricKindValue... I guess it is there so that if I create aTimeSerieswithout aMetricDescriptorfirst, the descriptor can be implicitly created. But then why introduce a separete class for it calledMetricthat doesn't even have the Kind, KindValue (~= ValueType? or just repetition?).I find the situation confusing, as
I understand that this code is largely generated for now from the protobufs (#2331), I would offer this issue as an example where the user experience can be increased significantly and how the generated code is not user friendly by default.