/api/... calls as its most visited “pages”. The beta traffic-analytics feature fixes that: the edge sorts each request into one class, and Top pages counts page views only.
It is off by default. Turn it on in Settings, Beta features (it applies live), with levelrail-cli settings beta-features set traffic-analytics on, or list it in APP_EXPERIMENTAL. See Experimental features.
The classes
Each request gets exactly one class when the response header is known. The first step that matches wins.
Path rules come first so an operator can correct a misclassified framework. Bots come before
Sec-Fetch-Dest because headless browsers send document. Sec-Fetch-Dest beats the response type, so an XHR that returns HTML (HTMX, Turbo partials) is not a page view.
A page-class request counts as a page view only when it is a GET with a 2xx status. Redirects and 404 or 5xx documents are not page views. Bot names come from the client’s own User-Agent: they are claims, not verified identities, and crawlers are not checked by reverse DNS.
What you see
With the feature on:- Top pages lists page views only, per normalized path (ids collapsed, trailing slash folded, at most 128 bytes).
- A small split under the totals shows page, API, asset, bot, prefetch and other request counts, so the calls that used to crowd the list are still visible.
- An app with requests but no page views shows “No page views yet” with the API, asset and bot counts instead of an empty list.
levelrail-cli apps visitors <app>prints the same split and aPAGE VIEWStable. The JSON body ofGET /api/v1/apps/{name}/visitorsgainsclasses,top_pagesandpages_only;top_pathsand every older field are unchanged. The CSV export gainsclassandpagerows.
Limits and settings
- Single page apps that change routes in the browser without a request (other than Next.js) are invisible to the edge.
APP_TRAFFIC_PAGE_LABELS(default500) caps the distinct page paths kept per app and hour in the stored rollups. Paths past the cap are counted under(other).APP_TRAFFIC_RULES_MAX(default50) caps path rules per app.- Memory: the class is one byte on each access log record. The rollup keeps at most
APP_TRAFFIC_PAGE_LABELSlabels per app, domain and hour, and flushes the top 10 (APP_VISITOR_ROLLUP_TOP_N). - No client address, User-Agent or query string is stored by this feature.