Skip to main content

Historical Monitoring Data

Returns historical (time-series) HAProxy metrics for a load balancer, sourced from Prometheus. The metric is selected by the metric_name query parameter and the look-back window by interval (in seconds). Frontend metrics return data for the load balancer's frontend; backend metrics return data for the backend named by the server parameter.

The HTTP response-code metrics (haproxy_backend_http_responses_total, haproxy_frontend_http_responses_total) return the current value bucketed by response class - labels is ["2xx","3xx","4xx","5xx"] and results holds the matching counts. All other metrics return a range series over interval. See metric_name for the full list of metrics the console requests.

GET/api/v1/appliances/load-balancers/{lb_id}/historical_data/

Path parameters

  • lb_idPathintegerrequired

    The id of the load balancer, as returned by the List Load Balancers endpoint.

    • required
    • must be a valid load balancer (appliance) ID
    example12345

Query parameters

  • metric_nameQuerystringoptional

    Name of the HAProxy/Prometheus metric to fetch. The backend does not restrict this to a fixed enum (any metric the HAProxy exporter publishes will work), but the console requests the specific frontend and backend metrics listed below. Defaults to haproxy_backend_http_responses_total.

    • defaults to haproxy_backend_http_responses_total
    • backend metrics requested by the console: haproxy_backend_http_responses_total, haproxy_backend_bytes_in_total, haproxy_backend_bytes_out_total, haproxy_backend_current_queue, haproxy_backend_max_queue, haproxy_backend_current_sessions, haproxy_backend_sessions_total, haproxy_backend_limit_sessions, haproxy_backend_max_sessions, haproxy_backend_up, haproxy_backend_response_errors_total, haproxy_backend_connection_errors_total, haproxy_backend_current_session_rate, haproxy_backend_max_session_rate
    • frontend metrics requested by the console: haproxy_frontend_http_responses_total, haproxy_frontend_max_session_rate, haproxy_frontend_limit_session_rate, haproxy_frontend_current_sessions, haproxy_frontend_max_sessions, haproxy_frontend_limit_sessions, haproxy_frontend_sessions_total, haproxy_frontend_request_errors_total, haproxy_frontend_requests_denied_total, haproxy_frontend_bytes_in_total, haproxy_frontend_bytes_out_total, haproxy_frontend_current_session_rate
    • any metric name containing "frontend" is queried with frontend labels; otherwise backend labels are used
    examplehaproxy_backend_http_responses_total
  • intervalQueryintegeroptional

    Look-back window in seconds for the time-series query. Defaults to 3600 (1 hour).

    • optional
    • positive integer (seconds)
    • console presets: 3600 (1h), 21600 (6h), 43200 (12h), 86400 (1d), 604800 (7d)
    example3600
  • serverQuerystringoptional

    Name of the backend to scope backend metrics to. Defaults to the load balancer's first backend.

    • optional
    • must match an existing backend name on the load balancer
    examplebackend-group-1
  • project_idQueryintegerrequired

    Identifier of the project to scope the request to. Required integer project ID.

    • required
    • must be a valid integer project ID
    example{{project_id}}
  • apikeyQuerystringrequired

    API key used to authenticate the request

    • required
    • non-empty string
    example{{api_key}}
  • locationQuerystringrequired

    Region of the load balancer.

    • must be a non-empty string
    example{{location}}

Responses

200Successful response
object

For the HTTP response-code metrics, labels holds the response classes and results the matching counts. For range metrics, labels holds timestamps and results the per-timestamp values.

codeinteger
example200
dataobject
errorsobject
messagestring
exampleSuccess