Observability
Live database metrics for a project.
Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/observability"{ "observability": { "active_queries": [ { "duration_ms": 0, "pid": 0, "query": "string", "state": "string", "username": "string", "wait_event": "string", "wait_event_type": "string" } ], "alerts": [ "string" ], "connection_count": 0, "connection_limit": 0, "connection_usage_percent": 0, "database_size_bytes": 0, "pg_stat_statements": true, "slow_queries": [ { "calls": 0, "mean_time_ms": 0, "query": "string", "rows": 0, "total_time_ms": 0 } ], "storage_limit_bytes": 0, "storage_usage_percent": 0 }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
Trailing window in hours, between 1 and 720 (default 24).
1 <= value <= 72024Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/observability/history"{ "samples": [ { "active_queries": 0, "avg_query_ms": 0, "blocked_queries": 0, "cache_hit_ratio": 0, "connection_limit": 0, "connections": 0, "dead_tuples": 0, "deadlocks": 0, "rollback_ratio": 0, "rows_read_per_sec": 0, "rows_written_per_sec": 0, "sampled_at": "2019-08-24T14:15:22Z", "slow_queries": 0, "storage_bytes": 0, "storage_limit_bytes": 0, "temp_bytes": 0, "tps": 0 } ]}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
Trailing window in hours, between 1 and 168 (default 24).
1 <= value <= 16824Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/observability/queries"{ "queries": [ { "query_hash": "string", "calls": 0, "mean_exec_ms": 0, "query": "string", "rows": 0, "total_exec_ms": 0 } ]}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/alerts"{ "alerts": [ { "acknowledged_at": "2019-08-24T14:15:22Z", "id": "string", "kind": "storage", "last_notified_at": "2019-08-24T14:15:22Z", "limit_value": 0, "observed_value": 0, "project_id": "string", "resolved_at": "2019-08-24T14:15:22Z", "severity": "warning", "triggered_at": "2019-08-24T14:15:22Z" } ]}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Project alert identifier.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/projects/string/alerts/string/acknowledge"{ "alert": { "acknowledged_at": "2019-08-24T14:15:22Z", "id": "string", "kind": "storage", "last_notified_at": "2019-08-24T14:15:22Z", "limit_value": 0, "observed_value": 0, "project_id": "string", "resolved_at": "2019-08-24T14:15:22Z", "severity": "warning", "triggered_at": "2019-08-24T14:15:22Z" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
The statement's identity hash from the top-queries listing (32-character hex digest).
^[0-9a-f]{32}$Query Parameters
Trailing window in hours, between 1 and 168 (default 24).
1 <= value <= 16824Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/observability/queries/string"{ "query": { "query_hash": "string", "query": "string", "window_calls": 0, "window_total_exec_ms": 0, "window_mean_exec_ms": 0, "window_rows": 0, "points": [ { "captured_at": "2019-08-24T14:15:22Z", "calls": 0, "total_exec_ms": 0, "rows": 0, "mean_exec_ms": 0, "calls_per_sec": 0 } ] }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
Trailing window in hours, between 1 and 168 (default 1). Ignored when cursor is set.
1 <= value <= 1681Resume strictly after a previously returned entry's cursor (tail mode). Takes precedence over hours.
Comma-separated severity filter (debug, log, info, notice, warning, error, fatal, panic, detail). Empty means all severities.
Maximum entries returned, between 1 and 500 (default 200). The newest entries are kept.
1 <= value <= 500200Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/logs"{ "logs": { "entries": [ { "timestamp": "2019-08-24T14:15:22Z", "severity": "debug", "message": "string", "cursor": "string" } ], "next_cursor": "string" }}Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Query Parameters
Trailing window in hours, between 1 and 168 (default 1). Ignored when cursor is set.
1 <= value <= 1681Resume strictly after a previously returned entry's cursor (tail mode). Takes precedence over hours.
Comma-separated severity filter (debug, log, info, notice, warning, error, fatal, panic, detail). Empty means all severities.
Maximum entries returned, between 1 and 500 (default 200). The newest entries are kept.
1 <= value <= 500200Response Body
text/event-stream
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/logs/stream""string"Org or project-scoped API key, format capy_live_...; Clerk session tokens also accepted.
In: header
Path Parameters
Project id.
Response Body
text/event-stream
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/v1/projects/string/events""string"