@@ -327,7 +358,7 @@ export function PreviewChart({
onLoad={setChartLoading}
id="customThresholdPreviewChart"
style={{ height: 180 }}
- timeRange={{ from: `now-${timeSize * 20}${timeUnit}`, to: 'now' }}
+ timeRange={timeRange}
attributes={attributes}
disableTriggers={true}
query={{
diff --git a/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx b/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx
index a97de99ec8e78..8f569e1d80b17 100644
--- a/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx
+++ b/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.test.tsx
@@ -20,8 +20,8 @@ import Expressions from './custom_threshold_rule_expression';
import { AlertParams, CustomThresholdPrefillOptions } from './types';
jest.mock('../../utils/kibana_react');
-jest.mock('./components/preview_chart/preview_chart', () => ({
- PreviewChart: jest.fn(() =>
),
+jest.mock('./components/rule_condition_chart/rule_condition_chart', () => ({
+ RuleConditionChart: jest.fn(() =>
),
}));
const useKibanaMock = useKibana as jest.Mock;
diff --git a/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx b/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx
index da883e2bc36ed..43cd185d55c4a 100644
--- a/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx
+++ b/x-pack/plugins/observability/public/components/custom_threshold/custom_threshold_rule_expression.tsx
@@ -42,7 +42,7 @@ import { TimeUnitChar } from '../../../common/utils/formatters/duration';
import { AlertContextMeta, AlertParams, MetricExpression } from './types';
import { ExpressionRow } from './components/expression_row';
import { MetricsExplorerFields, GroupBy } from './components/group_by';
-import { PreviewChart } from './components/preview_chart/preview_chart';
+import { RuleConditionChart as PreviewChart } from './components/rule_condition_chart/rule_condition_chart';
const FILTER_TYPING_DEBOUNCE_MS = 500;
@@ -458,6 +458,7 @@ export default function Expressions(props: Props) {
filterQuery={(ruleParams.searchConfiguration?.query as Query)?.query as string}
groupBy={ruleParams.groupBy}
error={(errors[idx] as IErrorObject) || emptyError}
+ timeRange={{ from: `now-${(timeSize ?? 1) * 20}${timeUnit}`, to: 'now' }}
/>
diff --git a/x-pack/plugins/observability/public/pages/alert_details/components/header_actions.tsx b/x-pack/plugins/observability/public/pages/alert_details/components/header_actions.tsx
index fa6ae4c72758a..88418530eb757 100644
--- a/x-pack/plugins/observability/public/pages/alert_details/components/header_actions.tsx
+++ b/x-pack/plugins/observability/public/pages/alert_details/components/header_actions.tsx
@@ -139,7 +139,7 @@ export function HeaderActions({ alert, alertStatus, onUntrackAlert }: HeaderActi
/>
}
>
-