o11y(assisted-query): Track error outcomes in trackAiQueryOutcome#117396
Merged
Conversation
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>
JoshFerge
approved these changes
Jun 11, 2026
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
Threads error context into
trackAiQueryOutcomein two places where it was previously dropped, so AI-assisted queries that fail record anerror_on_loadoutcome instead of being mislabeled or unrecorded.Issue list (
issueList/overview.tsx)The issue list only called
trackAiQueryOutcomein the fetch success handler, so AI queries that errored never recorded an outcome. Added a matching call in the error handler withresultCount: 0and the parsed API error, mirroring the adjacentissue_search.failedanalytics.Spans explore (
explore/hooks/useAnalytics.tsx)trackAiQueryOutcomeinuseTrackAnalyticsonly passed the table error, whilequery_statusalready factored in the chart (timeseries) error. A chart-only failure therefore loggedquery_status: 'error'but anoutcomeofhas_results/empty_results. Boxed the existingchartError(sameuseBoxpattern astableError) and OR'd it into the error arg for the aggregate, samples, and traces calls so the outcome aligns withquery_status.No new chart-error sources are introduced —
chartErroris only used where it already existed; the logs and metrics analytics hooks are untouched.