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
Counters not idempotent / state & lifecycle unclear #1713
Comments
Here's another example:
|
It seems the call to a parameter-less |
That is bizarre behavior and not at all what I would expect (especially based on my understanding of how it is implemented). Increment takes a |
It behaves the same, but I do eventually see the metrics in DataDog, so are the values in the Counter instance(s) just being reset after the library purges data to DataDog?
|
This, I believe, is due to timing and because the Step* implementations will return the value (count) for the previous interval. I'll open a separate issue to add some unit tests that demonstrate this for Step* metrics, as it has confused others and it would be nice to have something to point people to that also verifies the behavior. For now you can check the TCK test for counter increments. micrometer/micrometer-core/src/main/java/io/micrometer/core/instrument/step/StepDouble.java Lines 58 to 64 in 49162a8
micrometer/micrometer-test/src/main/java/io/micrometer/core/tck/CounterTest.java Lines 36 to 49 in 49162a8
|
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed. |
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open. |
Counters (and presumably other metering classes) don't appear to be idempotent. A single instance of a Counter class, registered to a DataDogRegistry doesn't produce consistent results when calling count() or measure(). The below example is from a scala sbt console and is a verbatim output, in order.
What's the lifecycle of the state of this object supposed to look like? Should the count values ever reset on their own? I'd really like to use this library and not go back to Dropwizard metrics if I don't have to
The text was updated successfully, but these errors were encountered: