@@ -20,7 +20,6 @@ import {
2020 prettifyParsedFunction ,
2121} from 'sentry/utils/discover/fields' ;
2222import { DiscoverDatasets } from 'sentry/utils/discover/types' ;
23- import { formatPercentage } from 'sentry/utils/number/formatPercentage' ;
2423import { MutableSearch } from 'sentry/utils/tokenizeSearch' ;
2524import usePageFilters from 'sentry/utils/usePageFilters' ;
2625import usePrevious from 'sentry/utils/usePrevious' ;
@@ -353,24 +352,31 @@ export function ExploreCharts({query, setConfidence, setError}: ExploreChartsPro
353352 />
354353 { dataset === DiscoverDatasets . SPANS_EAP_RPC && (
355354 < ChartFooter >
356- { defined ( extrapolationMetaResults . data ?. [ 0 ] ?. [ 'count_sample()' ] ) &&
357- defined (
358- extrapolationMetaResults . data ?. [ 0 ] ?. [ 'avg_sample(sampling_rate)' ]
359- )
360- ? tct (
361- '*[sampleCount] samples extrapolated with an average sampling rate of [sampleRate]' ,
362- {
355+ { ! defined ( extrapolationMetaResults . data ?. [ 0 ] ?. [ 'count_sample()' ] )
356+ ? t ( '* Extrapolated from \u2026' )
357+ : resultConfidence === 'low'
358+ ? tct ( '* Extrapolated from [insufficientSamples]' , {
359+ insufficientSamples : (
360+ < Tooltip
361+ title = { t (
362+ 'Boost accuracy by shortening the date range, increasing the time interval or removing extra filters.'
363+ ) }
364+ >
365+ < InsufficientSamples >
366+ { t ( 'insufficient samples' ) }
367+ </ InsufficientSamples >
368+ </ Tooltip >
369+ ) ,
370+ } )
371+ : tct ( '* Extrapolated from [sampleCount] samples' , {
363372 sampleCount : (
364373 < Count
365- value = { extrapolationMetaResults . data [ 0 ] [ 'count_sample()' ] }
374+ value = {
375+ extrapolationMetaResults . data ?. [ 0 ] ?. [ 'count_sample()' ]
376+ }
366377 />
367378 ) ,
368- sampleRate : formatPercentage (
369- extrapolationMetaResults . data [ 0 ] [ 'avg_sample(sampling_rate)' ]
370- ) ,
371- }
372- )
373- : t ( 'foo' ) }
379+ } ) }
374380 </ ChartFooter >
375381 ) }
376382 </ ChartPanel >
@@ -401,7 +407,7 @@ function useExtrapolationMeta({
401407 const discoverQuery : NewQuery = {
402408 id : undefined ,
403409 name : 'Explore - Extrapolation Meta' ,
404- fields : [ 'count_sample()' , 'avg_sample(sampling_rate)' , ' min(sampling_rate)'] ,
410+ fields : [ 'count_sample()' , 'min(sampling_rate)' ] ,
405411 query : search . formatString ( ) ,
406412 version : 2 ,
407413 dataset,
@@ -455,3 +461,7 @@ const ChartFooter = styled('div')`
455461 margin-top: ${ space ( 1.5 ) } ;
456462 margin-bottom: 0;
457463` ;
464+
465+ const InsufficientSamples = styled ( 'span' ) `
466+ text-decoration: underline dotted ${ p => p . theme . gray300 } ;
467+ ` ;
0 commit comments