Skip to content

StackdriverMeterRegistry should report Counters as CUMULATIVE not as GAUGE #2773

Closed
@jayleenli

Description

@jayleenli

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

  • Micrometer latest version (io.micrometer:micrometer-registry-stackdriver:latest.release)
  • Stackdriver Micrometer registry
  • macOS
  • Java version: 15

To Reproduce
How to reproduce the bug:
Example:

    MeterRegistry registry = StackdriverMeterRegistry.builder(stackdriverConfig).build();
    Counter x = registry.counter("example_counter","example_key","20");
    someUserCaseIncrementingCounter(x);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions