Skip to content

Commit

Permalink
[RCA] [Events timeline] Show all events (elastic#202235)
Browse files Browse the repository at this point in the history
As part of elastic#200799, this PR
removes filter (previously the filter was based on any group by field,
which was changed to focus only on `service.name` for kubecon demo) so
that all events are shown on events timeline.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Faisal Kanout <faisal.kanout@elastic.co>
(cherry picked from commit 2a7689e)
  • Loading branch information
benakansara committed Dec 4, 2024
1 parent d26bdb1 commit 5f86970
Showing 2 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -11,9 +11,6 @@ import { Chart, Axis, AreaSeries, Position, ScaleType, Settings } from '@elastic
import { useActiveCursor } from '@kbn/charts-plugin/public';
import { EuiSkeletonText } from '@elastic/eui';
import { getBrushData } from '@kbn/observability-utils-browser/chart/utils';
import { Group } from '@kbn/observability-alerting-rule-utils';
import { ALERT_GROUP } from '@kbn/rule-data-utils';
import { SERVICE_NAME } from '@kbn/observability-shared-plugin/common';
import { AnnotationEvent } from './annotation_event';
import { TIME_LINE_THEME } from './timeline_theme';
import { useFetchEvents } from '../../../../hooks/use_fetch_events';
@@ -27,19 +24,10 @@ export const EventsTimeLine = () => {
const baseTheme = dependencies.start.charts.theme.useChartsBaseTheme();

const { globalParams, updateInvestigationParams } = useInvestigation();
const { alert } = useInvestigation();

const filter = useMemo(() => {
const group = (alert?.[ALERT_GROUP] as unknown as Group[])?.find(
({ field }) => field === SERVICE_NAME
);
return group ? `{"${SERVICE_NAME}":"${alert?.[SERVICE_NAME]}"}` : '';
}, [alert]);

const { data: events, isLoading } = useFetchEvents({
rangeFrom: globalParams.timeRange.from,
rangeTo: globalParams.timeRange.to,
filter,
});

const chartRef = useRef(null);
Original file line number Diff line number Diff line change
@@ -66,7 +66,6 @@
"@kbn/calculate-auto",
"@kbn/ml-random-sampler-utils",
"@kbn/charts-plugin",
"@kbn/observability-alerting-rule-utils",
"@kbn/observability-utils-browser",
"@kbn/usage-collection-plugin",
"@kbn/inference-common",

0 comments on commit 5f86970

Please sign in to comment.