Authentication
Requires a valid access token in the Authorization header.
Path Parameters
The UUID of the tunnel to retrieve metrics for. Must belong to the authenticated user.
Query Parameters
ISO 8601 timestamp representing the start of the time range (inclusive).
ISO 8601 timestamp representing the end of the time range (inclusive). Must be greater than or equal to from.
Response
Returns an array of metrics points ordered by capture time. Each point represents a downsampled snapshot taken approximately every 10 seconds.
ISO 8601 timestamp when the metrics point was captured.
Total number of connections since tunnel start at this point in time.
Current number of open/active connections at this point in time.
Response time for the 1st percentile in milliseconds, or null if unavailable.
Response time for the 90th percentile in milliseconds, or null if unavailable.
Total number of requests processed at this point in time.
Total number of errors encountered at this point in time.
Total number of bytes transferred at this point in time.
Metrics history is retained for 7 days. Queries beyond this retention period will return an empty array for those time ranges.
The response is limited to a maximum of 5000 points per request. If your time range contains more points, consider narrowing the from and to window or paginating through smaller time ranges.
The from timestamp must be less than or equal to the to timestamp. Invalid date formats or reversed ranges will result in a 400 error.
Example Request
curl -X GET "https://api.rs-tunnel.example.com/v1/tunnels/550e8400-e29b-41d4-a716-446655440000/metrics?from=2024-03-15T10:00:00Z&to=2024-03-15T11:00:00Z" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Response
[
{
"capturedAt": "2024-03-15T10:00:00.000Z",
"ttl": 1420,
"opn": 10,
"rt1Ms": 4.8,
"p90Ms": 115.2,
"requests": 1398,
"errors": 20,
"bytes": 4893184
},
{
"capturedAt": "2024-03-15T10:00:10.000Z",
"ttl": 1435,
"opn": 11,
"rt1Ms": 5.1,
"p90Ms": 118.7,
"requests": 1412,
"errors": 21,
"bytes": 4952320
},
{
"capturedAt": "2024-03-15T10:00:20.000Z",
"ttl": 1450,
"opn": 12,
"rt1Ms": 5.3,
"p90Ms": 121.4,
"requests": 1426,
"errors": 22,
"bytes": 5011456
}
]
Error Responses
Human-readable error message.
Additional error details, if available.
Common Errors
- 400 INVALID_TUNNEL_ID: Tunnel identifier is missing or malformed
- 400 INVALID_INPUT: Missing or invalid
from/to query parameters, or from > to
- 404 TUNNEL_NOT_FOUND: The tunnel does not exist or does not belong to the authenticated user
- 401 UNAUTHORIZED: Missing or invalid access token