Skip to content

chore: Add comprehensive Sentry integration with tracing and source maps#697

Merged
BYK merged 29 commits intomasterfrom
feat/sentry-integration
Jan 8, 2026
Merged

chore: Add comprehensive Sentry integration with tracing and source maps#697
BYK merged 29 commits intomasterfrom
feat/sentry-integration

Conversation

@BYK
Copy link
Member

@BYK BYK commented Jan 8, 2026

Summary

This PR upgrades Craft's Sentry integration with:

  • Hardcoded DSN (removes env-variable dependency)
  • 100% tracing enabled for all operations
  • Comprehensive performance monitoring for key actions
  • Automatic source map uploads on master builds

Changes

Sentry SDK Configuration

  • Created src/instrument.ts with hardcoded DSN and full tracing
  • Removed env-variable based DSN configuration
  • Added PII scrubbing (home directory paths, server names)
  • Set environment and release tracking

Tracing

  • Added tracing utilities (src/utils/tracing.ts)
  • Wrapped CLI entry point in craft.cli span
  • Added spans for prepare (craft.prepare) and publish (craft.publish) commands
  • Added spans for each target publish operation (craft.target.{id})
  • Added spans for GitHub API operations (craft.github.*)

Source Maps

  • Added @sentry/esbuild-plugin dependency
  • Created build.mjs with Sentry plugin configuration
  • Source maps upload automatically on master builds when SENTRY_AUTH_TOKEN is available
  • Maps are deleted after upload for security

CI Updates

  • Updated build workflow to use environment: production on master
  • Non-master builds skip source map uploads gracefully

Testing

  • No linting errors
  • Build script handles missing token gracefully
  • All tracing spans properly configured

BYK added 2 commits January 8, 2026 11:14
…ource maps

- Hardcode Sentry DSN and enable 100% tracing (tracesSampleRate: 1)
- Add instrumentation module with PII scrubbing and context tags
- Add tracing utilities and wrap key operations (prepare, publish, targets, GitHub API)
- Configure esbuild plugin for automatic source map uploads on master builds
- Update CI to use production environment for SENTRY_AUTH_TOKEN on master
- Remove env-variable based DSN configuration
@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

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


Build / dependencies / internal 🔧

  • Add comprehensive Sentry integration with tracing and source maps by BYK in #697
  • Migrate from Yarn to pnpm 10.27.0 by BYK in #693

🤖 This preview updates automatically when you update the PR.

BYK added 27 commits January 8, 2026 12:32
@BYK BYK marked this pull request as ready for review January 8, 2026 21:01
@BYK BYK changed the title feat(sentry): Add comprehensive Sentry integration with tracing and source maps build(sentry): Add comprehensive Sentry integration with tracing and source maps Jan 8, 2026
@BYK BYK changed the title build(sentry): Add comprehensive Sentry integration with tracing and source maps chore: Add comprehensive Sentry integration with tracing and source maps Jan 8, 2026
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.

2 participants