Skip to content

Commit

Permalink
Hide preview charts in APM rules (elastic#156966)
Browse files Browse the repository at this point in the history
Hides preview charts in the following APM rules until
elastic#156625 (WIP) gets merged.

- APM Latency threshold
- APM Failed transaction rate
- APM Error count threshold

(cherry picked from commit d10c48b)
  • Loading branch information
benakansara committed May 8, 2023
1 parent 86c670f commit 31c19fc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,16 @@ export function ErrorCountRuleType(props: Props) {
/>,
];

const chartPreview = (
// hide preview chart until https://github.com/elastic/kibana/pull/156625 gets merged
const showChartPreview = false;
const chartPreview = showChartPreview ? (
<ChartPreview
series={[{ data: data?.errorCountChartPreview ?? [] }]}
threshold={params.threshold}
yTickFormat={asInteger}
uiSettings={services.uiSettings}
/>
);
) : null;

const groupAlertsBy = (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,16 @@ export function TransactionDurationRuleType(props: Props) {
// The threshold from the form is in ms. Convert to µs.
const thresholdMs = params.threshold * 1000;

const chartPreview = (
// hide preview chart until https://github.com/elastic/kibana/pull/156625 gets merged
const showChartPreview = false;
const chartPreview = showChartPreview ? (
<ChartPreview
series={latencyChartPreview}
threshold={thresholdMs}
yTickFormat={yTickFormat}
uiSettings={services.uiSettings}
/>
);
) : null;

const onGroupByChange = useCallback(
(group: string[] | null) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,16 @@ export function TransactionErrorRateRuleType(props: Props) {
/>,
];

const chartPreview = (
// hide preview chart until https://github.com/elastic/kibana/pull/156625 gets merged
const showChartPreview = false;
const chartPreview = showChartPreview ? (
<ChartPreview
series={[{ data: data?.errorRateChartPreview ?? [] }]}
yTickFormat={(d: number | null) => asPercent(d, 1)}
threshold={thresholdAsPercent}
uiSettings={services.uiSettings}
/>
);
) : null;

const groupAlertsBy = (
<>
Expand Down

0 comments on commit 31c19fc

Please sign in to comment.