Histogram for web service request duration

Tracks request execution time and counts for a web service managed by GAS.

Table 1. fourjs_gas_service_request_duration_seconds
Labels Value Purpose
  1. url: URL prefix managed by the GAS. (with the URL label always set to /ws/r)
  2. service: service name
Time of execution in seconds
  • Track time of execution for requests for a specified web service 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 web-service response times, see the res.prometheus.rq_service_duration.buckets resource.

Metric examples:
fourjs_gas_service_request_duration_seconds{url="/ws/r",service="demo/Calculator",le="0.001"} 0
fourjs_gas_service_request_duration_seconds{url="/ws/r",service="demo/BookService",le="0.005"} 1
fourjs_gas_service_request_duration_seconds_sum{url="/ws/r",service="demo/BookService"} 0.034
fourjs_gas_service_request_duration_seconds_count{url="/ws/r",service="demo/BookService"} 4

Grafana

PromQL queries for percentile and average request duration are provided.
  • PromQL query (percentile):
    histogram_quantile(0.90, sum(rate(fourjs_gas_service_request_duration_seconds_bucket
      {service="demo/BookService"}[$__rate_interval])) by (le))
    This query calculates the 90th percentile of request duration for the BookService, helping you monitor response time for most users.
  • PromQL query (rate):
    rate(fourjs_gas_service_request_duration_seconds_sum{service="demo/BookService"}[5m]) /
        rate(fourjs_gas_service_request_duration_seconds_count{service="demo/BookService"}[5m])
    This query calculates the average request duration rate for the BookService.