-
Notifications
You must be signed in to change notification settings - Fork 1k
StackdriverMeterRegistry should report Counters as CUMULATIVE not as GAUGE #2773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
We have a PR to fix this: #2232 |
Thanks a lot for creating this Issue, @jayleenli ! I see one thing to consider, I would like to get your thoughts on. What MetricKind should we use e.g. for Counters? @shakuzen mentioned in the PR that |
Ok, I think I answered my own question. It is not super obvious in Google Monitoring docs, but custom metrics are only allowed to have GAUGE and CUMULATIVE MetricKind. So we can't use DELTA. https://cloud.google.com/monitoring/api/v3/kinds-and-types#kind-type-combos - in the DELTA column all of the allowed combinations have footnote saying it's not actually supported for custom metrics. |
Just sharing that I found this discussion which resulted in this feature request being opened to support DELTA with custom metrics. Also of note is that a Stackdriver product manager suggested the approach with CUMULATIVE and timstamp resets as a workaround. |
This change makes it possible to send counter metrics as CUMULATIVE instead of GAUGE, which enables better functionality in Stackdriver when graphing the metric. Since a different MetricKind cannot be sent for an already existing MetricDescriptor, this feature is controlled by a feature flag in `StackdriverConfig` called `useSemanticMetricTypes`. Resolves gh-2773 Co-authored-by: Yuliia <[email protected]>
A new config method has been added to |
Calling .counter() for a StackdriverMeterRegistry creates a GAUGE metric instead of CUMULATIVE metric.
This is basically a repost of a previously reported bug because that one is closed.
#2231
Environment
To Reproduce
How to reproduce the bug:
Example:
Will create a gauge metric and not a cumulative one in Cloud Monitoring.
Expected behavior
Create a CUMULATIVE Metric instead of a Gauge Metric
Additional context
User @tmarszal has proposed changes to fix this bug.
tmarszal@9e6809f
The text was updated successfully, but these errors were encountered: