micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Support updating step duration at runtime

Open quaff opened this issue 6 years ago • 9 comments

StepMeterRegistry startup with step from config, sometimes we want to change it at runtime, StepMeterRegistry should provide a method like this

    public void updateStep(Duration step) {
        if(scheduledFuture != null) {
            scheduledFuture.cancel(true);
            scheduledFuture = scheduledExecutorService.scheduleAtFixedRate(this::publish, step
                .toMillis(), step.toMillis(), TimeUnit.MILLISECONDS);
        }
    }

quaff avatar Sep 06 '18 07:09 quaff

This would be a great feature to have.

dhaval24 avatar Sep 08 '18 18:09 dhaval24

@jkschneider would you be interested in having a method like this. I believe it could be handy, in systems where one would like to see the real time metrics (over 1 sec latency), however, I also think that stats might be skewed when something like this happens. The common queries that user would have on monitoring systems would start showing wiered charts. What are the thoughts?

dhaval24 avatar Sep 17 '18 03:09 dhaval24

This is exactly what I'm looking for. Any chance of getting this feature?

davebaol avatar Sep 04 '21 21:09 davebaol

We need to understand the use case for features so that we can justify supporting them and document such use cases. It's not entirely clear to me what the use case is for changing the step at runtime. Could any of the people requesting this elaborate more on the use case? Given that things like counts published from StepMeterRegistry implementations are step-normalized, you would need to be aware when querying your metrics backend when the step has changed and to what. I think it will generally create more problems than it solves, but I am willing to discuss more.

shakuzen avatar Sep 06 '21 01:09 shakuzen

@shakuzen The simple use case here is in controlling volume of data transmitted. In times where you need extra visibility, turning the screws a bit on step interval gets you finer grained data.

jkschneider avatar Sep 07 '21 19:09 jkschneider

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.

github-actions[bot] avatar Dec 21 '23 09:12 github-actions[bot]

Ping

quaff avatar Dec 21 '23 11:12 quaff

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.

github-actions[bot] avatar Jan 02 '24 01:01 github-actions[bot]

Any thoughts?

quaff avatar Jan 02 '24 02:01 quaff