@@ -150,7 +150,7 @@ export function buildBurnRateOption(inputs: BurnRateOptionInputs): echarts.EChar
150150 const ts = formatTooltipTs ( list [ 0 ] . axisValue , tz ) ;
151151 const rows = list
152152 . map ( ( p ) => {
153- const raw = Array . isArray ( p . value ) ? p . value [ 2 ] ?? p . value [ 1 ] : ( p . value as number ) ;
153+ const raw = Array . isArray ( p . value ) ? ( p . value [ 2 ] ?? p . value [ 1 ] ) : ( p . value as number ) ;
154154 const swatch = `<span style="display:inline-block;width:10px;height:10px;background:${ p . color } ;margin-right:6px;border-radius:2px;"></span>` ;
155155 // Delta versus this tier's threshold: how much over/under the burn
156156 // rate that would fire the alert.
@@ -284,11 +284,10 @@ const TierFetcher: React.FC<TierFetcherProps> = ({
284284 errorBudget,
285285 onChange,
286286} ) => {
287- const query = useMemo ( ( ) => buildErrorRatioExprForWindow ( slo , objective , tier . longWindow ) , [
288- slo ,
289- objective ,
290- tier . longWindow ,
291- ] ) ;
287+ const query = useMemo (
288+ ( ) => buildErrorRatioExprForWindow ( slo , objective , tier . longWindow ) ,
289+ [ slo , objective , tier . longWindow ]
290+ ) ;
292291 const { series, isLoading, error } = usePromQLChartData ( {
293292 promqlQuery : query ?? '' ,
294293 timeRange,
@@ -448,46 +447,56 @@ export const SloBurnRateChart: React.FC<SloBurnRateChartProps> = ({
448447 < EuiText size = "s" > { firstError . message } </ EuiText >
449448 </ EuiCallOut >
450449 ) }
451- { tiers . length > 0 && ! firstError && ! isLoading && ! hasData && ! probeLoading && ! metricExists && (
452- < EuiCallOut
453- size = "s"
454- color = "warning"
455- iconType = "alert"
456- title = { i18n . translate ( 'observability.apm.slo.burnRateChart.missingMetric.title' , {
457- defaultMessage : 'SLI source metric not found in this datasource' ,
458- } ) }
459- data-test-subj = "slosBurnRateMissingMetric"
460- >
461- < EuiText size = "s" >
462- { i18n . translate ( 'observability.apm.slo.burnRateChart.missingMetric.bodyPrefix' , {
463- defaultMessage : 'No samples exist for the metric this SLI queries on' ,
450+ { tiers . length > 0 &&
451+ ! firstError &&
452+ ! isLoading &&
453+ ! hasData &&
454+ ! probeLoading &&
455+ ! metricExists && (
456+ < EuiCallOut
457+ size = "s"
458+ color = "warning"
459+ iconType = "alert"
460+ title = { i18n . translate ( 'observability.apm.slo.burnRateChart.missingMetric.title' , {
461+ defaultMessage : 'SLI source metric not found in this datasource' ,
464462 } ) }
465- < strong > { prometheusConnectionId } </ strong >
466- { i18n . translate ( 'observability.apm.slo.burnRateChart.missingMetric.bodySuffix' , {
467- defaultMessage :
468- ". Burn rate is derived from the same error ratio as the budget chart — if that metric is absent, burn rate can't populate. Waiting won't help; re-check the SLI's metric / selectors." ,
463+ data-test-subj = "slosBurnRateMissingMetric"
464+ >
465+ < EuiText size = "s" >
466+ { i18n . translate ( 'observability.apm.slo.burnRateChart.missingMetric.bodyPrefix' , {
467+ defaultMessage : 'No samples exist for the metric this SLI queries on' ,
468+ } ) }
469+ < strong > { prometheusConnectionId } </ strong >
470+ { i18n . translate ( 'observability.apm.slo.burnRateChart.missingMetric.bodySuffix' , {
471+ defaultMessage :
472+ ". Burn rate is derived from the same error ratio as the budget chart — if that metric is absent, burn rate can't populate. Waiting won't help; re-check the SLI's metric / selectors." ,
473+ } ) }
474+ </ EuiText >
475+ </ EuiCallOut >
476+ ) }
477+ { tiers . length > 0 &&
478+ ! firstError &&
479+ ! isLoading &&
480+ ! hasData &&
481+ ! probeLoading &&
482+ metricExists && (
483+ < EuiCallOut
484+ size = "s"
485+ color = "primary"
486+ iconType = "iInCircle"
487+ title = { i18n . translate ( 'observability.apm.slo.burnRateChart.emptyRange.title' , {
488+ defaultMessage : 'No samples in the selected time range' ,
469489 } ) }
470- </ EuiText >
471- </ EuiCallOut >
472- ) }
473- { tiers . length > 0 && ! firstError && ! isLoading && ! hasData && ! probeLoading && metricExists && (
474- < EuiCallOut
475- size = "s"
476- color = "primary"
477- iconType = "iInCircle"
478- title = { i18n . translate ( 'observability.apm.slo.burnRateChart.emptyRange.title' , {
479- defaultMessage : 'No samples in the selected time range' ,
480- } ) }
481- data-test-subj = "slosBurnRateEmpty"
482- >
483- < EuiText size = "s" >
484- { i18n . translate ( 'observability.apm.slo.burnRateChart.emptyRange.body' , {
485- defaultMessage :
486- 'The metric exists in this datasource but the current range returned no burn-rate samples. Widen the time range, or wait for the next Prometheus scrape + rule evaluation.' ,
487- } ) }
488- </ EuiText >
489- </ EuiCallOut >
490- ) }
490+ data-test-subj = "slosBurnRateEmpty"
491+ >
492+ < EuiText size = "s" >
493+ { i18n . translate ( 'observability.apm.slo.burnRateChart.emptyRange.body' , {
494+ defaultMessage :
495+ 'The metric exists in this datasource but the current range returned no burn-rate samples. Widen the time range, or wait for the next Prometheus scrape + rule evaluation.' ,
496+ } ) }
497+ </ EuiText >
498+ </ EuiCallOut >
499+ ) }
491500 { tiers . length > 0 && hasData && < EchartsRender spec = { spec } height = { 260 } /> }
492501 { overflow > 0 && (
493502 < >
0 commit comments