From 568586baff43297ce8e3f2e1992993127a64c2b2 Mon Sep 17 00:00:00 2001 From: Andrew Liu <159852527+aliu39@users.noreply.github.com> Date: Wed, 26 Nov 2025 14:13:53 -0800 Subject: [PATCH 1/2] ref(explorer): add copy and nav for errors search --- static/app/views/seerExplorer/utils.tsx | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/static/app/views/seerExplorer/utils.tsx b/static/app/views/seerExplorer/utils.tsx index 9c06fbe545d93a..b385ef6a985bf1 100644 --- a/static/app/views/seerExplorer/utils.tsx +++ b/static/app/views/seerExplorer/utils.tsx @@ -43,6 +43,12 @@ const TOOL_FORMATTERS: Record = { : `Searched for issues${projectInfo}: '${question}'`; } + if (dataset === 'errors') { + return isLoading + ? `Searching for errors${projectInfo}: '${question}'...` + : `Searched for errors${projectInfo}: '${question}'`; + } + // Default to spans return isLoading ? `Querying spans${projectInfo}: '${question}'...` @@ -343,6 +349,45 @@ export function buildToolLinkUrl( }; } + if (dataset === 'errors') { + const queryParams: Record = { + dataset: 'errors', + queryDataset: 'error-events', + query: query || '', + project: null, + }; + + if (stats_period) { + queryParams.statsPeriod = stats_period; + } + + // If project_slugs is provided, look up the project IDs + if (project_slugs && project_slugs.length > 0 && projects) { + const projectIds = project_slugs + .map((slug: string) => projects.find(p => p.slug === slug)?.id) + .filter((id: string | undefined) => id !== undefined); + if (projectIds.length > 0) { + queryParams.project = projectIds; + } + } + + const {y_axes} = toolLink.params; + if (y_axes) { + const axes = Array.isArray(y_axes) ? y_axes : [y_axes]; + const stringifiedAxes = axes.map(axis => JSON.stringify(axis)); + queryParams.yAxis = stringifiedAxes; + } + + if (sort) { + queryParams.sort = sort; + } + + return { + pathname: `/organizations/${orgSlug}/explore/discover/homepage/`, + query: queryParams, + }; + } + // Default to spans (traces) search const {y_axes, group_by, mode} = toolLink.params; From 6c430a451b43c1acaec4b77c6e5d0730af18970c Mon Sep 17 00:00:00 2001 From: Andrew Liu <159852527+aliu39@users.noreply.github.com> Date: Wed, 26 Nov 2025 14:38:54 -0800 Subject: [PATCH 2/2] fix --- static/app/views/seerExplorer/utils.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/static/app/views/seerExplorer/utils.tsx b/static/app/views/seerExplorer/utils.tsx index b385ef6a985bf1..23528d0d74481a 100644 --- a/static/app/views/seerExplorer/utils.tsx +++ b/static/app/views/seerExplorer/utils.tsx @@ -373,9 +373,7 @@ export function buildToolLinkUrl( const {y_axes} = toolLink.params; if (y_axes) { - const axes = Array.isArray(y_axes) ? y_axes : [y_axes]; - const stringifiedAxes = axes.map(axis => JSON.stringify(axis)); - queryParams.yAxis = stringifiedAxes; + queryParams.yAxis = y_axes; } if (sort) {