Skip to main content

d1_analytics_adaptive_groups

Analytics resource

This is a time-bounded analytics resource. Queries against it differ from typical CRUD resources in a few ways:

  • since and until are required. Both are RFC3339 timestamps and define the analytics window (e.g. since = '2026-05-28T00:00:00Z', until = '2026-05-29T00:00:00Z'). Queries without them will fail.
  • Row cap via limit. The limit parameter (default 100) bounds the response. Widen the time window or raise limit to return more rows.
  • Token scope. Cloudflare's analytics endpoints require an API token with Account -> Analytics -> Read permission, which is broader than typical zone-scoped tokens. A token without it will return empty results.

Creates, updates, deletes, gets or lists a d1_analytics_adaptive_groups resource.

Overview

Named1_analytics_adaptive_groups
TypeResource
Idcloudflare.d1.d1_analytics_adaptive_groups

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
database_idstringD1 database UUID.
database_rolestringPrimary / replica role of the instance serving the request.
datetimestring (date-time)
query_batch_response_bytesintegerTotal response bytes across batches.
read_queriesintegerRead query count.
requestsintegerTotal D1 request count for the tuple.
rows_readintegerRows read by queries.
rows_writtenintegerRows written by queries.
served_by_regionstringRegion of the D1 instance that served the request.
write_queriesintegerWrite query count.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_tag, since, untillimitCloudflare D1 database analytics for an account, grouped by database, serving instance, and region. Per-tuple totals for request count, read/write query counts, rows read/written, and response bytes.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
account_tagstringCloudflare account ID (the 32-char hex tag).
sincestring (date-time)Lower bound (inclusive). RFC3339.
untilstring (date-time)Upper bound (exclusive). RFC3339.
limitintegerMaximum dimension-tuple rows per call.

SELECT examples

Cloudflare D1 database analytics for an account, grouped by database, serving instance, and region. Per-tuple totals for request count, read/write query counts, rows read/written, and response bytes.

SELECT
database_id,
database_role,
datetime,
query_batch_response_bytes,
read_queries,
requests,
rows_read,
rows_written,
served_by_region,
write_queries
FROM cloudflare.d1.d1_analytics_adaptive_groups
WHERE account_tag = '{{ account_tag }}' -- required
AND since = '{{ since }}' -- required
AND until = '{{ until }}' -- required
AND limit = '{{ limit }}'
;