micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

StepCounter does not push incomplete step values on application shutdown

Open garridobarrera opened this issue 3 years ago • 4 comments

Hi guys, I have created this pull request to attempt solve the problem discussed in the issue #1882 @izeye @shakuzen @jkschneider

garridobarrera avatar Mar 20 '21 23:03 garridobarrera

@garridobarrera Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-issuemaster avatar Mar 20 '21 23:03 pivotal-issuemaster

@garridobarrera Thank you for signing the Contributor License Agreement!

pivotal-issuemaster avatar Mar 20 '21 23:03 pivotal-issuemaster

I would love to see this issue fixed. We're using Micrometer in Google's managed Cloud Run. Instances spin up and shut down all the time, and Google even accelerates instance shutdown if multiple requests return 5xx codes. So we get flaky metric reporting on buggy services, which is the worst time to be experiencing flaky metrics.

ajs1998 avatar Mar 05 '22 05:03 ajs1998

@garridobarrera I'm looking into this and I'm thinking probably propagating the "getting the current value" functionality even deeper than the Meter level (StepTuple2 StepValue, TimeWindowMax) and also add this capability to every step registry.

Are you interested in contribution on this? If so, as the first step, could you please rebase your changes to 1.8 since that is the lowest version we support right now.

jonatan-ivanov avatar Sep 01 '22 20:09 jonatan-ivanov

@garridobarrera thank you very much for the pull request. Ultimately, we went with a different approach in #3681, which should require less (or no) changes in each registry implementation that extends StepMeterRegistry. It should have the same effect as these changes, but for most step based registries. Please do give it a try (it will be released shortly in milestone 1.11.0-M2) and let us know if you have any thoughts on the approach taken there.

shakuzen avatar Mar 14 '23 04:03 shakuzen