feat: ✨ add Sentry telemetry - #120
Merged
Merged
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests. @@ 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:
|
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>
Contributor
Author
|
🎉 This PR is included in version 1.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/telemetry.tsmirroring the pattern fromtheholocron/holocron—init,startCommand,captureException,endSession,flushcli.ts: per-command spans via yargs middleware,captureExceptionon unhandled rejections and caught errors, token scrubbing viabeforeSend""(telemetry silently disabled) — replace with your Sentry project DSN to enableNO_CLI_TEMPLATE_TELEMETRY=1Test plan
pnpm typecheckpasses🤖 Generated with Claude Code