Skip to content

feat(explore): Update confidence footer copy #92219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2025
Merged
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
20 changes: 14 additions & 6 deletions static/app/views/explore/charts/confidenceFooter.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ describe('ConfidenceFooter', () => {
{wrapper: Wrapper}
);

expect(screen.getByTestId('wrapper')).toHaveTextContent('Based on 100 samples');
expect(screen.getByTestId('wrapper')).toHaveTextContent(
'Extrapolated based on 100 span samples'
);
await userEvent.hover(screen.getByText('100'));
expect(
await screen.findByText(/You may not have enough samples for high accuracy./)
await screen.findByText(
/You may not have enough span samples for a high accuracy extrapolation of your query./
)
).toBeInTheDocument();
});
it('renders for full scan with grouping', async () => {
Expand All @@ -37,11 +41,13 @@ describe('ConfidenceFooter', () => {
);

expect(screen.getByTestId('wrapper')).toHaveTextContent(
'Top 5 groups based on 100 samples'
'Top 5 groups extrapolated based on 100 span samples'
);
await userEvent.hover(screen.getByText('100'));
expect(
await screen.findByText(/You may not have enough samples for high accuracy./)
await screen.findByText(
/You may not have enough span samples for a high accuracy extrapolation of your query./
)
).toBeInTheDocument();
});
});
Expand All @@ -58,7 +64,9 @@ describe('ConfidenceFooter', () => {
{wrapper: Wrapper}
);

expect(screen.getByTestId('wrapper')).toHaveTextContent('Based on 100 samples');
expect(screen.getByTestId('wrapper')).toHaveTextContent(
'Extrapolated based on 100 span samples'
);
});
it('renders for full scan with grouping', () => {
render(
Expand All @@ -72,7 +80,7 @@ describe('ConfidenceFooter', () => {
);

expect(screen.getByTestId('wrapper')).toHaveTextContent(
'Top 5 groups based on 100 samples'
'Top 5 groups extrapolated based on 100 span samples'
);
});
});
Expand Down
27 changes: 16 additions & 11 deletions static/app/views/explore/charts/confidenceFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop
const isTopN = defined(topEvents) && topEvents > 1;
if (!defined(sampleCount)) {
return isTopN
? t('* Chart for top %s groups extrapolated from \u2026', topEvents)
: t('* Chart extrapolated from \u2026');
? t('* Top %s groups extrapolated based on \u2026', topEvents)
: t('* Extrapolated based on \u2026');
}

const noSampling = defined(isSampled) && !isSampled;
Expand All @@ -33,7 +33,7 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop
if (confidence === 'low') {
if (isTopN) {
return tct(
'Top [topEvents] groups based on [tooltip:[sampleCountComponent] samples]',
'Top [topEvents] groups extrapolated based on [tooltip:[sampleCountComponent] span samples]',
{
topEvents,
tooltip: lowAccuracyFullSampleCount,
Expand All @@ -42,20 +42,23 @@ function confidenceMessage({sampleCount, confidence, topEvents, isSampled}: Prop
);
}

return tct('Based on [tooltip:[sampleCountComponent] samples]', {
return tct('Extrapolated based on [tooltip:[sampleCountComponent] span samples]', {
tooltip: lowAccuracyFullSampleCount,
sampleCountComponent,
});
}

if (isTopN) {
return tct('Top [topEvents] groups based on [sampleCountComponent] samples', {
topEvents,
sampleCountComponent,
});
return tct(
'Top [topEvents] groups extrapolated based on [sampleCountComponent] span samples',
{
topEvents,
sampleCountComponent,
}
);
}

return tct('Based on [sampleCountComponent] samples', {
return tct('Extrapolated based on [sampleCountComponent] span samples', {
sampleCountComponent,
});
}
Expand All @@ -71,11 +74,13 @@ function _LowAccuracyFullTooltip({
<Tooltip
title={
<div>
{t('You may not have enough samples for high accuracy.')}
{t(
'You may not have enough span samples for a high accuracy extrapolation of your query.'
)}
<br />
<br />
{t(
'You can try adjusting your query by removing filters or increasing the time interval.'
"You can try adjusting your query by narrowing the date range, removing filters or increasing the chart's time interval."
)}
<br />
<br />
Expand Down
Loading