Skip to content

dev/viewership-metrics: Probe every redirect rule on the live site - #1897

Draft
marcleblanc2 wants to merge 7 commits into
page-views-reportfrom
redirect-probe
Draft

dev/viewership-metrics: Probe every redirect rule on the live site#1897
marcleblanc2 wants to merge 7 commits into
page-views-reportfrom
redirect-probe

Conversation

@marcleblanc2

Copy link
Copy Markdown
Contributor

Stacked on #1890.

npm run probe-redirects requests every rule in src/data/redirects.ts on sourcegraph.com, follows the redirects like a browser, and writes viewership-metrics/reports/redirect-probe.json: per rule, every hop, final URL/status, whether the first redirect is the one the rule promises, whether the #fragment the user ends up with exists on the page, and the Cloudflare rows for source, destination and final page.

Headline numbers from the first run (962 live rules):

  • 735 redirect as written, 195 redirect somewhere else, 32 do not redirect at all
  • 224 end on a 404; 6 loop forever (/graphbook*sourcegraph.com/handbook redirects to itself; /@v5.3.0/admin/observability/* ping-pongs with docs.sourcegraph.com)
  • 230 live rules have a #fragment in the source. Browsers never send fragments, so none of them can match as written; 200 fall through to a bare-path rule, 30 to the page itself
  • 22 rules put a #fragment in the destination; the anchor exists on the final page for 9

See viewership-metrics/README.md → Redirect probe for the field meanings.

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sourcegraph-docs Ready Ready Preview Sep 10, 2026 6:34am UTC

Request Review

marcleblanc2 and others added 4 commits September 9, 2026 23:25
…ents and Cloudflare traffic

probe-redirects.mjs requests each rule's source, follows the chain like a
browser, records every hop, the final status, whether the first redirect
matches the rule, and whether the fragment the user ends up with exists on
the page. Joins page-views-by-path.md rows for source, destination and
final page. Summary groups live rules by source/destination fragment case.

Rule loading moves to redirect-rules.mjs, shared with page-views-report.

Amp-Thread-ID: https://ampcode.com/threads/T-01a08968-179e-7528-9162-44dd0fbb964d
Co-authored-by: Amp <amp@ampcode.com>
…404s; probe summary adds traffic by status and rule alignment

Amp-Thread-ID: https://ampcode.com/threads/T-01a08968-179e-7528-9162-44dd0fbb964d
Co-authored-by: Amp <amp@ampcode.com>
…atch fires), add sitemap source/destination, resolve destination constants

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a08968-179e-7528-9162-44dd0fbb964d
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