micrometer
micrometer copied to clipboard
Support updating step duration at runtime
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);
}
}
This would be a great feature to have.
@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?
This is exactly what I'm looking for. Any chance of getting this feature?
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 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.
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.
Ping
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.
Any thoughts?