analytics
Query runtime log data
A query can use only the public alias runtime_logs_v1. CTEs, subqueries, UNION, and EXCEPT are permitted. The root key must have the project.*.read_runtime_logs permission. Unkey limits each query to the workspace of the root key. To get the logs of one project, app, environment, or deployment, add a filter on project_id, app_id, environment_id, or deployment_id. The workspace retention period and the workspace query limits apply. For the table, the columns, and more query examples, see Query runtime logs.
post/v2/analytics.getRuntimeLogs
Request body
Example request
{
"query": "SELECT time, severity, message FROM runtime_logs_v1 WHERE lower(message) LIKE '%timeout%' ORDER BY time DESC LIMIT 100"
}Response
Query executed successfully
Example response
{
"meta": {
"requestId": "req_123"
},
"data": [
{
"time": 1755000000000,
"severity": "error",
"message": "upstream timeout after 30s"
}
]
}