Skip to content

Conversation

@betegon
Copy link
Member

@betegon betegon commented Jan 30, 2026

Summary

Adds @sentry/astro to the docs website for monitoring errors, user sessions, and performance. Also tracks custom metrics when users interact with the hero install command section.

Changes

  • Integrates @sentry/astro with client and server configs
  • Enables error tracking, session replay (10% sample, 100% on error), and tracing
  • Adds two custom metrics:
    • hero_command_copied - tracks when users copy an install command
    • hero_install_method_selected - tracks when users switch between curl/npx/npm/pnpm/bun

Test Plan

  1. Run cd docs && bun run dev
  2. Open browser console and verify Sentry initializes (enable debug: true in client config if needed)
  3. Click the dropdown to change install method → metric sent
  4. Click copy button → metric sent
  5. Check Sentry project Insights > Metrics for the custom metrics

Notes

  • SENTRY_AUTH_TOKEN env var needed for source maps upload in production
  • SDK is enabled in all environments including dev for testing

Closes #117

Integrates @sentry/astro with:
- Error tracking and session replay
- Performance tracing (100% sample rate)
- Custom metrics for hero section interactions:
  - hero_command_copied (when users copy install commands)
  - hero_install_method_selected (when users change dropdown)

Closes #117

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (docs) Add Sentry SDK for error tracking, replay, and metrics by betegon in #122

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 1756 uncovered lines.
✅ Project coverage is 66.66%. Comparing base (base) to head (head).

Files with missing lines (24)
File Patch % Lines
human.ts 30.83% ⚠️ 673 Missing
resolve-target.ts 18.93% ⚠️ 257 Missing
oauth.ts 21.71% ⚠️ 202 Missing
resolver.ts 3.23% ⚠️ 120 Missing
errors.ts 5.94% ⚠️ 95 Missing
api-client.ts 68.77% ⚠️ 94 Missing
migration.ts 47.44% ⚠️ 82 Missing
api.ts 89.80% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
errors.ts 73.17% ⚠️ 33 Missing
seer.ts 76.15% ⚠️ 31 Missing
preload.ts 39.02% ⚠️ 25 Missing
detector.ts 87.79% ⚠️ 16 Missing
telemetry.ts 89.87% ⚠️ 8 Missing
auth.ts 93.69% ⚠️ 7 Missing
index.ts 95.06% ⚠️ 4 Missing
colors.ts 91.84% ⚠️ 4 Missing
env-file.ts 97.17% ⚠️ 3 Missing
utils.ts 98.64% ⚠️ 2 Missing
alias.ts 98.56% ⚠️ 2 Missing
project-aliases.ts 97.40% ⚠️ 2 Missing
schema.ts 90.00% ⚠️ 2 Missing
java.ts 97.22% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    66.66%    66.66%        —%
==========================================
  Files           45        45         —
  Lines         5267      5267         —
  Branches         0         0         —
==========================================
+ Hits          3511      3511         —
- Misses        1756      1756         —
- Partials         0         0         —

Generated by Codecov Action

@github-actions
Copy link

github-actions bot commented Jan 30, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/pr-preview/pr-122/

Built to branch gh-pages at 2026-01-30 10:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@betegon betegon marked this pull request as ready for review January 30, 2026 10:06
The inline scripts in InstallSelector.astro need access to Sentry.metrics
but @sentry/astro imports Sentry as an ES module without exposing it on
window. This adds the global exposure so custom metrics work.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@betegon betegon merged commit d8b640b into main Jan 30, 2026
23 checks passed
@betegon betegon deleted the feat/docs-sentry-sdk branch January 30, 2026 10:18
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.

feat(docs): Add Sentry SDK to website (errors, replay, traces, metrics)

2 participants