feat(telemetry): add seer.outcome span tag for Seer command metrics#609
Merged
feat(telemetry): add seer.outcome span tag for Seer command metrics#609
Conversation
…118) Add structured outcome classification to issue explain and issue plan commands via a seer.outcome span tag on the cli.command transaction. Since tracesSampleRate is 1, every execution is already captured as a span — no separate metrics.increment() or metrics.distribution() calls needed. Discover queries can slice by outcome, duration, org, etc. Outcome values: success, timeout, no_budget, not_enabled, ai_disabled, no_solution, api_error, error. Helpers: - recordSeerOutcome(outcome) — sets Sentry.setTag("seer.outcome", ...) - classifySeerError(error) — maps error types to outcome values - handleSeerCommandError() — extracted catch block for plan.ts to stay under Biome complexity limit Dashboard: "CLI Seer Health" at sentry.sentry.io/dashboard/1763619/ with 8 widgets tracking command volume, outcomes, duration, and org breakdown.
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Upgrade
Other
Documentation 📚
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 129 passed | Total: 129 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 94.12%. Project has 1277 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 95.74% 95.73% -0.01%
==========================================
Files 203 203 —
Lines 29912 29936 +24
Branches 0 0 —
==========================================
+ Hits 28640 28659 +19
- Misses 1272 1277 +5
- Partials 0 0 —Generated by Codecov Action |
When validateRootCauses throws for 0 root causes, the catch block classified it as "error" via classifySeerError (ValidationError maps to "error"). Inline the check and record "no_solution" explicitly, matching the explain.ts pattern.
Contributor
There was a problem hiding this comment.
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.
Move the error handling helper from plan.ts to utils.ts so both explain.ts and plan.ts use the same function. This ensures outcome classification stays consistent if the logic is updated.
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
Closes #118
seer.outcomespan tag toissue explainandissue plancommands for structured outcome classificationOutcome values
successtimeoutno_budgetnot_enabledai_disabledno_solutionapi_errorerrorChanges
src/lib/telemetry.ts:SeerOutcometype,recordSeerOutcome(),classifySeerError()src/commands/issue/explain.ts: outcome recording at all exit points withrecordedguardsrc/commands/issue/plan.ts: same pattern +handleSeerCommandError()helper (Biome complexity)test/lib/seer-telemetry.test.ts: 7 tests forclassifySeerError()