spring-bootprometheusmicrometer

http_server_requests_seconds_max exact meaning in Micrometer


In Prometheus I've got 14 seconds for http_server_requests_seconds_max.

http_server_requests_seconds_max{exception="None",method="GET",outcome="SUCCESS",status="200",uri="/v1/**",} 14.3

Does this mean the total time for the request from the server to the client or does it only measure the time in the Spring container? I'm also measuring the time inside spring to process the data and it only takes 2.5 seconds. What I want to know is if it is a problem in Spring or if it is because of a slow network. Any Ideas?


Solution

  • From the copy of Spring documentation at Archive.org (or current Micrometer.io page), when @Timed attribute is used on a function or a Controller, it produces the metrics http_server_requests.

    which by default contains dimensions for the HTTP status of the response, HTTP method, exception type if the request fails, and the pre-variable substitution parameterized endpoint URI.

    The http_server_requests_seconds_max is then computed as explained in this discussion

    public static final Statistic MAX

    The maximum amount recorded. When this represents a time, it is reported in the monitoring system's base unit of time.

    In your case, it means that one of you endpoint in the range /v1/** (i.e. one of all of them) called a @Timed function that took 14sec to execute.

    For more information you would need percentiles or histograms metrics. It may happen only once; usually at the first request wen cache need to be built or services needs to warm up.