Skip to content

Commit

Permalink
Bug fixes for observability count distribution and application analyt…
Browse files Browse the repository at this point in the history
…ics (#1187)

* remove unused files

Signed-off-by: Eric Wei <[email protected]>

* missing snapshots

Signed-off-by: Eric Wei <[email protected]>

* remove unused files

Signed-off-by: Eric Wei <[email protected]>

* fix for count distribution disappear on page refresh

Signed-off-by: Eric <[email protected]>

* fix query composing issue in app analytics

Signed-off-by: Eric <[email protected]>

* add one fix for count distribution and update snapshots

Signed-off-by: Eric <[email protected]>

---------

Signed-off-by: Eric Wei <[email protected]>
Signed-off-by: Eric <[email protected]>
(cherry picked from commit 0b238a0)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 25, 2023
1 parent 6b495f3 commit 47a8664
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
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

0 comments on commit 47a8664

Please sign in to comment.