api-query_insights

List branch queries

Authorization

A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:

Service Token Accesses read_databases, read_database

OAuth Scopes

ResourceScopes
Organizationread_databases
Databaseread_database
get/organizations/{organization}/databases/{database}/branches/{branch}/insights

Path parameters

organizationstring required

Organization name slug from list_organizations. Example: acme.

databasestring required

Database name slug from list_databases. Example: app-db.

branchstring required

Branch name from list_branches. Example: main.

Query parameters

qstring

Search query statistics by SQL pattern

fromstring

Start time for filtering query statistics (ISO 8601 timestamp)

tostring

End time for filtering query statistics (ISO 8601 timestamp)

period'15m' | '1h' | '3h' | '6h' | '12h' | '1d' | '2d' | '7d' | '8d'

Time period for filtering query statistics

sort'keyspace' | 'query' | 'lastRun' | 'count' | 'errorCount' | 'rowsRead' | 'rowsAffected' | 'rowsReturned' | 'rowsReadPerReturned' | 'rowsReadPerQuery' | 'rowsReturnedPerQuery' | 'rowsAffectedPerQuery' | 'totalTime' | 'cpuTime' | 'ioTime' | 'sumShardQueries' | 'maxShardQueries' | 'avgShardQueries' | 'avgParallelWorkers' | 'table' | 'qualifiedTable' | 'tableKeyspace' | 'indexes' | 'routingIndexes' | 'p50Latency' | 'p99Latency' | 'maxLatency' | 'percentTime' | 'percentCpuTime' | 'percentIoTime' | 'egressBytes' | 'egressBytesPerQuery' | 'maxEgressBytes' | 'ingressBytes' | 'ingressBytesPerQuery' | 'maxIngressBytes' | 'blocksRead' | 'blocksHit' | 'blockCacheHitRatio' | 'blocksDirtied' | 'blocksWritten' | 'trafficControlWarnings' | 'trafficControlThrottled' | 'trafficControlChecked' | 'trafficControlBudgetsUsed'

Field to sort by

dir'asc' | 'desc'

Sort direction

tablet_type'primary' | 'replica' | 'rdonly'

Filter by tablet type

type'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE'

Filter by statement type

fieldsstring[]

Specific fields to include in the response

pageinteger

If provided, specifies the page offset of returned results

per_pageinteger

If provided, specifies the number of returned results

Response

Returns query statistics summaries

typestring required

The response type. Always "list" for paginated responses.

current_pageinteger required

The current page number

per_pageinteger required

The maximum number of results per page

next_pageinteger nullable required

The next page number, or null when this is the last page

next_page_urlstring nullable required

The next page of results, or null when this is the last page

prev_pageinteger nullable required

The previous page number, or null when this is the first page

prev_page_urlstring nullable required

The previous page of results, or null when this is the first page

Changes