Histogram for application request duration

Tracks request execution time and counts for an application managed by GAS.

Table 1. fourjs_gas_application_request_duration_seconds
Labels Value Purpose
  1. url: URL prefix managed by the GAS. (with the URL label set depending on the type of application request, for example, /ua/r, /ua/ft)
  2. application: application name.
Time of execution in seconds
  • Track time of execution for requests for a specified application managed by the GAS
  • Sum the total request time
  • Count the number of requests
  • Calculate the request execution time at the Xth percentile — the time below which X% of all requests completed.

This histogram is configured in the GAS configuration file (as.xcf) in the HISTOGRAM_BUCKETS element; for details about the bucket used to measure application response times, see the res.prometheus.rq_application_duration.buckets resource.

Metric examples:
fourjs_gas_application_request_duration_seconds_bucket{url="/ua/ft",application="demo",le="0.005"} 1
fourjs_gas_application_request_duration_seconds{url="/ua/r",application="demo",le="0.005"} 1
fourjs_gas_application_request_duration_seconds_sum{url="/ua/r",application="demo"} 0.034
fourjs_gas_application_request_duration_seconds_count{url="/ua/r",application="demo"} 4

Grafana

PromQL queries for percentile and average request duration are provided, as well as a visualization example in Grafana.
  • PromQL query (percentile):
    histogram_quantile(0.90,sum(rate(fourjs_gas_application_request_duration_seconds_bucket
      {application="demo"}[$__rate_interval])) by (le))
    This query calculates the 90th percentile for the demo application.
  • PromQL query (rate):
    rate(fourjs_gas_application_request_duration_seconds_sum{application="demo"}[5m]) /
          rate(fourjs_gas_application_request_duration_seconds_count{application="demo"}[5m])
    This query calculates the average request duration rate for the demo application.
    Figure: Average request duration

    Image of a Grafana panel showing average request duration over last 5 minutes