Skip to main content

GET /metrics//

Retrieve usage metrics for a specific stream within a basin. This endpoint provides stream-level storage information.

Path Parameters

basin
string
required
Basin name containing the stream
stream
string
required
Stream name to retrieve metrics for

Query Parameters

set
string
required
Metric set to return. Available values:
  • storage - Amount of stored data, per minute, for the specific stream
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 stream 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/my-stream?set=storage&start=1704067200&end=1704153600&interval=minute" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
{
  "values": [
    {
      "gauge": {
        "name": "storage",
        "unit": "bytes",
        "values": [
          [1704067200, 268435456],
          [1704067260, 268697600],
          [1704067320, 268959744],
          [1704067380, 269221888]
        ]
      }
    }
  ]
}

Error Responses

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

Notes

  • Storage metrics represent the instantaneous amount of data stored in the stream at each timestamp
  • The storage metric uses a gauge type, meaning each data point represents the value at that specific point in time
  • Finer granularity (minute intervals) provides more detailed tracking of storage growth over time

Build docs developers (and LLMs) love