Compare Traffic Metrics
Side-by-side comparison of multiple endpoints over a single time window. Returns one metric block per endpoint — useful for comparing the volume/error/latency profile of several endpoints at once. Same metric set as /traffic/metrics for each endpoint.
Requires the traffic-inspector read permission on the active account.
Query parameters
endpoint_uuids string[] (uuid, repeatable) Req
One or more endpoint uuids to compare. Repeat the parameter (
endpoint_uuids=…&endpoint_uuids=…). At least one is required.time_range string
Window length applied to every endpoint. One of
5m, 1h, 24h, 7d, 30d, 90d. Defaults to 24h.Deprecated: endpoint_ids (the old name of this filter; it takes endpoint uuids) is still accepted until the sunset. Send endpoint_uuids; sending both with different sets or orders is a 400 id_uuid_mismatch.
Response (200 OK)
<endpoint_uuid> object
A map keyed by each requested endpoint UUID. Each value is the full metric block from /traffic/metrics for that endpoint over the window. Endpoints that error during aggregation are omitted from the map.
Errors
400 Bad Request
No
endpoint_uuids supplied, invalid time_range, or endpoint_ids and endpoint_uuids naming different endpoints or a different order (id_uuid_mismatch).401 Unauthorized
Missing auth.
403 Forbidden
No active account, not a member, or missing the traffic-inspector read permission.
Request — compare two endpoints over 24h
curl "https://api.ngris.com/v1/traffic/metrics/compare?\
endpoint_uuids=019bb1e4-e785-77d2-9966-c3cff31d0a0e&endpoint_uuids=019bbbc9-0ab9-73bf-bde0-b17760041b59&time_range=24h" \
-H "X-API-KEY: <your_api_key>"
Python
from ngris import Ngris
client = Ngris(api_key="<your_api_key>")
r = client._get_raw("/traffic/metrics/compare", params={
"endpoint_uuids": ["019bb1e4-e785-77d2-9966-c3cff31d0a0e", "019bbbc9-0ab9-73bf-bde0-b17760041b59"],
"time_range": "24h",
})
for uuid, m in r.items():
print(f"{uuid}: {m['total_requests']} req err={m['error_rate']:.2f}%")
Response — 200 OK (excerpt)
{
"019bb1e4-e785-77d2-9966-c3cff31d0a0e": {
"total_requests": 100000, "error_rate": 0.05,
"p99_response_time": 250, "total_bandwidth": 4444444
},
"019bbbc9-0ab9-73bf-bde0-b17760041b59": {
"total_requests": 130000, "error_rate": 0.05,
"p99_response_time": 237, "total_bandwidth": 6120044
}
}
Was this helpful?