Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('traceWaterfall embed', () => {

expect(
await screen.findByText(
/We were unable to find any spans for this trace/,
/We couldn't find any spans for this trace/,
{},
{timeout: 10_000}
)
Expand Down
2 changes: 2 additions & 0 deletions static/app/utils/issueTypeConfig/frontendConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,6 @@ export const frontendConfig: IssueCategoryConfigMapping = {
issueSummary: {enabled: true},
autofix: true,
},
// Rage clicks get the replay's first trace, not one for the click, and it often wasn't sampled.
[IssueType.REPLAY_RAGE_CLICK]: {trace: {enabled: false}},
};
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,9 @@ export function TraceWaterfall(props: TraceWaterfallProps) {
) : props.tree.type === 'error' ? (
<TraceWaterfallState.Error trace={props.trace} />
) : props.tree.type === 'empty' ? (
<TraceWaterfallState.Empty />
<TraceWaterfallState.Empty
showCrossEventHelp={props.source === 'performance'}
/>
) : null}

<TraceDrawer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ describe('TraceWaterfallState', () => {

render(<TraceWaterfallState.Empty />);

expect(screen.getByText(/unable to find any spans/i)).toBeInTheDocument();
expect(screen.getByText(/may not have been sampled/i)).toBeInTheDocument();
expect(screen.queryByText(/Logs or Application Metrics/i)).not.toBeInTheDocument();
});

it('shows no-spans message when there is no timestamp', () => {
Expand All @@ -164,7 +165,17 @@ describe('TraceWaterfallState', () => {

render(<TraceWaterfallState.Empty />);

expect(screen.getByText(/unable to find any spans/i)).toBeInTheDocument();
expect(screen.getByText(/may not have been sampled/i)).toBeInTheDocument();
});

it('explains Logs and Application Metrics sampling on the trace page', () => {
mockUseTraceQueryParamsMock.mockReturnValue(
createTraceQuery({timestamp: undefined})
);

render(<TraceWaterfallState.Empty showCrossEventHelp />);

expect(screen.getByText(/Logs or Application Metrics/i)).toBeInTheDocument();
});
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useRef, useState} from 'react';
import {Fragment, useRef, useState} from 'react';
import styled from '@emotion/styled';

import {ExternalLink} from '@sentry/scraps/link';
Expand Down Expand Up @@ -75,7 +75,15 @@ function getTraceErrorMessage(status: number | undefined) {
}
}

function TraceEmpty() {
interface TraceEmptyProps {
/**
* Explain why traces opened from Logs or Application Metrics can be missing spans.
* Only the full trace page needs this.
*/
showCrossEventHelp?: boolean;
}

function TraceEmpty({showCrossEventHelp = false}: TraceEmptyProps) {
const traceQueryParams = useTraceQueryParams();
const timestamp = traceQueryParams.timestamp;
// Frozen at mount so the message doesn't flip while the user is looking at it.
Expand All @@ -87,7 +95,7 @@ function TraceEmpty() {
const message =
timestamp && timestamp * 1000 >= now - TEN_MINUTES_IN_MS ? (
t("We're still processing this trace. Please try refreshing after a minute")
) : (
) : showCrossEventHelp ? (
<div>
<Text as="p">
{t(
Expand All @@ -106,6 +114,12 @@ function TraceEmpty() {
)}
</Text>
</div>
) : (
<Fragment>
{t("We couldn't find any spans for this trace.")}
<br />
{t('It may not have been sampled.')}
</Fragment>
);

return (
Expand Down
Loading