Skip to content

feat: ✨ add Sentry telemetry - #120

Merged
iamnewton merged 8 commits into
mainfrom
feat/add-sentry
Aug 12, 2026
Merged

feat: ✨ add Sentry telemetry#120
iamnewton merged 8 commits into
mainfrom
feat/add-sentry

Conversation

@iamnewton

Copy link
Copy Markdown
Contributor

Summary

  • Adds src/telemetry.ts mirroring the pattern from theholocron/holocroninit, startCommand, captureException, endSession, flush
  • Wires into cli.ts: per-command spans via yargs middleware, captureException on unhandled rejections and caught errors, token scrubbing via beforeSend
  • DSN defaults to "" (telemetry silently disabled) — replace with your Sentry project DSN to enable
  • Opt-out env var: NO_CLI_TEMPLATE_TELEMETRY=1

Test plan

  • pnpm typecheck passes
  • CI green

🤖 Generated with Claude Code

Mirrors the pattern from theholocron/holocron. Adds src/telemetry.ts
with init, startCommand, captureException, endSession, and flush.
Wires into cli.ts with middleware for per-command spans, try/catch
for unhandled errors, and token scrubbing in beforeSend.

DSN is empty by default — set it to your Sentry project key to enable.
Opt out at any time with NO_CLI_TEMPLATE_TELEMETRY=1.

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
@iamnewton
iamnewton requested a review from a team as a code owner August 12, 2026 19:29
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
+ Coverage   95.53%   96.29%   +0.76%     
==========================================
  Files          11       12       +1     
  Lines         112      135      +23     
  Branches       16       23       +7     
==========================================
+ Hits          107      130      +23     
  Misses          3        3              
  Partials        2        2              
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

super-linterbot Bot and others added 7 commits August 12, 2026 19:32
Signed-off-by: super-linterbot[bot] <310376783+super-linterbot[bot]@users.noreply.github.com>
Read SENTRY_DSN from the environment instead of a hardcoded constant
so tests can enable the enabled paths and users configure via .env
without editing source. Adds full test coverage for all exports and
the scrubError beforeSend callback.

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Replace process.env.NO_CLI_TEMPLATE_TELEMETRY and process.env.SENTRY_DSN
with env.parser.get() so telemetry respects the namespace cascade and
.env file loading. Import from @/utils/env directly to avoid pulling
the logger barrel into the module. Mock the parser in tests.

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
parser.get("sentry_dsn") now resolves HOLOCRON_SENTRY_DSN first,
then CLI_TEMPLATE_SENTRY_DSN as an override — matching the cascade
pattern documented in env.ts. Keeps holocron.config.ts in sync.

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Add SENTRY_DSN and NO_TELEMETRY env vars to README and docs index.
Update namespace cascade description to reflect HOLOCRON → CLI_TEMPLATE.
Add Sentry to What's Included and Features. Remove stale sound, open,
and dotenv references from docs/content/index.md.

Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
Signed-off-by: Newton <5769156+iamnewton@users.noreply.github.com>
@iamnewton
iamnewton merged commit 9e1affe into main Aug 12, 2026
28 checks passed
@iamnewton
iamnewton deleted the feat/add-sentry branch August 12, 2026 21:33
@iamnewton

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamnewton iamnewton added the released Included in a release label Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Included in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant