What is the purpose of management.endpoints.prometheus.metrics.export.step property?

347 Views Asked by At

I would like to know what are the use cases for the property, which is defined in application.yaml properties for Spring Boot applications.

This property doesn't affect Prometheus pull behaviour. If I set this property to 1 hour and scrape my /actuator/prometheus endpoint every 15 seconds, I will be getting up-to-date values each time.

Then it leaves us only with the push metrics scenario. From what I've understood, Prometheus doesn't allow pushing metrics to it by design, the only option is to use PushGateway. But for this use case, we have another property: management.prometheus.metrics.export.pushgateway.push-rate

Then what does management.endpoints.prometheus.metrics.export.step do? I tried to find documentation about the property to no avail.

1

There are 1 best solutions below

0
On BEST ANSWER

From the Micrometer javadoc (also see in the code):

The step size to use in computing windowed statistics like max. The default is 1 minute. To get the most out of these statistics, align the step interval to be close to your scrape interval.

For example if you measure the duration using a Timer, max will be calculated over a 1 minute window and it will not mean max since the app started (that would be useless).