Skip to content

feat(install): add Sentry error telemetry to install script#334

Merged
BYK merged 3 commits intomainfrom
feat/install-telemetry
Mar 4, 2026
Merged

feat(install): add Sentry error telemetry to install script#334
BYK merged 3 commits intomainfrom
feat/install-telemetry

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Mar 4, 2026

Summary

Add fire-and-forget error reporting to the install script via Sentry's
envelope API. Uses the CLI's existing public write-only DSN — no new
secrets or projects needed. This would have caught the macOS digest
extraction bug (#331) automatically.

Changes

  • report_error() — builds a minimal Sentry envelope and sends it via
    background curl (2s timeout, never blocks installation)
  • die() — replaces all 11 echo + exit 1 patterns with error
    reporting + exit
  • ERR trap — catches unexpected set -e / pipefail exits like the
    gunzip pipeline failure that triggered fix(install): fix nightly digest extraction on macOS #331
  • UUID generation with fallback chain: /procuuidgenawk
  • Opt-out via SENTRY_CLI_NO_TELEMETRY=1 (same as the CLI binary)

Each error event is tagged with os, arch, channel, step,
install.version, and bash version for quick triage.

Report install failures to the CLI's existing Sentry project via the
envelope API. Uses the same public write-only DSN already baked into
every CLI binary. Same opt-out: SENTRY_CLI_NO_TELEMETRY=1.

- report_error(): builds a minimal Sentry envelope and fires a
  background curl (fire-and-forget, 2s timeout, never blocks)
- die(): replaces all echo+exit patterns with error reporting
- ERR trap: catches unexpected set -e / pipefail exits (e.g., gunzip)
- Tags: os, arch, channel, step, install.version, bash version
- UUID: /proc fallback -> uuidgen -> awk pseudo-UUID
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 4, 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 ✨

Trace

Other

  • (api) Add --data/-d flag and auto-detect JSON body in fields by BYK in #320
  • (formatters) Render all terminal output as markdown by BYK in #297
  • (install) Add Sentry error telemetry to install script by BYK in #334
  • (issue-list) Global limit with fair distribution, compound cursor, and richer progress by BYK in #306
  • (project) Add project create command by betegon in #237
  • (upgrade) Add binary delta patching via TRDIFF10/bsdiff by BYK in #327

Bug Fixes 🐛

Api

  • Use numeric project ID to avoid "not actively selected" error by betegon in #312
  • Use limit param for issues endpoint page size by BYK in #309
  • Auto-correct ':' to '=' in --field values with a warning by BYK in #302

Formatters

  • Expand streaming table to fill terminal width by betegon in #314
  • Fix HTML entities and escaped underscores in table output by betegon in #313

Setup

  • Suppress agent skills and welcome messages on upgrade by BYK in #328
  • Suppress shell completion messages on upgrade by BYK in #326

Other

  • (ci) Generate JUnit XML to silence codecov-action warnings by BYK in #300
  • (install) Fix nightly digest extraction on macOS by BYK in #331
  • (nightly) Push to GHCR from artifacts dir so layer titles are bare filenames by BYK in #301
  • (region) Resolve DSN org prefix at resolution layer by BYK in #316
  • (test) Handle 0/-0 in getComparator anti-symmetry property test by BYK in #308
  • (trace-logs) Timestamp_precise is a number, not a string by BYK in #323

Internal Changes 🔧

Api

  • Upgrade @sentry/api to 0.21.0, remove raw HTTP pagination workarounds by BYK in #321
  • Wire listIssuesPaginated through @sentry/api SDK for type safety by BYK in #310

Other

  • (craft) Add sentry-release-registry target by BYK in #325

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review March 4, 2026 13:43
BugBot correctly identified that `wait` returns the exit status of the
background curl. If curl fails (e.g., no network), wait returns non-zero
under set -e, retriggering the ERR trap and causing infinite recursion.
Adding `|| true` suppresses the exit status.
@BYK
Copy link
Copy Markdown
Member Author

BYK commented Mar 4, 2026

Fixed in c200a07 — added || true after wait to suppress non-zero exit status from failed background curl. Good catch.

Copy link
Copy Markdown

@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.

BugBot flagged that requested_version (from --version user input)
was interpolated into the JSON envelope without escaping. Apply the
same sed-based escaping to step, channel, and version tags via a
local _esc() helper.
@BYK
Copy link
Copy Markdown
Member Author

BYK commented Mar 4, 2026

Fixed in 9c36ef7 — extracted a _esc() helper and applied it to step, channel (from requested_version), and version tags. The os and arch values are hardcoded constants so they don't need escaping.

@BYK BYK merged commit 19e0713 into main Mar 4, 2026
19 checks passed
@BYK BYK deleted the feat/install-telemetry branch March 4, 2026 14:16
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