micrometer
micrometer copied to clipboard
StepCounter does not push incomplete step values on application shutdown
Hi guys, I have created this pull request to attempt solve the problem discussed in the issue #1882 @izeye @shakuzen @jkschneider
@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.
@garridobarrera Thank you for signing the Contributor License Agreement!
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.
@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.
@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.