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 <[email protected]>
Co-authored-by: Faisal Kanout <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2024
1 parent 3923007 commit 2a7689e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2a7689e

Please sign in to comment.