[OPIK-6425] Include error code in explain errored/retried BI events#7333
Merged
Conversation
opik_explain_errored fired with only the cell kind while failCell already had the error code in hand, so the ~30% launch error rate can't be split into timeout vs unavailable vs rate_limited vs upstream in dashboards. Attach code (falling back to "unknown" for free-form console errors) to opik_explain_errored, and tag opik_explain_retried with the code the user is retrying from. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
code alone can't diagnose free-form console errors (code absent or unknown) — attach the resolved display message too: static copy for known codes, the raw upstream error text for unknown ones, truncated to 300 chars since upstream text is unbounded. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Details
opik_explain_erroredfired with only the cellkind, whilefailCell()already had the errorcodeand message in hand — so the ~30% error rate since the Jul 1 launch can't be split into timeout vs unavailable vs rate_limited vs upstream failures in dashboards, each of which has a different owner.opik_explain_errorednow carriescode(timeout|unavailable|rate_limited|waking| free-form console code |"unknown") andmessage— static ERROR_COPY text for known codes, the raw upstream error text for unknown ones (the diagnostic detail), truncated to 300 chars.opik_explain_retriednow carries thecodeof the error the user is retrying from, so recovery behavior can be broken down by failure type.code/messagecolumns to the existing warehouse tables on first receipt.Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
explainStore.ts/ExplainPopover.tsxand the new payload assertions inexplainStore.test.tsTesting
npx vitest run src/plugins/comet/explain/— 5 files, 52 tests pass, incl. 3 new payload assertions (watchdog timeout, structured console error, raw-message fallthrough for unknown codes)npm run typecheck— cleanDocumentation
None needed — analytics-only change. The Metabase "Opik Explain - Outcome per click" card will split the errored band by
codeonce this ships, withmessageas the drill-down for unknowns.🤖 Generated with Claude Code