Skip to main content

GET /metrics/

Retrieve usage metrics for a specific basin. This endpoint provides detailed insights into basin-level operations, throughput, and storage.

Path Parameters

basin
string
required
Basin name to retrieve metrics for

Query Parameters

set
string
required
Metric set to return. Available values:
  • storage - Amount of stored data, per hour, aggregated over all streams in the basin
  • append-ops - Append operations, per interval
  • read-ops - Read operations, per interval
  • read-throughput - Read bytes, per interval
  • append-throughput - Appended bytes, per interval
  • basin-ops - Count of basin 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 basin 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/my-basin?set=storage&start=1704067200&end=1704153600&interval=hour" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "values": [
    {
      "gauge": {
        "name": "storage",
        "unit": "bytes",
        "values": [
          [1704067200, 1073741824],
          [1704070800, 1082130432],
          [1704074400, 1090519040]
        ]
      }
    }
  ]
}

Error Responses

400
Bad Request
Invalid query parameters, malformed request, or invalid basin name
403
Forbidden
Invalid or missing authentication token, or insufficient permissions for the basin
408
Request Timeout
Request took too long to process

Build docs developers (and LLMs) love