Skip to content
Aa

Load balancer metrics

Use the discovered XCSH_VIRTUAL_HOST to read traffic arriving at the load balancer and forwarding toward its origin.

The query selects XCSH_NAMESPACE and the discovered XCSH_VIRTUAL_HOST over the fixed two-hour XCSH_START_TIME–XCSH_END_TIME window with five-minute buckets. Ingress and egress selectors require group_by: ["VHOST"] for this deployment. Combining them with SERVICE grouping can return HTTP 500.

  1. Build a request grouped by virtual host.

    Terminal window
    XCSH_REQUEST="$(jq -nc --arg ns "<XCSH_NAMESPACE>" --arg start "$XCSH_START_TIME" \
    --arg end "$XCSH_END_TIME" --arg vh "<XCSH_VIRTUAL_HOST>" '{
    namespace: $ns, start_time: $start, end_time: $end,
    step: "5m", range: "5m", group_by: ["VHOST"],
    label_filter: [{label: "LABEL_VHOST", op: "EQ", value: $vh}],
    field_selector: {node: {metric: {upstream: [
    "HTTP_REQUEST_RATE", "HTTP_ERROR_RATE", "HTTP_ERROR_RATE_4XX",
    "HTTP_ERROR_RATE_5XX", "HTTP_RESPONSE_LATENCY",
    "REQUEST_THROUGHPUT", "RESPONSE_THROUGHPUT", "REQUEST_TO_ORIGIN_RATE",
    "CLIENT_RTT", "SERVER_RTT", "HTTP_SERVER_DATA_TRANSFER_TIME",
    "HTTP_INGRESS_REQUEST_RATE", "HTTP_EGRESS_REQUEST_RATE",
    "HTTP_RESPONSE_LATENCY_PERCENTILE_50",
    "HTTP_RESPONSE_LATENCY_PERCENTILE_90",
    "HTTP_RESPONSE_LATENCY_PERCENTILE_99",
    "ACTIVE_CONNECTIONS", "NEW_CONNECTION_RATE"
    ]}}}
    }')"
  2. Query and summarize the returned series.

    Terminal window
    XCSH_TRAFFIC_JSON="$(curl --silent --show-error --fail-with-body --max-time 60 \
    --request POST \
    --header "Authorization: APIToken <XCSH_API_TOKEN>" \
    --header 'Content-Type: application/json' \
    --data-binary "$XCSH_REQUEST" \
    "<XCSH_API_URL>/api/data/namespaces/<XCSH_NAMESPACE>/graph/service")"
    jq -er --arg vh "<XCSH_VIRTUAL_HOST>" '
    def summary: {type, unit, points: (.value.raw | length),
    latest: (.value.raw[-1] // null)};
    {step, virtual_host: $vh,
    metrics: ([.data.nodes[]? | select(.id.vhost == $vh)
    | .data.metric.upstream[]? | summary] | sort_by(.type)),
    unavailable: (["ACTIVE_CONNECTIONS", "NEW_CONNECTION_RATE"] -
    [.data.nodes[]? | select(.id.vhost == $vh) | .data.metric.upstream[]?.type])}
    ' <<<"$XCSH_TRAFFIC_JSON"

Captured 2026-10-06T03:13:42Z; HTTP 200.

{
"step": "5m",
"virtual_host": "<XCSH_VIRTUAL_HOST>",
"metrics": [
{
"type": "CLIENT_RTT",
"unit": "UNIT_SECONDS",
"points": 14,
"latest": {
"timestamp": 1791255900,
"value": "0.0010500000000000002",
"trend_value": null
}
},
{
"type": "HTTP_EGRESS_REQUEST_RATE",
"unit": "UNIT_REQUESTS_PER_SECOND",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "0.03734316666666666",
"trend_value": null
}
},
{
"type": "HTTP_ERROR_RATE",
"unit": "UNIT_ERRORS_PER_SECOND",
"points": 5,
"latest": {
"timestamp": 1791253200,
"value": "0",
"trend_value": null
}
},
{
"type": "HTTP_ERROR_RATE_4XX",
"unit": "UNIT_ERRORS_PER_SECOND",
"points": 5,
"latest": {
"timestamp": 1791253200,
"value": "0",
"trend_value": null
}
},
{
"type": "HTTP_INGRESS_REQUEST_RATE",
"unit": "UNIT_REQUESTS_PER_SECOND",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "0.04150983333333333",
"trend_value": null
}
},
{
"type": "HTTP_REQUEST_RATE",
"unit": "UNIT_REQUESTS_PER_SECOND",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "0.02860921837322622",
"trend_value": null
}
},
{
"type": "HTTP_RESPONSE_LATENCY",
"unit": "UNIT_SECONDS",
"points": 14,
"latest": {
"timestamp": 1791255900,
"value": "0.8850000000000001",
"trend_value": null
}
},
{
"type": "HTTP_RESPONSE_LATENCY_PERCENTILE_50",
"unit": "UNIT_SECONDS",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "NaN",
"trend_value": null
}
},
{
"type": "HTTP_RESPONSE_LATENCY_PERCENTILE_90",
"unit": "UNIT_MILLISECONDS",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "NaN",
"trend_value": null
}
},
{
"type": "HTTP_RESPONSE_LATENCY_PERCENTILE_99",
"unit": "UNIT_SECONDS",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "NaN",
"trend_value": null
}
},
{
"type": "HTTP_SERVER_DATA_TRANSFER_TIME",
"unit": "UNIT_SECONDS",
"points": 12,
"latest": {
"timestamp": 1791255900,
"value": "0",
"trend_value": null
}
},
{
"type": "REQUEST_THROUGHPUT",
"unit": "UNIT_BITS_PER_SECOND",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "82.46763041554156",
"trend_value": null
}
},
{
"type": "REQUEST_TO_ORIGIN_RATE",
"unit": "UNIT_REQUESTS_PER_SECOND",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "0.02860921837322622",
"trend_value": null
}
},
{
"type": "RESPONSE_THROUGHPUT",
"unit": "UNIT_BITS_PER_SECOND",
"points": 25,
"latest": {
"timestamp": 1791256200,
"value": "153.03037615105956",
"trend_value": null
}
},
{
"type": "SERVER_RTT",
"unit": "UNIT_SECONDS",
"points": 12,
"latest": {
"timestamp": 1791255900,
"value": "0.43500000000000005",
"trend_value": null
}
}
],
"unavailable": [
"ACTIVE_CONNECTIONS",
"NEW_CONNECTION_RATE"
]
}
MetricMeaningReturned unit
HTTP_REQUEST_RATEHTTP requests per secondUNIT_REQUESTS_PER_SECOND
HTTP_ERROR_RATE, HTTP_ERROR_RATE_4XX, HTTP_ERROR_RATE_5XXError rates by response classUNIT_ERRORS_PER_SECOND
REQUEST_THROUGHPUT, RESPONSE_THROUGHPUTRequest and response bit rateUNIT_BITS_PER_SECOND
HTTP_INGRESS_REQUEST_RATE, HTTP_EGRESS_REQUEST_RATEIncoming and outgoing request rateUNIT_REQUESTS_PER_SECOND
REQUEST_TO_ORIGIN_RATERequests forwarded to origin per secondUNIT_REQUESTS_PER_SECOND
CLIENT_RTT, SERVER_RTTAverage client/server round-trip timeUNIT_SECONDS
HTTP_RESPONSE_LATENCY and its percentile selectorsResponse latencyRead each returned unit

These measurements have different scopes and sampling behavior; ingress, egress, and origin rates need not match exactly. They do not produce exact request counts. Use HTTP access logs for counts, and origin performance to isolate the matched destination.

points counts metric samples, not requests. latest.timestamp is the returned bucket time in Unix seconds, which can precede capture time. Empty connection series remain supported but unavailable in this demo window. Inspect latest.value together with unit; preserve a surprising returned unit instead of silently relabeling it.

Both graph queries returned HTTP 200. The baseline was captured at 2026-10-06T03:09:23Z, before the bounded request sequence; the later query was captured at 2026-10-06T03:15:53Z. Each cell preserves the latest returned Unix timestamp and string value. The later request-rate point advanced from 03:05 to 03:15 UTC; a later bucket proves available telemetry, not attribution of every request.

MetricReturned unitBaseline timestamp and valueLater timestamp and value
HTTP_REQUEST_RATEUNIT_REQUESTS_PER_SECOND1791255900: 0.038500833333333331791256500: 0.019619002305555557
REQUEST_THROUGHPUTUNIT_BITS_PER_SECOND1791255900: 110.522406666666671791256500: 55.61405410244444
RESPONSE_THROUGHPUTUNIT_BITS_PER_SECOND1791255900: 200.541420154888931791256500: 53.68032719333334
HTTP_INGRESS_REQUEST_RATEUNIT_REQUESTS_PER_SECOND1791255900: 0.051791256500: 0.016666666666666666
HTTP_EGRESS_REQUEST_RATEUNIT_REQUESTS_PER_SECOND1791255900: 0.0416666666666666641791256500: 0.0231765
REQUEST_TO_ORIGIN_RATEUNIT_REQUESTS_PER_SECOND1791255900: 0.038500833333333331791256500: 0.019619002305555557
CLIENT_RTTUNIT_SECONDS1791255900: 0.00105000000000000021791256500: 0.0010500000000000002
SERVER_RTTUNIT_SECONDS1791255900: 0.435000000000000051791255900: 0.43500000000000005
HTTP_SERVER_DATA_TRANSFER_TIMEUNIT_SECONDS1791255900: 01791255900: 0
HTTP_ERROR_RATE_4XXUNIT_ERRORS_PER_SECOND1791253200: 01791253200: 0
HTTP_ERROR_RATE_5XXNo returned unitNo returned seriesNo returned series

The latest 4xx error point remained at 02:20 UTC and the 5xx error series was absent, even though access logs contained the explicit 404 and 503 responses. Those graph error metrics had not supplied meaningful points for the sequence at this capture. Do not turn a stale zero or an absent series into proof of successful requests. Use the complete log counts for observed outcomes.