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

chore: restructure Kafka codebase #6611

Merged
merged 7 commits into from
Dec 27, 2024
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
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
Original file line number Diff line number Diff line change
@@ -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<MessagingQueueServicePayload, 'variables'>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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[] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/MessagingQueues/MessagingQueues.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
15 changes: 7 additions & 8 deletions frontend/src/pages/MessagingQueues/MessagingQueuesUtils.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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';

Expand Down
Loading