Skip to content

Analytics settings, limits and scope Since v0.2 ​

Analytics queries read the traffic and event stores, so every query is bounded. The bounds are settings you can change. They apply to the next query without a restart, an empty value keeps the default, and every value has a hard upper bound.

Before you begin ​

  • Role: operator with access to every application changes the analytics settings.
  • Raising the row and concurrency limits costs management-node CPU and disk reads. The traffic writer is never blocked, because queries use the read-only connection. Raise max_concurrent only on nodes with spare cores.

Change the limits ​

text
1. Open System > Settings > Analytics.
2. Change the values under Query cost, Ranges and results and Load.
3. Select Preview changes, then Apply.
sh
waap settings get analytics
waap settings set analytics -m "more headroom" max_scan_rows=1000000 max_concurrent=4
yaml
analytics:
  max_scan_rows: 1000000
  max_concurrent: 4

Settings reference ​

Query cost ​

SettingWhat it doesDefaultAllowed valuesApplies in
Rows per query (analytics.max_scan_rows)Rows one query reads. A query over more reads a sample and stops there ("truncated").2500001000 to 5000000all
Rows per batch (analytics.max_batch_rows)Rows all queries of one batch (a page or dashboard load) read together.1000000at least max_scan_rows, at most 20000000all
Sample above (analytics.sample_above_rows)Estimated rows above which a query reads a sample. Lower it for faster, more often estimated answers.max_scan_rows1000 to max_scan_rowsall
Time per query (analytics.query_timeout)A query running longer is stopped (504).5s1s to 60sall
Time per batch (analytics.batch_timeout)A batch running longer answers 504 for its remaining queries.15squery_timeout to 120sall

Ranges and results ​

SettingWhat it doesDefaultAllowed valuesApplies in
Longest traffic range (analytics.max_range_traffic)Longest time range of a traffic query.744h (31 days)1h to 744h, and never more than traffic.retentiontraffic queries
Longest events range (analytics.max_range_events)Longest time range of an events query.2160h (90 days)1h to 8784h (366 days)events queries
Rollups from (analytics.rollup_min_range)Unfiltered top values over at least this range come from the hourly rollups.2h1h to 168hunfiltered top values
Buckets per chart (analytics.max_buckets)Most points of a time series. A longer range takes the next bucket size (1m, 5m, 15m, 1h, 6h, 1d).36060 to 1440all
Values per top list (analytics.max_top_n)Most values a top list may ask for.10010 to 500all

Load ​

SettingWhat it doesDefaultAllowed valuesApplies in
Queries at once (analytics.max_concurrent)Queries running at once on each node.21 to 16per node
Queries waiting (analytics.max_queued)Queries that may wait for a slot on each node; more answer 429.81 to 64per node
Requests per user (analytics.per_user_per_minute)Analytics requests one user makes per minute on each node. A batch is one request, and cached answers are free.601 to 1000per node
Reuse answers for (analytics.cache_ttl)The same query from the same user (same role and scope) within this time is answered from memory, marked cached. Over budget, a batch still returns its cached answers.30s1s to 10mall

Fixed limits: 48 queries per batch, 10 split series plus "other", 4096 applications in one scope.

Settings that change what there is to query live elsewhere: traffic (mode, sample rate, retention), events.retention and the enrichment section. For details, see Traffic log and Fingerprints and enrichment.

Lists that use a filter ​

The Traffic and Events lists, event groups, the overview statistics and both exports take the explorer's filter (q=). A read with q counts as an analytics query for the limits:

  • It counts one query against Requests per user (an export or a statistics call counts once).
  • It takes a place among Queries at once and Queries waiting, and answers 429 with Retry-After when full.
  • It stops after Time per query (504), or Time per batch for exports and statistics.
  • It reads at most the longest range. Without since it reads that far back, and a longer span is refused (400, "max_range"). For events older than the range, give since and until around them.

The same lists without q keep their usual behaviour.

Light lists. GET /v1/traffic and GET /v1/events take fields= (comma-separated catalogue names, at most 64, plus request). Each record comes back with only those members, without captured headers, bodies and traces. The column picker uses it, and so do waap traffic list -fields and waap events list -fields. An unknown name, a name of the other source or a field your role may not use is refused (400).

Order and request IDs. GET /v1/traffic?order=oldest lists the oldest matching records first (no next cursor: raise limit, at most 1,000). The default order=newest pages with next. The field request.id filters both sources by request ID: on traffic the record's ID, on events the transaction ID. They are the same value for one request.

AS names. Top-value answers for client.asn carry a label with the organisation recorded with the request. Views print "13335 – Cloudflare, Inc." and filter on the number.

Audit ​

Analytics queries, batches and filter checks only read, so they are not written to the audit log (a dashboard would write one entry per widget per refresh). They are counted per node in waap_analytics_queries_total{result} with the results ok, busy, timeout and failed. A query refused for authorization (401, 403) is still audited, and so is every change: saved filters, dashboards, rule drafts and exports. A batch answers 200 even when some of its queries are refused for the role or the scope. Such a batch is audited as "N of M queries refused for authorization".

Viewers, masking and scope ​

  • Every query is limited to the applications the account may see. Cross-application top values never include another application's values.
  • The viewer role cannot filter or group by fields that hold names or free text (query, user, identity; waap analytics fields shows which). The error is "field not available to your role". This stops filters being used to guess masked values.
  • On fields whose values are masked for a viewer (such as path), a viewer may use only =, in and exists. Partial matches (~, !~, ^=, $=) and the negated forms (!=, not in, missing) are refused with 403, so a viewer cannot recover a masked card number or token one piece at a time. Operators and admins keep every operator.
  • Group keys of request values (such as path) are masked for a viewer like other values. Keys that become equal after masking are merged and their counts added. An application with policy.logging.mask: pci already stores masked values.
  • A shared dashboard widget that uses a restricted field shows "Not available to your role" to a viewer.

In a high-availability pair ​

  • Events are replicated, so Events analytics answer for the whole cluster.
  • Traffic records and the hourly rollups stay on the node that served the request. Traffic analytics, the explorer on Traffic and Sampled requests answer for the node you are connected to. To see another node, open that node's management address. There is no node selector yet: asking for another node by name is refused with this explanation.
  • Dashboards, saved filters, script and rate-limit results and learned volume baselines are replicated.

Limits ​

LimitValue
Queries per batch48
Applications in one scope4096
Light list fields64
Values per in50

Troubleshooting ​

Analytics answer 429 ​

  • Cause: the node is busy (max_queued reached) or you are over Requests per user.
  • Check: Retry-After in the answer, and waap_analytics_queries_total{result="busy"}.
  • Fix: wait, narrow the range, or raise the limits.

Analytics answer 504 ​

  • Cause: a query ran longer than Time per query.
  • Fix: narrow the range or add a filter. A narrower query is read in full.

Counts show "Estimated from a sample" ​

  • Cause: a broad filter over a long range would read more than Rows per query.
  • Fix: narrow the range or add a filter, or raise the limit.