I'm using micrometer gauge metric to monitor Http_max_response_time in Vertx service. (configure metric with Prometheus).
When testing, I send a request with timeout 3 seconds at 13:15:16 and the gauge metric return right value about Http_max_response_time (3s). But after that request, there is not any request with timeout 3 seconds send to server, the gauge metric still return Http_max_response_time = 3 second until 13:17:51, and then it updates new value Http_max_response_time to less than 3s. I think it need update more frequently.
My questions here:
- How long the gauge metric update new value OR how long it keeps current value?
- Which logic that the gauge metric Http_max_response_time execute? Does it just update a global value and return it when there is an observation?
If my question is not clear, please comment and I will show detail more. Thank in advance,
Updated:
Vertx-micrometer-metrics use a Timer metric for response time, and using a TimeWindowMax to update highest value.
So we can change default expiry configuration in DistributionStatisticConfig to smaller value as you want.
Here my code to change TimeWindowMax of metrics which contain responseTime to 2 seconds:
And It worked.