Skip to content

chore: Add Sentry DSN so crash reporting works in all builds#1564

Open
developerkunal wants to merge 2 commits into
mainfrom
hardcode-sentry-dsn
Open

chore: Add Sentry DSN so crash reporting works in all builds#1564
developerkunal wants to merge 2 commits into
mainfrom
hardcode-sentry-dsn

Conversation

@developerkunal

@developerkunal developerkunal commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🔧 Changes

Hardcodes the Sentry DSN as the default value of instrumentation.SentryDSN, and removes the build-time SENTRY_DSN injection from the release pipeline.

A Sentry DSN is a public, write-only key that is safe to ship in client binaries. Hardcoding it means crash reporting works consistently across all build paths, including from-source builds such as Homebrew Core that cannot inject build-time values.

  • internal/instrumentation/instrumentation.go: SentryDSN now defaults to the project DSN.
  • .goreleaser.yml: removed the -X ...SentryDSN ldflag.
  • .github/workflows/release.yml: removed the now-unused SENTRY_DSN env var.

🔬 Testing

Built from source and confirmed the DSN is embedded in the binary, with version stamping unaffected.

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A) — N/A
  • I have added documentation for all new/changed functionality (or N/A) — N/A

The Sentry DSN was injected at build time via ldflags from a SENTRY_DSN
secret. That value has been empty in released binaries since around v1.10,
so crash reporting has effectively been disabled, and it cannot work at all
for from-source builds such as Homebrew Core.

A Sentry DSN is a public, write-only key that is safe to ship inside client
binaries, so this hardcodes it as the default. The build-time injection is
removed from the release pipeline so every build path (releases, Homebrew
Core, and plain go build) reports to Sentry consistently.
@developerkunal developerkunal requested a review from a team as a code owner June 25, 2026 10:02
@developerkunal developerkunal changed the title Hardcode Sentry DSN so crash reporting works in all builds chore: Add Sentry DSN so crash reporting works in all builds Jun 25, 2026
Reporting now keys off buildinfo.Version instead of the Sentry DSN.
Local builds stamp the version as "dev" (and a plain go build leaves
it empty), so ReportException returns early for those and panics
re-panic with a real stack trace. Release and Homebrew Core builds
carry a real version and continue to report.
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