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 (opensearch-project#1187) (opensearch-project#1188)

* remove unused files

* missing snapshots

* remove unused files

* fix for count distribution disappear on page refresh

* fix query composing issue in app analytics

* add one fix for count distribution and update snapshots

---------

(cherry picked from commit 0b238a0)

Signed-off-by: Eric Wei <menwe@amazon.com>
Signed-off-by: Eric <menwe@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 6db98ee)
  • Loading branch information
opensearch-trigger-bot[bot] authored and A9 Swift Project User committed Jan 8, 2024
1 parent a5a81a6 commit 733a596
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
4 changes: 2 additions & 2 deletions auto_sync_commit_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"last_github_commit": "d19d8e0b3c3af2978842b136853715d2840e1ada",
"last_gitfarm_commit": "a094398ca418a1934e0ed231b29c42a4c70b76b0"
"last_github_commit": "6db98ee9fc0fb18af0a30c4269bd7263a31e6696",
"last_gitfarm_commit": "64ab0b8169f486e22006855304e2ad5ec4b588f4"
}
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 733a596

Please sign in to comment.