Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.11] Bug fixes for observability count distribution and application analytics #1189

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion public/components/common/query_utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ export const buildPatternsQuery = (
return finalQuery;
};

export const buildQuery = (baseQuery: string, currQuery: string) => baseQuery + '| ' + currQuery;
export const buildQuery = (baseQuery: string, currQuery: string) => {
if (!currQuery) return baseQuery;
return `${baseQuery} | ${currQuery}`;
};

export const buildRawQuery = (query: IQuery, appBaseQuery: string) => {
if (appBaseQuery && !query.rawQuery.includes(appBaseQuery))
Expand Down
17 changes: 15 additions & 2 deletions public/components/event_analytics/explorer/explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,12 @@ export const Explorer = ({
...TIME_INTERVAL_OPTIONS,
]);
selectedIntervalRef.current = { text: 'Auto', value: 'auto_' + minInterval };
dispatch(
updateCountDistribution({
tabId,
data: { selectedInterval: selectedIntervalRef.current.value.replace(/^auto_/, '') },
})
);
};

useEffect(() => {
Expand Down Expand Up @@ -495,13 +501,18 @@ export const Explorer = ({
selectedIntervalRef.current = timeIntervalOptions[intervalOptionsIndex];
getPatterns(intrv, getErrorHandler('Error fetching patterns'));
}}
stateInterval={selectedIntervalRef.current?.value}
stateInterval={
countDistribution.selectedInterval || selectedIntervalRef.current?.value
}
startTime={appLogEvents ? startTime : dateRange[0]}
endTime={appLogEvents ? endTime : dateRange[1]}
/>
<EuiSpacer size="s" />
<CountDistribution
countDistribution={countDistribution}
selectedInterval={selectedIntervalRef.current?.value}
selectedInterval={
countDistribution.selectedInterval || selectedIntervalRef.current?.value
}
startTime={appLogEvents ? startTime : dateRange[0]}
endTime={appLogEvents ? endTime : dateRange[1]}
/>
Expand Down Expand Up @@ -783,6 +794,8 @@ export const Explorer = ({
subType,
selectedCustomPanelOptions,
explorerSearchMeta,
selectedIntervalRef.current,
countDistribution,
]);

const liveTailLoop = async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { BarOrientation, LONG_CHART_COLOR } from '../../../../../../common/constants/shared';
import { Plt } from '../../../../visualizations/plotly/plot';
import { fillTimeDataWithEmpty } from '../../../utils/utils';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const countDistributionSlice = createSlice({
reducers: {
render: (state, { payload }) => {
state[payload.tabId] = {
...state[payload.tabId],
...payload.data,
};
},
Expand Down
Loading