Projects
Get project metrics
Returns recent project metrics snapshots, optionally filtered by region.
Feature flag: project-analytics
This endpoint is currently under a feature flag and available only to select testers. It may change or be removed before general availability.
At a glance
| Item | Value |
|---|---|
| Method | GET |
| Path | /v1/projects/{project_id}/metrics |
| Auth | Authorization: Bearer <token-or-api-key> |
Quick request
Use this as a starting point. Replace the placeholder IDs and set PGBEAM_TOKEN if the endpoint requires auth.
curl -X GET \
"$PGBEAM_API_URL/v1/projects/<project_id>/metrics" \
-H "Authorization: Bearer $PGBEAM_TOKEN"AuthorizationBearer <token>
JWT issued by Better Auth. Verified via JWKS.
In: header
Path Parameters
project_id*string
Unique project identifier (prefixed, e.g. prj_xxx).
Match
^[a-zA-Z0-9_.-]+$Query Parameters
limit?integer
Maximum number of recent snapshots to return.
Default
60Range
1 <= value <= 1000region?string
Filter metrics by region code.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://api.pgbeam.com/v1/projects/string/metrics"{
"snapshots": [
{
"id": "string",
"project_id": "string",
"region": "string",
"queries_total": 0,
"cache_hits": 0,
"cache_misses": 0,
"active_connections": 0,
"avg_latency_ms": 0.1,
"p99_latency_ms": 0.1,
"avg_connect_ms": 0.1,
"avg_query_ms": 0.1,
"created_at": "2019-08-24T14:15:22Z"
}
]
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}