Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {formatPercentage} from 'sentry/utils/number/formatPercentage';
import {unreachable} from 'sentry/utils/unreachable';

export interface EventRegressionTableRow {
group: string;
group: string | null;
Comment thread
cursor[bot] marked this conversation as resolved.
operation: string;
percentageChange: number;
description?: string;
Expand Down Expand Up @@ -99,8 +99,8 @@ export function EventRegressionTable({
) : data.length === 0 ? (
<SimpleTable.Empty>{t('No results found for your query')}</SimpleTable.Empty>
) : (
data.map(row => (
<SimpleTable.Row key={row.group}>
data.map((row, index) => (
<SimpleTable.Row key={`${row.group ?? index}-${row.operation}`}>
{columns.map(column => (
<SimpleTable.RowCell
key={column.key}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function DetailsWidgetVisualization(props: DetailsWidgetVisualizationProp
(spanDescription.split('?')[0] ?? '').split('.').pop()?.toLowerCase() ?? ''
);

if (isImage) {
if (isImage && spanGroup) {
const projectId = span[SpanFields.PROJECT_ID]
? Number(span[SpanFields.PROJECT_ID])
: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const formatter = new SQLishFormatter();
interface Props {
moduleName: ModuleName;
filters?: Record<string, string>;
group?: string;
group?: string | null;
shortDescription?: string;
}

Expand All @@ -33,7 +33,10 @@ export function FullSpanDescription({
}: Props) {
const {data: indexedSpans, isFetching: areIndexedSpansLoading} = useSpans(
{
search: MutableSearch.fromQueryObject({'span.group': group, ...filters}),
search: MutableSearch.fromQueryObject({
'span.group': group ?? undefined,
...filters,
}),
limit: 1,
fields: [
SpanFields.PROJECT_ID,
Expand Down Expand Up @@ -104,7 +107,7 @@ export function FullSpanDescription({

type TruncatedQueryClipBoxProps = {
children: ReactNode;
group: string | undefined;
group: string | null | undefined;
Comment thread
cursor[bot] marked this conversation as resolved.
};

function QueryClippedBox({group, children}: TruncatedQueryClipBoxProps) {
Expand All @@ -114,16 +117,20 @@ function QueryClippedBox({group, children}: TruncatedQueryClipBoxProps) {

return (
<StyledClippedBox
btnText={t('View full query')}
btnText={group ? t('View full query') : undefined}
clipHeight={500}
buttonProps={{
icon: <IconOpen />,
onClick: () =>
navigate({
pathname: `${databaseURL}/spans/span/${group}`,
query: {...location.query, isExpanded: true},
}),
}}
buttonProps={
group
? {
icon: <IconOpen />,
onClick: () =>
navigate({
pathname: `${databaseURL}/spans/span/${group}`,
query: {...location.query, isExpanded: true},
}),
}
: undefined
}
>
{children}
</StyledClippedBox>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function DatabaseSpanDescription({

const {data: indexedSpans, isFetching: areIndexedSpansLoading} = useSpans(
{
search: MutableSearch.fromQueryObject({'span.group': groupId}),
search: MutableSearch.fromQueryObject({'span.group': groupId ?? undefined}),
limit: 1,
fields: [
SpanFields.PROJECT_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Props {
moduleName: ModuleName.DB | ModuleName.RESOURCE;
projectId: number;
extraLinkQueryParams?: Record<string, string>;
group?: string;
group?: string | null;
spanOp?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface Props {
moduleName: ModuleName.DB | ModuleName.RESOURCE;
projectId: number;
extraLinkQueryParams?: Record<string, string>;
group?: string;
group?: string | null;
spanAction?: string;
spanOp?: string;
system?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function OverviewSlowNextjsSSRWidget(props: LoadableChartWidgetPr
const pageFilterChartParams = usePageFilterChartParams();
const {query} = useTransactionNameQuery();

const fullQuery = `span.op:function.nextjs ${query}`;
const fullQuery = `has:span.group span.op:function.nextjs ${query}`;

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.

nit: Looking at .../widgets/overviewTimeConsumingQueriesWidget.tsx, you're using an enum value (has:${SpanFields.SPAN_GROUP}) whereas here you're using a raw string.

Is one better/preferred than the other?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's better to use the enum values because that makes it easier to find all usages of a specific attribute, but I always forget to do that! I can update


const spansRequest = useSpans(
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default function OverviewTimeConsumingQueriesWidget(
const supportedSystems = Object.values(SupportedDatabaseSystem);

const search = new MutableSearch(
`${SpanFields.DB_SYSTEM}:[${supportedSystems.join(',')}] ${query}`.trim()
`has:${SpanFields.SPAN_GROUP} ${SpanFields.DB_SYSTEM}:[${supportedSystems.join(',')}] ${query}`.trim()
);
const referrer = Referrer.OVERVIEW_TIME_CONSUMING_QUERIES_WIDGET;
const groupBy = SpanFields.NORMALIZED_DESCRIPTION;
Expand Down
3 changes: 1 addition & 2 deletions static/app/views/insights/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,6 @@ export type NonNullableStringFields =
| SpanFields.FILE_EXTENSION
| SpanFields.SPAN_OP
| SpanFields.SPAN_DESCRIPTION
| SpanFields.SPAN_GROUP
| SpanFields.SPAN_CATEGORY
| SpanFields.SPAN_SYSTEM
| SpanFields.TIMESTAMP
Expand All @@ -331,7 +330,7 @@ export type NonNullableStringFields =
| SpanFields.USER_DISPLAY
| SpanFields.SENTRY_ORIGIN;

type NullableStringFields = SpanFields.NORMALIZED_DESCRIPTION;
type NullableStringFields = SpanFields.NORMALIZED_DESCRIPTION | SpanFields.SPAN_GROUP;

export type SpanStringFields = NullableStringFields | NonNullableStringFields;

Expand Down
Loading