Skip to content

o11y(assisted-query): Track error outcomes in trackAiQueryOutcome#117396

Merged
aliu39 merged 2 commits into
masterfrom
feat/issues-track-ai-query-error-outcome
Jun 11, 2026
Merged

o11y(assisted-query): Track error outcomes in trackAiQueryOutcome#117396
aliu39 merged 2 commits into
masterfrom
feat/issues-track-ai-query-error-outcome

Conversation

@aliu39

@aliu39 aliu39 commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Threads error context into trackAiQueryOutcome in two places where it was previously dropped, so AI-assisted queries that fail record an error_on_load outcome instead of being mislabeled or unrecorded.

Issue list (issueList/overview.tsx)

The issue list only called trackAiQueryOutcome in the fetch success handler, so AI queries that errored never recorded an outcome. Added a matching call in the error handler with resultCount: 0 and the parsed API error, mirroring the adjacent issue_search.failed analytics.

Spans explore (explore/hooks/useAnalytics.tsx)

trackAiQueryOutcome in useTrackAnalytics only passed the table error, while query_status already factored in the chart (timeseries) error. A chart-only failure therefore logged query_status: 'error' but an outcome of has_results/empty_results. Boxed the existing chartError (same useBox pattern as tableError) and OR'd it into the error arg for the aggregate, samples, and traces calls so the outcome aligns with query_status.

No new chart-error sources are introduced — chartError is only used where it already existed; the logs and metrics analytics hooks are untouched.

aliu39 and others added 2 commits June 11, 2026 00:13
The issue list only reported trackAiQueryOutcome on a successful fetch, so
AI-assisted queries that errored never recorded an outcome. Mirror the
success-block call in the error handler with resultCount 0 and the parsed
API error, matching the adjacent issue_search.failed analytics.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
trackAiQueryOutcome in the spans explore analytics only passed the table
error, while query_status already factored in the chart (timeseries) error.
A chart-only failure therefore logged query_status 'error' but an outcome of
has_results/empty_results. Box the existing chartError and OR it into the
error arg for the aggregate, samples, and traces calls so the outcome aligns
with query_status. No new chart-error sources are introduced.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jun 11, 2026
@aliu39 aliu39 marked this pull request as ready for review June 11, 2026 16:31
@aliu39 aliu39 requested review from a team as code owners June 11, 2026 16:31
@aliu39 aliu39 changed the title feat(ai-query): Track error outcomes in trackAiQueryOutcome o11y(assisted-query): Track error outcomes in trackAiQueryOutcome Jun 11, 2026
@aliu39 aliu39 merged commit 01189c6 into master Jun 11, 2026
71 checks passed
@aliu39 aliu39 deleted the feat/issues-track-ai-query-error-outcome branch June 11, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants