Skip to content

stats pipeline: named agents and scanner probe families - #1466

Merged
aaylward merged 2 commits into
mainfrom
stats-bot-traffic
Sep 1, 2026
Merged

stats pipeline: named agents and scanner probe families#1466
aaylward merged 2 commits into
mainfrom
stats-bot-traffic

Conversation

@aaylward

@aaylward aaylward commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Part of #1365, the stats-table half of #1458.

Each request_stats row now carries a bounded agent name (the marker for AI scrapers and named bots, the UA's product token for the anonymous tail, capped at 500 distinct per object), and a new probe_stats counts requests whose path matches one of eleven scanner families. Served at GET /stats/v1/agents and GET /stats/v1/probes. The store records a rollup version (constant plus a DDL hash) and drops and recreates the aggregate tables when it changes, so the next pass recomputes from S3.

Also fixes the store integration test silently skipping in CI since #1463 (no STATS_TEST_DB_URL, no env_inherit), and scopes iili slug counting to the two routes that actually reach iili.

Review panel ran against the first push; the second commit is its findings. Not acted on: served overcounts on vhosts without a catch-all 404, which needs a Caddyfile restructure (follow-up issue). Dashboard side is muchq/muchq.github.io.

Tested with bazel test //domains/platform/apis/stats/... against a local postgres:18; the rest of //... rides on CI.

The agent rollup keys each row by class plus a bounded name — the marker
for AI scrapers and named bots, the UA's first product token (max 32
bytes) for the rest — and the probe rollup counts requests whose path
matches a scanner family. Served at /stats/v1/agents and /stats/v1/probes.

The store records a rollup version and re-aggregates from S3 when it
changes, so the new tables fill from objects already processed.

The store integration test was skipping in CI: nothing set
STATS_TEST_DB_URL and the target did not inherit it.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
1d4-web 6d273ec Commit Preview URL

Branch Preview URL
Sep 01 2026, 10:22 PM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 1, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ast-lol 6d273ec Commit Preview URL

Branch Preview URL
Sep 01 2026, 10:23 PM

The agent name lives on request_stats rather than in a second table that
duplicated its dimensions; the store drops and recreates the aggregate
tables on a version change, and the recorded version hashes the DDL so a
column edit re-aggregates without a constant bump. Each object caps the
anonymous agent tail at 500 names, and /stats/v1/agents takes a limit,
busiest rows first.

Classifier fixes: telegrambot before twitterbot, browser-shaped generic
bots named by the marker they tripped, backup probes only at the root
(Forgejo archives), and iili slugs only on the two routes that reach
iili. AgentClassOf and the empty-UA branch were dead.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
iili 6d273ec Commit Preview URL

Branch Preview URL
Sep 01 2026, 10:22 PM

@aaylward
aaylward merged commit eb1a145 into main Sep 1, 2026
22 checks passed
@aaylward
aaylward deleted the stats-bot-traffic branch September 1, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant