Skip to main content

GET /metrics

Retrieve account-level metrics for your S2 account. This endpoint allows you to query different metric sets with optional time ranges and aggregation intervals.

Query Parameters

set
string
required
Metric set to return. Available values:
  • active-basins - Set of all basins that had at least one stream during the specified period
  • account-ops - Count of append RPC operations, per interval
start
integer
Start timestamp as Unix epoch seconds. Required for timeseries metric sets.
end
integer
End timestamp as Unix epoch seconds. Required for timeseries metric sets.
interval
string
Interval to aggregate over for timeseries metric sets. Available values:
  • minute
  • hour
  • day

Response

Returns a MetricSetResponse object containing the requested metrics.
values
array
Array of metrics comprising the set. Each metric can be one of four types:
curl -X GET "https://aws.s2.dev/v1/metrics?set=active-basins&start=1704067200&end=1704153600" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "values": [
    {
      "label": {
        "name": "active-basins",
        "values": ["analytics", "logs", "events"]
      }
    }
  ]
}

Error Responses

400
Bad Request
Invalid query parameters or malformed request
403
Forbidden
Invalid or missing authentication token
408
Request Timeout
Request took too long to process

Build docs developers (and LLMs) love