Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions static/app/views/seerExplorer/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ const TOOL_FORMATTERS: Record<string, ToolFormatter> = {
: `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}'...`
Expand Down Expand Up @@ -343,6 +349,43 @@ export function buildToolLinkUrl(
};
}

if (dataset === 'errors') {
const queryParams: Record<string, any> = {
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) {
queryParams.yAxis = y_axes;
}

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;

Expand Down
Loading