Skip to content

[OPIK-6425] Include error code in explain errored/retried BI events#7333

Merged
awkoy merged 2 commits into
mainfrom
awkoy/OPIK-6425/track-explain-error-code
Jul 3, 2026
Merged

[OPIK-6425] Include error code in explain errored/retried BI events#7333
awkoy merged 2 commits into
mainfrom
awkoy/OPIK-6425/track-explain-error-code

Conversation

@awkoy

@awkoy awkoy commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Details

opik_explain_errored fired with only the cell kind, while failCell() already had the error code and 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_errored now carries code (timeout | unavailable | rate_limited | waking | free-form console code | "unknown") and message — static ERROR_COPY text for known codes, the raw upstream error text for unknown ones (the diagnostic detail), truncated to 300 chars.
  • opik_explain_retried now carries the code of the error the user is retrying from, so recovery behavior can be broken down by failure type.
  • No new event names; Segment adds the code/message columns to the existing warehouse tables on first receipt.

Change checklist

  • User facing
  • Documentation update

Issues

  • OPIK-6425

AI-WATERMARK

AI-WATERMARK: yes

  • Tools: Claude Code
  • Model(s): Claude Fable 5
  • Scope: event payload change in explainStore.ts / ExplainPopover.tsx and the new payload assertions in explainStore.test.ts
  • Human verification: test suite and typecheck run locally; diff reviewed before push

Testing

  • 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 — clean
  • Not run: full frontend suite / e2e (change is confined to analytics payloads; no UI or behavior change)

Documentation

None needed — analytics-only change. The Metabase "Opik Explain - Outcome per click" card will split the errored band by code once this ships, with message as the drill-down for unknowns.

🤖 Generated with Claude Code

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>
@awkoy
awkoy requested a review from a team as a code owner July 3, 2026 09:22
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>

@aadereiko aadereiko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andriidudar andriidudar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@awkoy
awkoy merged commit 8e771e3 into main Jul 3, 2026
10 of 12 checks passed
@awkoy
awkoy deleted the awkoy/OPIK-6425/track-explain-error-code branch July 3, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants