Skip to content

Track server content requests separately in Scarf - #1398

Merged
tannerlinsley merged 1 commit into
mainfrom
taren/scarf-server-traffic
Oct 17, 2026
Merged

tannerlinsley merged 1 commit into
mainfrom
taren/scarf-server-traffic

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Changes

Track successful HTML and Markdown content requests at the Cloudflare Worker entry, including crawlers that never execute JavaScript. Forward the visitor IP and user agent to Scarf and include Cloudflare bot classification when available.

Server traffic uses a separate server_request event. Browser page views and pixels are unchanged; these overlapping datasets must not be summed as unique visitors. Delivery runs in the background with a timeout, respects DNT/GPC, and excludes private routes, assets, redirects, and failed responses.

Validation

Six focused tracking tests pass. Full type, lint, unit, chat, and desktop checks passed again after rebasing onto current main. The integration preserves the docs header/timing wrapper and staging analytics exclusion.

@tannerlinsley
tannerlinsley requested a review from a team October 17, 2026 22:45
@changeset-bot

changeset-bot Bot commented Oct 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e8dcb75

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tannerlinsley
tannerlinsley merged commit cfe8215 into main Oct 17, 2026
6 of 8 checks passed
@tannerlinsley
tannerlinsley deleted the taren/scarf-server-traffic branch October 17, 2026 22:45
@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0bca1b70-5432-4787-b257-db838ca9082e
📥 Commits

Reviewing files that changed from the base of the PR and between c591f46 and e8dcb75.

📒 Files selected for processing: 4
  • docs/scarf-server-tracking.md
  • src/server.ts
  • src/utils/analytics/scarf-server.ts
  • tests/scarf-server.test.ts
+---------------------------------------+
| We're gonna need a bigger bug zapper. |
+---------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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