From 5dfe245f2d1fbae482b74e1605e09fcbd720e42e Mon Sep 17 00:00:00 2001 From: Vikrant Gupta Date: Tue, 24 Dec 2024 19:07:20 +0530 Subject: [PATCH 01/10] chore: fix cross spawn vulnerability (#6709) --- frontend/package.json | 3 ++- frontend/yarn.lock | 50 +++++-------------------------------------- 2 files changed, 7 insertions(+), 46 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index bbfd1c85647..0379ac9bffe 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -242,6 +242,7 @@ "xml2js": "0.5.0", "phin": "^3.7.1", "body-parser": "1.20.3", - "http-proxy-middleware": "3.0.3" + "http-proxy-middleware": "3.0.3", + "cross-spawn": "7.0.5" } } diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 8f1214a21a3..15e4b72c0fe 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -6740,21 +6740,10 @@ cross-fetch@3.1.5: dependencies: node-fetch "2.6.7" -cross-spawn@^6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" - integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== - dependencies: - nice-try "^1.0.4" - path-key "^2.0.1" - semver "^5.5.0" - shebang-command "^1.2.0" - which "^1.2.9" - -cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== +cross-spawn@7.0.5, cross-spawn@^6.0.5, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: + version "7.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.5.tgz#910aac880ff5243da96b728bc6521a5f6c2f2f82" + integrity sha512-ZVJrKKYunU38/76t0RMOulHOnUcbU9GbpWKAOZ0mhjr7CX6FVrH+4FrAapSOekrgFQ3f/8gwMEuIft0aKq6Hug== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" @@ -12120,11 +12109,6 @@ nice-color-palettes@^1.0.1: new-array "^1.0.0" xhr-request "^1.0.1" -nice-try@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" - integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== - no-case@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz" @@ -12682,11 +12666,6 @@ path-is-absolute@^1.0.0: resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== -path-key@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== - path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" @@ -14758,7 +14737,7 @@ selfsigned@^2.1.1: dependencies: node-forge "^1" -"semver@2 || 3 || 4 || 5", semver@7.3.7, semver@7.5.4, semver@7.x, semver@^5.5.0, semver@^5.6.0, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: +"semver@2 || 3 || 4 || 5", semver@7.3.7, semver@7.5.4, semver@7.x, semver@^5.6.0, semver@^6.0.0, semver@^6.1.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0, semver@^6.3.1, semver@^7.2.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -14870,13 +14849,6 @@ shallowequal@^1.1.0: resolved "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== -shebang-command@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" - integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== - dependencies: - shebang-regex "^1.0.0" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -14884,11 +14856,6 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" -shebang-regex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" - integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== - shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz" @@ -16765,13 +16732,6 @@ which-typed-array@^1.1.9: has-tostringtag "^1.0.0" is-typed-array "^1.1.10" -which@^1.2.9: - version "1.3.1" - resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" - integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== - dependencies: - isexe "^2.0.0" - which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From 838192cf5c621715769917132f57e265a5b343fe Mon Sep 17 00:00:00 2001 From: Shaheer Kochai Date: Tue, 24 Dec 2024 19:55:07 +0430 Subject: [PATCH 02/10] fix(Traces Explorer): prevent duplicate API calls to query_range in traces explorer (#6677) * fix(Traces Explorer): prevent duplicate API calls to query_range in traces explorer * fix(QueryBuilder): fix the race condition causing duplicate triggering of initQueryBuilderData * chore: address review comments * fix: fix the failing tests --------- Co-authored-by: Vikrant Gupta --- .../TracesExplorer/ListView/index.tsx | 64 +++++++++++++------ .../pages/TracesExplorer/Filter/Filter.tsx | 4 ++ .../__test__/TracesExplorer.test.tsx | 7 ++ frontend/src/providers/QueryBuilder.tsx | 7 +- 4 files changed, 60 insertions(+), 22 deletions(-) diff --git a/frontend/src/container/TracesExplorer/ListView/index.tsx b/frontend/src/container/TracesExplorer/ListView/index.tsx index e59906c0755..1c8209f709a 100644 --- a/frontend/src/container/TracesExplorer/ListView/index.tsx +++ b/frontend/src/container/TracesExplorer/ListView/index.tsx @@ -7,10 +7,12 @@ import { REACT_QUERY_KEY } from 'constants/reactQueryKeys'; import EmptyLogsSearch from 'container/EmptyLogsSearch/EmptyLogsSearch'; import NoLogs from 'container/NoLogs/NoLogs'; import { useOptionsMenu } from 'container/OptionsMenu'; +import { CustomTimeType } from 'container/TopNav/DateTimeSelectionV2/config'; import TraceExplorerControls from 'container/TracesExplorer/Controls'; import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange'; import { useQueryBuilder } from 'hooks/queryBuilder/useQueryBuilder'; import { Pagination } from 'hooks/queryPagination'; +import { getDefaultPaginationConfig } from 'hooks/queryPagination/utils'; import useDragColumns from 'hooks/useDragColumns'; import { getDraggedColumns } from 'hooks/useDragColumns/utils'; import useUrlQueryData from 'hooks/useUrlQueryData'; @@ -32,12 +34,19 @@ interface ListViewProps { } function ListView({ isFilterApplied }: ListViewProps): JSX.Element { - const { stagedQuery, panelType } = useQueryBuilder(); + const { + stagedQuery, + panelType: panelTypeFromQueryBuilder, + } = useQueryBuilder(); - const { selectedTime: globalSelectedTime, maxTime, minTime } = useSelector< - AppState, - GlobalReducer - >((state) => state.globalTime); + const panelType = panelTypeFromQueryBuilder || PANEL_TYPES.LIST; + + const { + selectedTime: globalSelectedTime, + maxTime, + minTime, + loading: timeRangeUpdateLoading, + } = useSelector((state) => state.globalTime); const { options, config } = useOptionsMenu({ storageKey: LOCALSTORAGE.TRACES_LIST_OPTIONS, @@ -55,34 +64,51 @@ function ListView({ isFilterApplied }: ListViewProps): JSX.Element { const { queryData: paginationQueryData } = useUrlQueryData( QueryParams.pagination, ); + const paginationConfig = + paginationQueryData ?? getDefaultPaginationConfig(PER_PAGE_OPTIONS); + + const queryKey = useMemo( + () => [ + REACT_QUERY_KEY.GET_QUERY_RANGE, + globalSelectedTime, + maxTime, + minTime, + stagedQuery, + panelType, + paginationConfig, + options?.selectColumns, + ], + [ + stagedQuery, + panelType, + globalSelectedTime, + paginationConfig, + options?.selectColumns, + maxTime, + minTime, + ], + ); const { data, isFetching, isLoading, isError } = useGetQueryRange( { query: stagedQuery || initialQueriesMap.traces, - graphType: panelType || PANEL_TYPES.LIST, - selectedTime: 'GLOBAL_TIME', - globalSelectedInterval: globalSelectedTime, + graphType: panelType, + selectedTime: 'GLOBAL_TIME' as const, + globalSelectedInterval: globalSelectedTime as CustomTimeType, params: { dataSource: 'traces', }, tableParams: { - pagination: paginationQueryData, + pagination: paginationConfig, selectColumns: options?.selectColumns, }, }, DEFAULT_ENTITY_VERSION, { - queryKey: [ - REACT_QUERY_KEY.GET_QUERY_RANGE, - globalSelectedTime, - maxTime, - minTime, - stagedQuery, - panelType, - paginationQueryData, - options?.selectColumns, - ], + queryKey, enabled: + // don't make api call while the time range state in redux is loading + !timeRangeUpdateLoading && !!stagedQuery && panelType === PANEL_TYPES.LIST && !!options?.selectColumns?.length, diff --git a/frontend/src/pages/TracesExplorer/Filter/Filter.tsx b/frontend/src/pages/TracesExplorer/Filter/Filter.tsx index 27c3b659501..c4ee2dba5a7 100644 --- a/frontend/src/pages/TracesExplorer/Filter/Filter.tsx +++ b/frontend/src/pages/TracesExplorer/Filter/Filter.tsx @@ -203,6 +203,10 @@ export function Filter(props: FilterProps): JSX.Element { selectedFilters, }); } + + if (isEqual(currentQuery, preparedQuery) && !props?.resetAll) { + return; + } redirectWithQueryBuilderData(preparedQuery); }, [currentQuery, redirectWithQueryBuilderData, selectedFilters], diff --git a/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx b/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx index c4fdf588de9..d5e89feb20d 100644 --- a/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx +++ b/frontend/src/pages/TracesExplorer/__test__/TracesExplorer.test.tsx @@ -109,6 +109,13 @@ jest.mock('container/OptionsMenu/useOptionsMenu', () => ({ default: (): any => optionMenuReturn, })); +jest.mock('react-redux', () => ({ + ...jest.requireActual('react-redux'), + useSelector: (): any => ({ + loading: false, + }), +})); + describe('TracesExplorer - Filters', () => { // Initial filter panel rendering // Test the initial state like which filters section are opened, default state of duration slider, etc. diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx index b79538cb45e..9db10d27675 100644 --- a/frontend/src/providers/QueryBuilder.tsx +++ b/frontend/src/providers/QueryBuilder.tsx @@ -95,7 +95,8 @@ export function QueryBuilderProvider({ const urlQuery = useUrlQuery(); const history = useHistory(); const location = useLocation(); - const currentPathnameRef = useRef(null); + + const currentPathnameRef = useRef(location.pathname); const { maxTime, minTime } = useSelector( (state) => state.globalTime, @@ -814,14 +815,14 @@ export function QueryBuilderProvider({ }; useEffect(() => { - if (stagedQuery && location.pathname !== currentPathnameRef.current) { + if (location.pathname !== currentPathnameRef.current) { currentPathnameRef.current = location.pathname; setStagedQuery(null); // reset the last used query to 0 when navigating away from the page setLastUsedQuery(0); } - }, [location, stagedQuery, currentQuery]); + }, [location.pathname]); const handleOnUnitsChange = useCallback( (unit: string) => { From d2aa1cf06e4b0a83bc70f6e0f5416ab6c68af3ed Mon Sep 17 00:00:00 2001 From: Shaheer Kochai Date: Tue, 24 Dec 2024 20:09:48 +0430 Subject: [PATCH 03/10] fix: fix the issue of saved view overriding query for logs and traces (#6678) * fix: fix the issue of saved view overriding query for logs and traces for builder type query * chore: refactored isDefaultQuery to use a function to extract relevant keys and use lodash's isEqual * fix: add check for multiple queries in isDefaultQuery logic * chore: moved extractRelevantKeys outside isDefaultQuery * fix: fix the failing tests --- .../ExplorerOptions/ExplorerOptions.tsx | 14 ++- .../__tests__/LogsExplorer.test.tsx | 1 + .../TracesExplorer/__test__/testUtils.ts | 1 + frontend/src/providers/QueryBuilder.tsx | 88 ++++++++++++++++++- frontend/src/types/common/queryBuilder.ts | 6 ++ 5 files changed, 108 insertions(+), 2 deletions(-) diff --git a/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx b/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx index 8bccc41c67f..85ce464db48 100644 --- a/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx +++ b/frontend/src/container/ExplorerOptions/ExplorerOptions.tsx @@ -112,6 +112,7 @@ function ExplorerOptions({ panelType, isStagedQueryUpdated, redirectWithQueryBuilderData, + isDefaultQuery, } = useQueryBuilder(); const handleSaveViewModalToggle = (): void => { @@ -478,6 +479,11 @@ function ExplorerOptions({ ] = useState(false); useEffect(() => { + // If the query is not the default query, don't set the recently used saved view + if (!isDefaultQuery({ currentQuery, sourcePage: sourcepage })) { + return; + } + const parsedPreservedView = JSON.parse( localStorage.getItem(PRESERVED_VIEW_LOCAL_STORAGE_KEY) || '{}', ); @@ -499,12 +505,18 @@ function ExplorerOptions({ setIsRecentlyUsedSavedViewSelected(false); } - return (): void => clearTimeout(timeoutId); + // eslint-disable-next-line consistent-return + return (): void => { + clearTimeout(timeoutId); + }; }, [ PRESERVED_VIEW_LOCAL_STORAGE_KEY, PRESERVED_VIEW_TYPE, + currentQuery, + isDefaultQuery, isRecentlyUsedSavedViewSelected, onMenuItemSelectHandler, + sourcepage, viewKey, viewName, viewsData?.data?.data, diff --git a/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx b/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx index f76bdce6108..f22bfbac803 100644 --- a/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx +++ b/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx @@ -155,6 +155,7 @@ describe('Logs Explorer Tests', () => { const { queryAllByText } = render( false, currentQuery: { ...initialQueriesMap.metrics, builder: { diff --git a/frontend/src/pages/TracesExplorer/__test__/testUtils.ts b/frontend/src/pages/TracesExplorer/__test__/testUtils.ts index 8a46740e6a9..22817103e54 100644 --- a/frontend/src/pages/TracesExplorer/__test__/testUtils.ts +++ b/frontend/src/pages/TracesExplorer/__test__/testUtils.ts @@ -195,6 +195,7 @@ export const compositeQuery: Query = { export const redirectWithQueryBuilderData = jest.fn(); export const qbProviderValue = { + isDefaultQuery: jest.fn(() => false), currentQuery: { ...initialQueriesMap.traces, builder: { diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx index 9db10d27675..031ca9841f0 100644 --- a/frontend/src/providers/QueryBuilder.tsx +++ b/frontend/src/providers/QueryBuilder.tsx @@ -27,7 +27,7 @@ import { createIdFromObjectFields } from 'lib/createIdFromObjectFields'; import { createNewBuilderItemName } from 'lib/newQueryBuilder/createNewBuilderItemName'; import { getOperatorsBySourceAndPanelType } from 'lib/newQueryBuilder/getOperatorsBySourceAndPanelType'; import { replaceIncorrectObjectFields } from 'lib/replaceIncorrectObjectFields'; -import { cloneDeep, get, merge, set } from 'lodash-es'; +import { cloneDeep, get, isEqual, merge, set } from 'lodash-es'; import { createContext, PropsWithChildren, @@ -53,6 +53,7 @@ import { ViewProps } from 'types/api/saveViews/types'; import { EQueryType } from 'types/common/dashboard'; import { DataSource, + IsDefaultQueryProps, QueryBuilderContextType, QueryBuilderData, } from 'types/common/queryBuilder'; @@ -87,6 +88,7 @@ export const QueryBuilderContext = createContext({ initQueryBuilderData: () => {}, handleOnUnitsChange: () => {}, isStagedQueryUpdated: () => false, + isDefaultQuery: () => false, }); export function QueryBuilderProvider({ @@ -250,6 +252,88 @@ export function QueryBuilderProvider({ [getElementWithActualOperator], ); + const extractRelevantKeys = useCallback( + (queryData: IBuilderQuery): IBuilderQuery => { + const { + dataSource, + queryName, + aggregateOperator, + aggregateAttribute, + timeAggregation, + spaceAggregation, + functions, + filters, + expression, + disabled, + stepInterval, + having, + groupBy, + legend, + } = queryData; + + return { + dataSource, + queryName, + aggregateOperator, + // remove id from aggregateAttribute + aggregateAttribute: { + ...aggregateAttribute, + id: '', + }, + timeAggregation, + spaceAggregation, + functions, + filters, + expression, + disabled, + stepInterval, + having, + groupBy, + legend, + // set to default values + orderBy: [], + limit: null, + reduceTo: 'avg', + }; + }, + [], + ); + + const isDefaultQuery = useCallback( + ({ currentQuery, sourcePage }: IsDefaultQueryProps): boolean => { + // Get default query with updated operators + const defaultQuery = updateAllQueriesOperators( + initialQueriesMap[sourcePage], + PANEL_TYPES.LIST, + sourcePage, + ); + + // Early return if query types don't match + if (currentQuery.queryType !== defaultQuery.queryType) { + return false; + } + + // Only compare builder queries + if (currentQuery.queryType !== EQueryType.QUERY_BUILDER) { + return false; + } + + // If there is more than one query, then it is not a default query + if (currentQuery.builder.queryData.length > 1) { + return false; + } + + const currentBuilderData = extractRelevantKeys( + currentQuery.builder.queryData[0], + ); + const defaultBuilderData = extractRelevantKeys( + defaultQuery.builder.queryData[0], + ); + + return isEqual(currentBuilderData, defaultBuilderData); + }, + [updateAllQueriesOperators, extractRelevantKeys], + ); const updateQueriesData = useCallback( ( query: Query, @@ -884,6 +968,7 @@ export function QueryBuilderProvider({ handleRunQuery, resetQuery, updateAllQueriesOperators, + isDefaultQuery, updateQueriesData, initQueryBuilderData, handleOnUnitsChange, @@ -910,6 +995,7 @@ export function QueryBuilderProvider({ redirectWithQueryBuilderData, handleRunQuery, updateAllQueriesOperators, + isDefaultQuery, updateQueriesData, initQueryBuilderData, handleOnUnitsChange, diff --git a/frontend/src/types/common/queryBuilder.ts b/frontend/src/types/common/queryBuilder.ts index 0987347fd54..fe77e1ad68d 100644 --- a/frontend/src/types/common/queryBuilder.ts +++ b/frontend/src/types/common/queryBuilder.ts @@ -247,9 +247,15 @@ export type QueryBuilderContextType = { viewData: ViewProps[] | undefined, viewKey: string, ) => boolean; + isDefaultQuery: (props: IsDefaultQueryProps) => boolean; }; export type QueryAdditionalFilter = { field: keyof IBuilderQuery; text: string; }; + +export type IsDefaultQueryProps = { + currentQuery: Query; + sourcePage: DataSource; +}; From 14096f8d534e9380b8af7f906dc16b329e2f2f44 Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Thu, 26 Dec 2024 16:46:55 +0530 Subject: [PATCH 04/10] ci(releaser): github workflow for signoz releases (#6719) ### Summary - github workflow for automated SigNoz releases Signed-off-by: Prashant Shahi --- .github/workflows/releaser.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/releaser.yaml diff --git a/.github/workflows/releaser.yaml b/.github/workflows/releaser.yaml new file mode 100644 index 00000000000..3da9ece7eef --- /dev/null +++ b/.github/workflows/releaser.yaml @@ -0,0 +1,16 @@ +name: releaser + +on: + # schedule every wednesday 9:30 AM UTC (3pm IST) + schedule: + - cron: '30 9 * * 3' + + # allow manual triggering of the workflow by a maintainer with no inputs + workflow_dispatch: {} + +jobs: + releaser: + uses: signoz/primus.workflows/.github/workflows/releaser-signoz.yaml@feat/releaser-signoz + secrets: inherit + with: + PRIMUS_REF: feat/signoz-releaser From 00abadd429774f575b180ae963260c97024eace0 Mon Sep 17 00:00:00 2001 From: Shaheer Kochai Date: Thu, 26 Dec 2024 18:10:53 +0430 Subject: [PATCH 05/10] fix: update API key expiration display logic in MultiIngestionSettings component (#6717) - display 'No Expiry' for invalid or zero date expiration dates. --- .../IngestionSettings/MultiIngestionSettings.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx b/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx index 53fd5269d69..6c817a41dae 100644 --- a/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx +++ b/frontend/src/container/IngestionSettings/MultiIngestionSettings.tsx @@ -561,10 +561,11 @@ function MultiIngestionSettings(): JSX.Element { APIKey.created_at, formatTimezoneAdjustedTimestamp, ); - const formattedDateAndTime = - APIKey && - APIKey?.expires_at && - getFormattedTime(APIKey?.expires_at, formatTimezoneAdjustedTimestamp); + + const expiresOn = + !APIKey?.expires_at || APIKey?.expires_at === '0001-01-01T00:00:00Z' + ? 'No Expiry' + : getFormattedTime(APIKey?.expires_at, formatTimezoneAdjustedTimestamp); const updatedOn = getFormattedTime( APIKey?.updated_at, @@ -987,7 +988,7 @@ function MultiIngestionSettings(): JSX.Element {
Expires on - {formattedDateAndTime} + {expiresOn}
From 421879cf7afa9f0a015bd5d06ccaa6e4c2b04f7d Mon Sep 17 00:00:00 2001 From: Prashant Shahi Date: Thu, 26 Dec 2024 19:47:09 +0530 Subject: [PATCH 06/10] ci(releaser): update branch reference to use latest main (#6724) ### Summary - update branch reference to use the latest main --- .github/workflows/releaser.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/releaser.yaml b/.github/workflows/releaser.yaml index 3da9ece7eef..51e18cc2632 100644 --- a/.github/workflows/releaser.yaml +++ b/.github/workflows/releaser.yaml @@ -10,7 +10,7 @@ on: jobs: releaser: - uses: signoz/primus.workflows/.github/workflows/releaser-signoz.yaml@feat/releaser-signoz + uses: signoz/primus.workflows/.github/workflows/releaser-signoz.yaml@main secrets: inherit with: - PRIMUS_REF: feat/signoz-releaser + PRIMUS_REF: main From 9f6419c2f885c3d2196cf6bf59bbb15524c4b5df Mon Sep 17 00:00:00 2001 From: "primus-bot[bot]" <171087277+primus-bot[bot]@users.noreply.github.com> Date: Thu, 26 Dec 2024 14:28:44 +0000 Subject: [PATCH 07/10] chore(release): bump to v0.65.0 (#6725) #### Summary - Release SigNoz v0.65.0 Created by [Primus-Bot](https://github.com/apps/primus-bot) --- .../clickhouse-setup/docker-compose.yaml | 83 +++++-------------- .../docker-compose-minimal.yaml | 80 +++++------------- .../docker-compose.testing.yaml | 75 ++++------------- 3 files changed, 58 insertions(+), 180 deletions(-) diff --git a/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml b/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml index 1a047fec8e9..e23c9abd7ce 100644 --- a/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml +++ b/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml @@ -1,5 +1,4 @@ version: "3.9" - x-clickhouse-defaults: &clickhouse-defaults image: clickhouse/clickhouse-server:24.1.2-alpine tty: true @@ -16,14 +15,7 @@ x-clickhouse-defaults: &clickhouse-defaults max-file: "3" healthcheck: # "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'" - test: - [ - "CMD", - "wget", - "--spider", - "-q", - "0.0.0.0:8123/ping" - ] + test: ["CMD", "wget", "--spider", "-q", "0.0.0.0:8123/ping"] interval: 30s timeout: 5s retries: 3 @@ -32,15 +24,12 @@ x-clickhouse-defaults: &clickhouse-defaults nofile: soft: 262144 hard: 262144 - x-db-depend: &db-depend depends_on: - clickhouse - otel-collector-migrator # - clickhouse-2 # - clickhouse-3 - - services: zookeeper-1: image: bitnami/zookeeper:3.7.1 @@ -57,7 +46,6 @@ services: # - ZOO_SERVERS=0.0.0.0:2888:3888,zookeeper-2:2888:3888,zookeeper-3:2888:3888 - ALLOW_ANONYMOUS_LOGIN=yes - ZOO_AUTOPURGE_INTERVAL=1 - # zookeeper-2: # image: bitnami/zookeeper:3.7.0 # hostname: zookeeper-2 @@ -89,9 +77,8 @@ services: # - ZOO_SERVERS=zookeeper-1:2888:3888,zookeeper-2:2888:3888,0.0.0.0:2888:3888 # - ALLOW_ANONYMOUS_LOGIN=yes # - ZOO_AUTOPURGE_INTERVAL=1 - clickhouse: - <<: *clickhouse-defaults + !!merge <<: *clickhouse-defaults hostname: clickhouse # ports: # - "9000:9000" @@ -103,7 +90,6 @@ services: - ./clickhouse-cluster.xml:/etc/clickhouse-server/config.d/cluster.xml # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml - ./data/clickhouse/:/var/lib/clickhouse/ - # clickhouse-2: # <<: *clickhouse-defaults # hostname: clickhouse-2 @@ -131,7 +117,6 @@ services: # - ./clickhouse-cluster.xml:/etc/clickhouse-server/config.d/cluster.xml # # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml # - ./data/clickhouse-3/:/var/lib/clickhouse/ - alertmanager: image: signoz/alertmanager:0.23.7 volumes: @@ -144,15 +129,9 @@ services: deploy: restart_policy: condition: on-failure - query-service: - image: signoz/query-service:0.64.0 - command: - [ - "-config=/root/config/prometheus.yml", - "--use-logs-new-schema=true", - "--use-trace-new-schema=true" - ] + image: signoz/query-service:0.65.0 + command: ["-config=/root/config/prometheus.yml", "--use-logs-new-schema=true", "--use-trace-new-schema=true"] # ports: # - "6060:6060" # pprof port # - "8080:8080" # query-service port @@ -170,24 +149,16 @@ services: - TELEMETRY_ENABLED=true - DEPLOYMENT_TYPE=docker-swarm healthcheck: - test: - [ - "CMD", - "wget", - "--spider", - "-q", - "localhost:8080/api/v1/health" - ] + test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/health"] interval: 30s timeout: 5s retries: 3 deploy: restart_policy: condition: on-failure - <<: *db-depend - + !!merge <<: *db-depend frontend: - image: signoz/frontend:0.64.0 + image: signoz/frontend:0.65.0 deploy: restart_policy: condition: on-failure @@ -198,15 +169,9 @@ services: - "3301:3301" volumes: - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf - otel-collector: image: signoz/signoz-otel-collector:0.111.16 - command: - [ - "--config=/etc/otel-collector-config.yaml", - "--manager-config=/etc/manager-config.yaml", - "--feature-gates=-pkg.translator.prometheus.NormalizeName" - ] + command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"] user: root # required for reading docker container logs volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -236,22 +201,20 @@ services: - clickhouse - otel-collector-migrator - query-service - otel-collector-migrator: - image: signoz/signoz-schema-migrator:0.111.16 - deploy: - restart_policy: - condition: on-failure - delay: 5s - command: - - "sync" - - "--dsn=tcp://clickhouse:9000" - - "--up=" - depends_on: - - clickhouse - # - clickhouse-2 - # - clickhouse-3 - + image: signoz/signoz-schema-migrator:0.111.16 + deploy: + restart_policy: + condition: on-failure + delay: 5s + command: + - "sync" + - "--dsn=tcp://clickhouse:9000" + - "--up=" + depends_on: + - clickhouse + # - clickhouse-2 + # - clickhouse-3 logspout: image: "gliderlabs/logspout:v3.2.14" volumes: @@ -264,17 +227,15 @@ services: mode: global restart_policy: condition: on-failure - hotrod: image: jaegertracing/example-hotrod:1.30 - command: [ "all" ] + command: ["all"] environment: - JAEGER_ENDPOINT=http://otel-collector:14268/api/traces logging: options: max-size: 50m max-file: "3" - load-hotrod: image: "signoz/locust:1.2.3" hostname: load-hotrod diff --git a/deploy/docker/clickhouse-setup/docker-compose-minimal.yaml b/deploy/docker/clickhouse-setup/docker-compose-minimal.yaml index d3ceb7bf429..7df95924f3a 100644 --- a/deploy/docker/clickhouse-setup/docker-compose-minimal.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose-minimal.yaml @@ -13,14 +13,7 @@ x-clickhouse-defaults: &clickhouse-defaults max-file: "3" healthcheck: # "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'" - test: - [ - "CMD", - "wget", - "--spider", - "-q", - "0.0.0.0:8123/ping" - ] + test: ["CMD", "wget", "--spider", "-q", "0.0.0.0:8123/ping"] interval: 30s timeout: 5s retries: 3 @@ -29,20 +22,17 @@ x-clickhouse-defaults: &clickhouse-defaults nofile: soft: 262144 hard: 262144 - x-db-depend: &db-depend depends_on: clickhouse: condition: service_healthy otel-collector-migrator-sync: condition: service_completed_successfully - # clickhouse-2: - # condition: service_healthy - # clickhouse-3: - # condition: service_healthy - + # clickhouse-2: + # condition: service_healthy + # clickhouse-3: + # condition: service_healthy services: - zookeeper-1: image: bitnami/zookeeper:3.7.1 container_name: signoz-zookeeper-1 @@ -59,7 +49,6 @@ services: # - ZOO_SERVERS=0.0.0.0:2888:3888,zookeeper-2:2888:3888,zookeeper-3:2888:3888 - ALLOW_ANONYMOUS_LOGIN=yes - ZOO_AUTOPURGE_INTERVAL=1 - # zookeeper-2: # image: bitnami/zookeeper:3.7.0 # container_name: signoz-zookeeper-2 @@ -93,9 +82,8 @@ services: # - ZOO_SERVERS=zookeeper-1:2888:3888,zookeeper-2:2888:3888,0.0.0.0:2888:3888 # - ALLOW_ANONYMOUS_LOGIN=yes # - ZOO_AUTOPURGE_INTERVAL=1 - clickhouse: - <<: *clickhouse-defaults + !!merge <<: *clickhouse-defaults container_name: signoz-clickhouse hostname: clickhouse ports: @@ -110,7 +98,6 @@ services: # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml - ./data/clickhouse/:/var/lib/clickhouse/ - ./user_scripts:/var/lib/clickhouse/user_scripts/ - # clickhouse-2: # <<: *clickhouse-defaults # container_name: signoz-clickhouse-2 @@ -128,7 +115,6 @@ services: # - ./data/clickhouse-2/:/var/lib/clickhouse/ # - ./user_scripts:/var/lib/clickhouse/user_scripts/ - # clickhouse-3: # <<: *clickhouse-defaults # container_name: signoz-clickhouse-3 @@ -145,7 +131,6 @@ services: # # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml # - ./data/clickhouse-3/:/var/lib/clickhouse/ # - ./user_scripts:/var/lib/clickhouse/user_scripts/ - alertmanager: image: signoz/alertmanager:${ALERTMANAGER_TAG:-0.23.7} container_name: signoz-alertmanager @@ -158,18 +143,11 @@ services: command: - --queryService.url=http://query-service:8085 - --storage.path=/data - # Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md` - query-service: - image: signoz/query-service:${DOCKER_TAG:-0.64.0} + image: signoz/query-service:${DOCKER_TAG:-0.65.0} container_name: signoz-query-service - command: - [ - "-config=/root/config/prometheus.yml", - "--use-logs-new-schema=true", - "--use-trace-new-schema=true" - ] + command: ["-config=/root/config/prometheus.yml", "--use-logs-new-schema=true", "--use-trace-new-schema=true"] # ports: # - "6060:6060" # pprof port # - "8080:8080" # query-service port @@ -188,21 +166,13 @@ services: - DEPLOYMENT_TYPE=docker-standalone-amd restart: on-failure healthcheck: - test: - [ - "CMD", - "wget", - "--spider", - "-q", - "localhost:8080/api/v1/health" - ] + test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/health"] interval: 30s timeout: 5s retries: 3 - <<: *db-depend - + !!merge <<: *db-depend frontend: - image: signoz/frontend:${DOCKER_TAG:-0.64.0} + image: signoz/frontend:${DOCKER_TAG:-0.65.0} container_name: signoz-frontend restart: on-failure depends_on: @@ -212,7 +182,6 @@ services: - "3301:3301" volumes: - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf - otel-collector-migrator-sync: image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16} container_name: otel-migrator-sync @@ -223,11 +192,10 @@ services: depends_on: clickhouse: condition: service_healthy - # clickhouse-2: - # condition: service_healthy - # clickhouse-3: - # condition: service_healthy - + # clickhouse-2: + # condition: service_healthy + # clickhouse-3: + # condition: service_healthy otel-collector-migrator-async: image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16} container_name: otel-migrator-async @@ -240,21 +208,14 @@ services: condition: service_healthy otel-collector-migrator-sync: condition: service_completed_successfully - # clickhouse-2: - # condition: service_healthy - # clickhouse-3: - # condition: service_healthy - + # clickhouse-2: + # condition: service_healthy + # clickhouse-3: + # condition: service_healthy otel-collector: image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.16} container_name: signoz-otel-collector - command: - [ - "--config=/etc/otel-collector-config.yaml", - "--manager-config=/etc/manager-config.yaml", - "--copy-path=/var/tmp/collector-config.yaml", - "--feature-gates=-pkg.translator.prometheus.NormalizeName" - ] + command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--copy-path=/var/tmp/collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"] user: root # required for reading docker container logs volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -284,7 +245,6 @@ services: condition: service_completed_successfully query-service: condition: service_healthy - logspout: image: "gliderlabs/logspout:v3.2.14" container_name: signoz-logspout diff --git a/deploy/docker/clickhouse-setup/docker-compose.testing.yaml b/deploy/docker/clickhouse-setup/docker-compose.testing.yaml index d99af9bc065..5317b1a8ce4 100644 --- a/deploy/docker/clickhouse-setup/docker-compose.testing.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose.testing.yaml @@ -1,8 +1,6 @@ version: "2.4" - include: - test-app-docker-compose.yaml - x-clickhouse-defaults: &clickhouse-defaults restart: on-failure # addding non LTS version due to this fix https://github.com/ClickHouse/ClickHouse/commit/32caf8716352f45c1b617274c7508c86b7d1afab @@ -18,14 +16,7 @@ x-clickhouse-defaults: &clickhouse-defaults max-file: "3" healthcheck: # "clickhouse", "client", "-u ${CLICKHOUSE_USER}", "--password ${CLICKHOUSE_PASSWORD}", "-q 'SELECT 1'" - test: - [ - "CMD", - "wget", - "--spider", - "-q", - "0.0.0.0:8123/ping" - ] + test: ["CMD", "wget", "--spider", "-q", "0.0.0.0:8123/ping"] interval: 30s timeout: 5s retries: 3 @@ -34,20 +25,17 @@ x-clickhouse-defaults: &clickhouse-defaults nofile: soft: 262144 hard: 262144 - x-db-depend: &db-depend depends_on: clickhouse: condition: service_healthy otel-collector-migrator: condition: service_completed_successfully - # clickhouse-2: - # condition: service_healthy - # clickhouse-3: - # condition: service_healthy - + # clickhouse-2: + # condition: service_healthy + # clickhouse-3: + # condition: service_healthy services: - zookeeper-1: image: bitnami/zookeeper:3.7.1 container_name: signoz-zookeeper-1 @@ -64,7 +52,6 @@ services: # - ZOO_SERVERS=0.0.0.0:2888:3888,zookeeper-2:2888:3888,zookeeper-3:2888:3888 - ALLOW_ANONYMOUS_LOGIN=yes - ZOO_AUTOPURGE_INTERVAL=1 - # zookeeper-2: # image: bitnami/zookeeper:3.7.0 # container_name: signoz-zookeeper-2 @@ -98,9 +85,8 @@ services: # - ZOO_SERVERS=zookeeper-1:2888:3888,zookeeper-2:2888:3888,0.0.0.0:2888:3888 # - ALLOW_ANONYMOUS_LOGIN=yes # - ZOO_AUTOPURGE_INTERVAL=1 - clickhouse: - <<: *clickhouse-defaults + !!merge <<: *clickhouse-defaults container_name: signoz-clickhouse hostname: clickhouse ports: @@ -115,7 +101,6 @@ services: # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml - ./data/clickhouse/:/var/lib/clickhouse/ - ./user_scripts:/var/lib/clickhouse/user_scripts/ - # clickhouse-2: # <<: *clickhouse-defaults # container_name: signoz-clickhouse-2 @@ -133,7 +118,6 @@ services: # - ./data/clickhouse-2/:/var/lib/clickhouse/ # - ./user_scripts:/var/lib/clickhouse/user_scripts/ - # clickhouse-3: # <<: *clickhouse-defaults # container_name: signoz-clickhouse-3 @@ -150,7 +134,6 @@ services: # # - ./clickhouse-storage.xml:/etc/clickhouse-server/config.d/storage.xml # - ./data/clickhouse-3/:/var/lib/clickhouse/ # - ./user_scripts:/var/lib/clickhouse/user_scripts/ - alertmanager: image: signoz/alertmanager:${ALERTMANAGER_TAG:-0.23.7} container_name: signoz-alertmanager @@ -163,19 +146,11 @@ services: command: - --queryService.url=http://query-service:8085 - --storage.path=/data - # Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md` - query-service: - image: signoz/query-service:${DOCKER_TAG:-0.64.0} + image: signoz/query-service:${DOCKER_TAG:-0.65.0} container_name: signoz-query-service - command: - [ - "-config=/root/config/prometheus.yml", - "-gateway-url=https://api.staging.signoz.cloud", - "--use-logs-new-schema=true", - "--use-trace-new-schema=true" - ] + command: ["-config=/root/config/prometheus.yml", "-gateway-url=https://api.staging.signoz.cloud", "--use-logs-new-schema=true", "--use-trace-new-schema=true"] # ports: # - "6060:6060" # pprof port # - "8080:8080" # query-service port @@ -195,21 +170,13 @@ services: - KAFKA_SPAN_EVAL=${KAFKA_SPAN_EVAL:-false} restart: on-failure healthcheck: - test: - [ - "CMD", - "wget", - "--spider", - "-q", - "localhost:8080/api/v1/health" - ] + test: ["CMD", "wget", "--spider", "-q", "localhost:8080/api/v1/health"] interval: 30s timeout: 5s retries: 3 - <<: *db-depend - + !!merge <<: *db-depend frontend: - image: signoz/frontend:${DOCKER_TAG:-0.64.0} + image: signoz/frontend:${DOCKER_TAG:-0.65.0} container_name: signoz-frontend restart: on-failure depends_on: @@ -219,7 +186,6 @@ services: - "3301:3301" volumes: - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf - otel-collector-migrator: image: signoz/signoz-schema-migrator:${OTELCOL_TAG:-0.111.16} container_name: otel-migrator @@ -228,22 +194,14 @@ services: depends_on: clickhouse: condition: service_healthy - # clickhouse-2: - # condition: service_healthy - # clickhouse-3: - # condition: service_healthy - - + # clickhouse-2: + # condition: service_healthy + # clickhouse-3: + # condition: service_healthy otel-collector: image: signoz/signoz-otel-collector:${OTELCOL_TAG:-0.111.16} container_name: signoz-otel-collector - command: - [ - "--config=/etc/otel-collector-config.yaml", - "--manager-config=/etc/manager-config.yaml", - "--copy-path=/var/tmp/collector-config.yaml", - "--feature-gates=-pkg.translator.prometheus.NormalizeName" - ] + command: ["--config=/etc/otel-collector-config.yaml", "--manager-config=/etc/manager-config.yaml", "--copy-path=/var/tmp/collector-config.yaml", "--feature-gates=-pkg.translator.prometheus.NormalizeName"] user: root # required for reading docker container logs volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -273,7 +231,6 @@ services: condition: service_completed_successfully query-service: condition: service_healthy - logspout: image: "gliderlabs/logspout:v3.2.14" container_name: signoz-logspout From 825d2dfcbbee08c37e621f12e98a42c075ea7735 Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:06:18 +0530 Subject: [PATCH 08/10] fix: added handling for new key - duration_nano in traces (#6658) Co-authored-by: Srikanth Chekuri --- frontend/src/container/TimeSeriesView/index.tsx | 3 ++- frontend/src/container/Trace/TraceTable/util.ts | 2 +- frontend/src/container/TracesExplorer/ListView/utils.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/container/TimeSeriesView/index.tsx b/frontend/src/container/TimeSeriesView/index.tsx index b619e64b028..c285ab70b66 100644 --- a/frontend/src/container/TimeSeriesView/index.tsx +++ b/frontend/src/container/TimeSeriesView/index.tsx @@ -29,7 +29,8 @@ function TimeSeriesViewContainer({ currentQuery.builder.queryData.forEach( ({ aggregateAttribute, aggregateOperator }) => { const isExistDurationNanoAttribute = - aggregateAttribute.key === 'durationNano'; + aggregateAttribute.key === 'durationNano' || + aggregateAttribute.key === 'duration_nano'; const isCountOperator = aggregateOperator === 'count' || aggregateOperator === 'count_distinct'; diff --git a/frontend/src/container/Trace/TraceTable/util.ts b/frontend/src/container/Trace/TraceTable/util.ts index 08276636c11..4b2e8c7c13a 100644 --- a/frontend/src/container/Trace/TraceTable/util.ts +++ b/frontend/src/container/Trace/TraceTable/util.ts @@ -1,5 +1,5 @@ export const getSpanOrderParam = (key: string): string => { - if (key === 'durationNano') { + if (key === 'durationNano' || key === 'duration_nano') { return 'duration'; } if (key === 'timestamp') { diff --git a/frontend/src/container/TracesExplorer/ListView/utils.tsx b/frontend/src/container/TracesExplorer/ListView/utils.tsx index 8dd20669a06..35c9f5aa8f6 100644 --- a/frontend/src/container/TracesExplorer/ListView/utils.tsx +++ b/frontend/src/container/TracesExplorer/ListView/utils.tsx @@ -96,7 +96,7 @@ export const getListColumns = ( ); } - if (key === 'durationNano') { + if (key === 'durationNano' || key === 'duration_nano') { return ( {getMs(value)}ms From 7f6bad67d584dceed19b3770a0cac89fdfb0d0e5 Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:22:32 +0530 Subject: [PATCH 09/10] chore: changed droprate view options values (#6693) --- .../DropRateView/EvaluationTimeSelector.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/EvaluationTimeSelector.tsx b/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/EvaluationTimeSelector.tsx index 2ca2e9c301a..fb41c12e99e 100644 --- a/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/EvaluationTimeSelector.tsx +++ b/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/EvaluationTimeSelector.tsx @@ -41,7 +41,9 @@ function EvaluationTimeSelector({ setInterval: Dispatch>; }): JSX.Element { const [inputValue, setInputValue] = useState(''); - const [selectedInterval, setSelectedInterval] = useState('5ms'); + const [selectedInterval, setSelectedInterval] = useState( + '10ms', + ); const [dropdownOpen, setDropdownOpen] = useState(false); const handleInputChange = (e: React.ChangeEvent): void => { @@ -98,11 +100,13 @@ function EvaluationTimeSelector({ onDropdownVisibleChange={setDropdownOpen} dropdownRender={renderDropdown} > - - - - + + + + + + ); From 6e27df9dcb23aaebd904ac33754cd4236a6516a6 Mon Sep 17 00:00:00 2001 From: SagarRajput-7 <162284829+SagarRajput-7@users.noreply.github.com> Date: Fri, 27 Dec 2024 16:12:53 +0530 Subject: [PATCH 10/10] chore: restructure Kafka codebase (#6611) * chore: restructure Kafka codebase * chore: fixed eslint errors --- .../messagingQueues}/getConsumerLagDetails.ts | 0 .../messagingQueues}/getKafkaSpanEval.tsx | 2 +- .../getPartitionLatencyDetails.ts | 0 .../getPartitionLatencyOverview.ts | 0 .../messagingQueues}/getTopicThroughputDetails.ts | 0 .../messagingQueues/getTopicThroughputOverview.ts | 5 +++-- .../AttributeCheckList.tsx | 9 ++++----- .../MessagingQueueHealthCheck.styles.scss | 0 .../MessagingQueueHealthCheck.tsx | 2 +- .../MessagingQueues/MQCommon/MQCommon.styles.scss | 0 .../MessagingQueues/MQCommon/MQCommon.tsx | 0 .../Steps/ConnectionStatus/ConnectionStatus.tsx | 2 +- .../MQDetails/DropRateView/DropRateView.tsx | 4 ++-- .../MQDetails/MQTables/MQTableUtils.tsx | 3 +-- .../MQDetails/MQTables/MQTables.tsx | 8 ++++---- .../MQDetails/MessagingQueueOverview.tsx | 6 +++--- .../MessagingQueues/MQGraph/MQConfigOptions.tsx | 2 +- .../src/pages/MessagingQueues/MessagingQueues.tsx | 2 +- .../pages/MessagingQueues/MessagingQueuesUtils.ts | 15 +++++++-------- 19 files changed, 29 insertions(+), 31 deletions(-) rename frontend/src/{pages/MessagingQueues/MQDetails/MQTables => api/messagingQueues}/getConsumerLagDetails.ts (100%) rename frontend/src/{pages/MessagingQueues/MQDetails/MQTables => api/messagingQueues}/getKafkaSpanEval.tsx (86%) rename frontend/src/{pages/MessagingQueues/MQDetails/MQTables => api/messagingQueues}/getPartitionLatencyDetails.ts (100%) rename frontend/src/{pages/MessagingQueues/MQDetails/MQTables => api/messagingQueues}/getPartitionLatencyOverview.ts (100%) rename frontend/src/{pages/MessagingQueues/MQDetails/MQTables => api/messagingQueues}/getTopicThroughputDetails.ts (100%) rename frontend/src/{pages/MessagingQueues => components}/MessagingQueueHealthCheck/AttributeCheckList.tsx (99%) rename frontend/src/{pages/MessagingQueues => components}/MessagingQueueHealthCheck/MessagingQueueHealthCheck.styles.scss (100%) rename frontend/src/{pages/MessagingQueues => components}/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx (97%) rename frontend/src/{pages => components}/MessagingQueues/MQCommon/MQCommon.styles.scss (100%) rename frontend/src/{pages => components}/MessagingQueues/MQCommon/MQCommon.tsx (100%) diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/getConsumerLagDetails.ts b/frontend/src/api/messagingQueues/getConsumerLagDetails.ts similarity index 100% rename from frontend/src/pages/MessagingQueues/MQDetails/MQTables/getConsumerLagDetails.ts rename to frontend/src/api/messagingQueues/getConsumerLagDetails.ts diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/getKafkaSpanEval.tsx b/frontend/src/api/messagingQueues/getKafkaSpanEval.tsx similarity index 86% rename from frontend/src/pages/MessagingQueues/MQDetails/MQTables/getKafkaSpanEval.tsx rename to frontend/src/api/messagingQueues/getKafkaSpanEval.tsx index 1f77faff2d2..8942429e956 100644 --- a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/getKafkaSpanEval.tsx +++ b/frontend/src/api/messagingQueues/getKafkaSpanEval.tsx @@ -1,7 +1,7 @@ import axios from 'api'; +import { DropRateAPIResponse } from 'pages/MessagingQueues/MQDetails/DropRateView/dropRateViewUtils'; import { ErrorResponse, SuccessResponse } from 'types/api'; -import { DropRateAPIResponse } from '../DropRateView/dropRateViewUtils'; import { MessagingQueueServicePayload } from './getConsumerLagDetails'; export const getKafkaSpanEval = async ( diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/getPartitionLatencyDetails.ts b/frontend/src/api/messagingQueues/getPartitionLatencyDetails.ts similarity index 100% rename from frontend/src/pages/MessagingQueues/MQDetails/MQTables/getPartitionLatencyDetails.ts rename to frontend/src/api/messagingQueues/getPartitionLatencyDetails.ts diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/getPartitionLatencyOverview.ts b/frontend/src/api/messagingQueues/getPartitionLatencyOverview.ts similarity index 100% rename from frontend/src/pages/MessagingQueues/MQDetails/MQTables/getPartitionLatencyOverview.ts rename to frontend/src/api/messagingQueues/getPartitionLatencyOverview.ts diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/getTopicThroughputDetails.ts b/frontend/src/api/messagingQueues/getTopicThroughputDetails.ts similarity index 100% rename from frontend/src/pages/MessagingQueues/MQDetails/MQTables/getTopicThroughputDetails.ts rename to frontend/src/api/messagingQueues/getTopicThroughputDetails.ts diff --git a/frontend/src/api/messagingQueues/getTopicThroughputOverview.ts b/frontend/src/api/messagingQueues/getTopicThroughputOverview.ts index 072f5eccf2f..ac955e84053 100644 --- a/frontend/src/api/messagingQueues/getTopicThroughputOverview.ts +++ b/frontend/src/api/messagingQueues/getTopicThroughputOverview.ts @@ -1,9 +1,10 @@ import axios from 'api'; +import { ErrorResponse, SuccessResponse } from 'types/api'; + import { MessagingQueueServicePayload, MessagingQueuesPayloadProps, -} from 'pages/MessagingQueues/MQDetails/MQTables/getConsumerLagDetails'; -import { ErrorResponse, SuccessResponse } from 'types/api'; +} from './getConsumerLagDetails'; export const getTopicThroughputOverview = async ( props: Omit, diff --git a/frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/AttributeCheckList.tsx b/frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsx similarity index 99% rename from frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/AttributeCheckList.tsx rename to frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsx index 08b2ce6cfad..8ab647ef34b 100644 --- a/frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/AttributeCheckList.tsx +++ b/frontend/src/components/MessagingQueueHealthCheck/AttributeCheckList.tsx @@ -17,16 +17,15 @@ import { QueryParams } from 'constants/query'; import ROUTES from 'constants/routes'; import { History } from 'history'; import { Bolt, Check, OctagonAlert, X } from 'lucide-react'; +import { + KAFKA_SETUP_DOC_LINK, + MessagingQueueHealthCheckService, +} from 'pages/MessagingQueues/MessagingQueuesUtils'; import { ReactNode, useEffect, useState } from 'react'; import { useHistory } from 'react-router-dom'; import { isCloudUser } from 'utils/app'; import { v4 as uuid } from 'uuid'; -import { - KAFKA_SETUP_DOC_LINK, - MessagingQueueHealthCheckService, -} from '../MessagingQueuesUtils'; - interface AttributeCheckListProps { visible: boolean; onClose: () => void; diff --git a/frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/MessagingQueueHealthCheck.styles.scss b/frontend/src/components/MessagingQueueHealthCheck/MessagingQueueHealthCheck.styles.scss similarity index 100% rename from frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/MessagingQueueHealthCheck.styles.scss rename to frontend/src/components/MessagingQueueHealthCheck/MessagingQueueHealthCheck.styles.scss diff --git a/frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx b/frontend/src/components/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx similarity index 97% rename from frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx rename to frontend/src/components/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx index 346d4a666ac..cf36ed74ac2 100644 --- a/frontend/src/pages/MessagingQueues/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx +++ b/frontend/src/components/MessagingQueueHealthCheck/MessagingQueueHealthCheck.tsx @@ -5,9 +5,9 @@ import { Button } from 'antd'; import cx from 'classnames'; import { useOnboardingStatus } from 'hooks/messagingQueue/useOnboardingStatus'; import { Bolt, FolderTree } from 'lucide-react'; +import { MessagingQueueHealthCheckService } from 'pages/MessagingQueues/MessagingQueuesUtils'; import { useEffect, useMemo, useState } from 'react'; -import { MessagingQueueHealthCheckService } from '../MessagingQueuesUtils'; import AttributeCheckList from './AttributeCheckList'; interface MessagingQueueHealthCheckProps { diff --git a/frontend/src/pages/MessagingQueues/MQCommon/MQCommon.styles.scss b/frontend/src/components/MessagingQueues/MQCommon/MQCommon.styles.scss similarity index 100% rename from frontend/src/pages/MessagingQueues/MQCommon/MQCommon.styles.scss rename to frontend/src/components/MessagingQueues/MQCommon/MQCommon.styles.scss diff --git a/frontend/src/pages/MessagingQueues/MQCommon/MQCommon.tsx b/frontend/src/components/MessagingQueues/MQCommon/MQCommon.tsx similarity index 100% rename from frontend/src/pages/MessagingQueues/MQCommon/MQCommon.tsx rename to frontend/src/components/MessagingQueues/MQCommon/MQCommon.tsx diff --git a/frontend/src/container/OnboardingContainer/Steps/ConnectionStatus/ConnectionStatus.tsx b/frontend/src/container/OnboardingContainer/Steps/ConnectionStatus/ConnectionStatus.tsx index b5b38c69481..3bfdf0c33b2 100644 --- a/frontend/src/container/OnboardingContainer/Steps/ConnectionStatus/ConnectionStatus.tsx +++ b/frontend/src/container/OnboardingContainer/Steps/ConnectionStatus/ConnectionStatus.tsx @@ -6,6 +6,7 @@ import { LoadingOutlined, } from '@ant-design/icons'; import logEvent from 'api/common/logEvent'; +import MessagingQueueHealthCheck from 'components/MessagingQueueHealthCheck/MessagingQueueHealthCheck'; import { QueryParams } from 'constants/query'; import Header from 'container/OnboardingContainer/common/Header/Header'; import { useOnboardingContext } from 'container/OnboardingContainer/context/OnboardingContext'; @@ -14,7 +15,6 @@ import { useQueryService } from 'hooks/useQueryService'; import useResourceAttribute from 'hooks/useResourceAttribute'; import { convertRawQueriesToTraceSelectedTags } from 'hooks/useResourceAttribute/utils'; import useUrlQuery from 'hooks/useUrlQuery'; -import MessagingQueueHealthCheck from 'pages/MessagingQueues/MessagingQueueHealthCheck/MessagingQueueHealthCheck'; import { getAttributeDataFromOnboardingStatus } from 'pages/MessagingQueues/MessagingQueuesUtils'; import { useEffect, useMemo, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; diff --git a/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx b/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx index d7eb3c25627..c30f1bb1ef1 100644 --- a/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx +++ b/frontend/src/pages/MessagingQueues/MQDetails/DropRateView/DropRateView.tsx @@ -2,6 +2,8 @@ import '../MQDetails.style.scss'; import { Table, Typography } from 'antd'; +import { MessagingQueueServicePayload } from 'api/messagingQueues/getConsumerLagDetails'; +import { getKafkaSpanEval } from 'api/messagingQueues/getKafkaSpanEval'; import axios from 'axios'; import cx from 'classnames'; import { SOMETHING_WENT_WRONG } from 'constants/api'; @@ -19,8 +21,6 @@ import { useSelector } from 'react-redux'; import { AppState } from 'store/reducers'; import { GlobalReducer } from 'types/reducer/globalTime'; -import { MessagingQueueServicePayload } from '../MQTables/getConsumerLagDetails'; -import { getKafkaSpanEval } from '../MQTables/getKafkaSpanEval'; import { convertToMilliseconds, DropRateAPIResponse, diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTableUtils.tsx b/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTableUtils.tsx index 1671baf7f93..6ee6890cad6 100644 --- a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTableUtils.tsx +++ b/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTableUtils.tsx @@ -1,7 +1,6 @@ +import { MessagingQueuesPayloadProps } from 'api/messagingQueues/getConsumerLagDetails'; import { RowData } from 'pages/MessagingQueues/MessagingQueuesUtils'; -import { MessagingQueuesPayloadProps } from './getConsumerLagDetails'; - export function getTableDataForProducerLatencyOverview( data: MessagingQueuesPayloadProps['payload'], ): RowData[] { diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTables.tsx b/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTables.tsx index d4ee82b8b71..1430682bce2 100644 --- a/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTables.tsx +++ b/frontend/src/pages/MessagingQueues/MQDetails/MQTables/MQTables.tsx @@ -3,6 +3,10 @@ import './MQTables.styles.scss'; import { Skeleton, Table, Typography } from 'antd'; +import { + MessagingQueueServicePayload, + MessagingQueuesPayloadProps, +} from 'api/messagingQueues/getConsumerLagDetails'; import axios from 'axios'; import { isNumber } from 'chart.js/helpers'; import cx from 'classnames'; @@ -28,10 +32,6 @@ import { useMutation } from 'react-query'; import { useHistory, useLocation } from 'react-router-dom'; import { ErrorResponse, SuccessResponse } from 'types/api'; -import { - MessagingQueueServicePayload, - MessagingQueuesPayloadProps, -} from './getConsumerLagDetails'; import { getTableDataForProducerLatencyOverview } from './MQTableUtils'; const INITIAL_PAGE_SIZE = 10; diff --git a/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx b/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx index c4c9cfb2537..4046226cd0c 100644 --- a/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx +++ b/frontend/src/pages/MessagingQueues/MQDetails/MessagingQueueOverview.tsx @@ -1,6 +1,9 @@ import './MQDetails.style.scss'; import { Radio } from 'antd'; +import { MessagingQueueServicePayload } from 'api/messagingQueues/getConsumerLagDetails'; +import { getKafkaSpanEval } from 'api/messagingQueues/getKafkaSpanEval'; +import { getPartitionLatencyOverview } from 'api/messagingQueues/getPartitionLatencyOverview'; import { getTopicThroughputOverview } from 'api/messagingQueues/getTopicThroughputOverview'; import useUrlQuery from 'hooks/useUrlQuery'; import { Dispatch, SetStateAction, useMemo } from 'react'; @@ -15,9 +18,6 @@ import { ProducerLatencyOptions, setConfigDetail, } from '../MessagingQueuesUtils'; -import { MessagingQueueServicePayload } from './MQTables/getConsumerLagDetails'; -import { getKafkaSpanEval } from './MQTables/getKafkaSpanEval'; -import { getPartitionLatencyOverview } from './MQTables/getPartitionLatencyOverview'; import MessagingQueuesTable from './MQTables/MQTables'; type SelectedViewType = keyof typeof MessagingQueuesViewType; diff --git a/frontend/src/pages/MessagingQueues/MQGraph/MQConfigOptions.tsx b/frontend/src/pages/MessagingQueues/MQGraph/MQConfigOptions.tsx index 72540f2f52a..da83a197fc2 100644 --- a/frontend/src/pages/MessagingQueues/MQGraph/MQConfigOptions.tsx +++ b/frontend/src/pages/MessagingQueues/MQGraph/MQConfigOptions.tsx @@ -3,6 +3,7 @@ import './MQConfigOptions.styles.scss'; import { Color } from '@signozhq/design-tokens'; import { Button, Select, Spin, Tooltip } from 'antd'; import { DefaultOptionType } from 'antd/es/select'; +import { SelectMaxTagPlaceholder } from 'components/MessagingQueues/MQCommon/MQCommon'; import { QueryParams } from 'constants/query'; import { History, Location } from 'history'; import useDebouncedFn from 'hooks/useDebouncedFunction'; @@ -12,7 +13,6 @@ import { useState } from 'react'; import { useHistory, useLocation } from 'react-router-dom'; import { useCopyToClipboard } from 'react-use'; -import { SelectMaxTagPlaceholder } from '../MQCommon/MQCommon'; import { useGetAllConfigOptions } from './useGetAllConfigOptions'; type ConfigOptionType = 'group' | 'topic' | 'partition'; diff --git a/frontend/src/pages/MessagingQueues/MessagingQueues.tsx b/frontend/src/pages/MessagingQueues/MessagingQueues.tsx index 74bc1f37964..a7e8681e9cd 100644 --- a/frontend/src/pages/MessagingQueues/MessagingQueues.tsx +++ b/frontend/src/pages/MessagingQueues/MessagingQueues.tsx @@ -4,6 +4,7 @@ import './MessagingQueues.styles.scss'; import { Button } from 'antd'; import logEvent from 'api/common/logEvent'; import cx from 'classnames'; +import MessagingQueueHealthCheck from 'components/MessagingQueueHealthCheck/MessagingQueueHealthCheck'; import { QueryParams } from 'constants/query'; import ROUTES from 'constants/routes'; import DateTimeSelectionV2 from 'container/TopNav/DateTimeSelectionV2'; @@ -13,7 +14,6 @@ import { useTranslation } from 'react-i18next'; import { useHistory } from 'react-router-dom'; import { isCloudUser } from 'utils/app'; -import MessagingQueueHealthCheck from './MessagingQueueHealthCheck/MessagingQueueHealthCheck'; import { KAFKA_SETUP_DOC_LINK, MessagingQueueHealthCheckService, diff --git a/frontend/src/pages/MessagingQueues/MessagingQueuesUtils.ts b/frontend/src/pages/MessagingQueues/MessagingQueuesUtils.ts index e787739cb3e..97e368ddb4a 100644 --- a/frontend/src/pages/MessagingQueues/MessagingQueuesUtils.ts +++ b/frontend/src/pages/MessagingQueues/MessagingQueuesUtils.ts @@ -1,3 +1,10 @@ +import { + getConsumerLagDetails, + MessagingQueueServicePayload, + MessagingQueuesPayloadProps, +} from 'api/messagingQueues/getConsumerLagDetails'; +import { getPartitionLatencyDetails } from 'api/messagingQueues/getPartitionLatencyDetails'; +import { getTopicThroughputDetails } from 'api/messagingQueues/getTopicThroughputDetails'; import { OnboardingStatusResponse } from 'api/messagingQueues/onboarding/getOnboardingStatus'; import { QueryParams } from 'constants/query'; import { PANEL_TYPES } from 'constants/queryBuilder'; @@ -11,14 +18,6 @@ import { EQueryType } from 'types/common/dashboard'; import { DataSource } from 'types/common/queryBuilder'; import { v4 as uuid } from 'uuid'; -import { - getConsumerLagDetails, - MessagingQueueServicePayload, - MessagingQueuesPayloadProps, -} from './MQDetails/MQTables/getConsumerLagDetails'; -import { getPartitionLatencyDetails } from './MQDetails/MQTables/getPartitionLatencyDetails'; -import { getTopicThroughputDetails } from './MQDetails/MQTables/getTopicThroughputDetails'; - export const KAFKA_SETUP_DOC_LINK = 'https://signoz.io/docs/messaging-queues/kafka?utm_source=product&utm_medium=kafka-get-started';