mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 16:58:59 +08:00
fix: kafka - misc fix and features (#6379)
* feat: fixed multiple fixes and chores in kafka 2.0 * feat: fixed producer latency - producer-detail call * feat: fixed mq-detail page layout and pagination * feat: resolved comments
This commit is contained in:
parent
abe0ab69b0
commit
fdc54a62a9
@ -116,12 +116,7 @@ const checkValidityOfDetailConfigs = (
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentTab === MessagingQueueServiceDetailType.ConsumerDetails) {
|
return Boolean(configDetails?.topic && configDetails?.partition);
|
||||||
return Boolean(configDetails?.topic && configDetails?.partition);
|
|
||||||
}
|
|
||||||
return Boolean(
|
|
||||||
configDetails?.group && configDetails?.topic && configDetails?.partition,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selectedView === MessagingQueuesViewType.producerLatency.value) {
|
if (selectedView === MessagingQueuesViewType.producerLatency.value) {
|
||||||
|
@ -33,6 +33,8 @@ import {
|
|||||||
MessagingQueuesPayloadProps,
|
MessagingQueuesPayloadProps,
|
||||||
} from './getConsumerLagDetails';
|
} from './getConsumerLagDetails';
|
||||||
|
|
||||||
|
const INITIAL_PAGE_SIZE = 10;
|
||||||
|
|
||||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||||
export function getColumns(
|
export function getColumns(
|
||||||
data: MessagingQueuesPayloadProps['payload'],
|
data: MessagingQueuesPayloadProps['payload'],
|
||||||
@ -155,8 +157,8 @@ function MessagingQueuesTable({
|
|||||||
|
|
||||||
const paginationConfig = useMemo(
|
const paginationConfig = useMemo(
|
||||||
() =>
|
() =>
|
||||||
tableData?.length > 20 && {
|
tableData?.length > INITIAL_PAGE_SIZE && {
|
||||||
pageSize: 20,
|
pageSize: INITIAL_PAGE_SIZE,
|
||||||
showTotal: showPaginationItem,
|
showTotal: showPaginationItem,
|
||||||
showSizeChanger: false,
|
showSizeChanger: false,
|
||||||
hideOnSinglePage: true,
|
hideOnSinglePage: true,
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
/* eslint-disable jsx-a11y/no-static-element-interactions */
|
||||||
|
/* eslint-disable jsx-a11y/click-events-have-key-events */
|
||||||
import './MessagingQueueHealthCheck.styles.scss';
|
import './MessagingQueueHealthCheck.styles.scss';
|
||||||
|
|
||||||
import { CaretDownOutlined, LoadingOutlined } from '@ant-design/icons';
|
import { CaretDownOutlined, LoadingOutlined } from '@ant-design/icons';
|
||||||
@ -11,10 +13,20 @@ import {
|
|||||||
Typography,
|
Typography,
|
||||||
} from 'antd';
|
} from 'antd';
|
||||||
import { OnboardingStatusResponse } from 'api/messagingQueues/onboarding/getOnboardingStatus';
|
import { OnboardingStatusResponse } from 'api/messagingQueues/onboarding/getOnboardingStatus';
|
||||||
|
import { QueryParams } from 'constants/query';
|
||||||
|
import ROUTES from 'constants/routes';
|
||||||
|
import { History } from 'history';
|
||||||
import { Bolt, Check, OctagonAlert, X } from 'lucide-react';
|
import { Bolt, Check, OctagonAlert, X } from 'lucide-react';
|
||||||
import { ReactNode, useEffect, useState } from 'react';
|
import { ReactNode, useEffect, useState } from 'react';
|
||||||
|
import { useHistory } from 'react-router-dom';
|
||||||
|
import { isCloudUser } from 'utils/app';
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
|
|
||||||
|
import {
|
||||||
|
KAFKA_SETUP_DOC_LINK,
|
||||||
|
MessagingQueueHealthCheckService,
|
||||||
|
} from '../MessagingQueuesUtils';
|
||||||
|
|
||||||
interface AttributeCheckListProps {
|
interface AttributeCheckListProps {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
@ -34,13 +46,42 @@ export enum AttributesFilters {
|
|||||||
|
|
||||||
function ErrorTitleAndKey({
|
function ErrorTitleAndKey({
|
||||||
title,
|
title,
|
||||||
|
parentTitle,
|
||||||
|
history,
|
||||||
|
isCloudUserVal,
|
||||||
errorMsg,
|
errorMsg,
|
||||||
isLeaf,
|
isLeaf,
|
||||||
}: {
|
}: {
|
||||||
title: string;
|
title: string;
|
||||||
|
parentTitle: string;
|
||||||
|
isCloudUserVal: boolean;
|
||||||
|
history: History<unknown>;
|
||||||
errorMsg?: string;
|
errorMsg?: string;
|
||||||
isLeaf?: boolean;
|
isLeaf?: boolean;
|
||||||
}): TreeDataNode {
|
}): TreeDataNode {
|
||||||
|
const handleRedirection = (): void => {
|
||||||
|
let link = '';
|
||||||
|
|
||||||
|
switch (parentTitle) {
|
||||||
|
case 'Consumers':
|
||||||
|
link = `${ROUTES.GET_STARTED_APPLICATION_MONITORING}?${QueryParams.getStartedSource}=kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Consumers}`;
|
||||||
|
break;
|
||||||
|
case 'Producers':
|
||||||
|
link = `${ROUTES.GET_STARTED_APPLICATION_MONITORING}?${QueryParams.getStartedSource}=kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Producers}`;
|
||||||
|
break;
|
||||||
|
case 'Kafka':
|
||||||
|
link = `${ROUTES.GET_STARTED_INFRASTRUCTURE_MONITORING}?${QueryParams.getStartedSource}=kafka&${QueryParams.getStartedSourceService}=${MessagingQueueHealthCheckService.Kafka}`;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
link = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isCloudUserVal && !!link) {
|
||||||
|
history.push(link);
|
||||||
|
} else {
|
||||||
|
window.open(KAFKA_SETUP_DOC_LINK, '_blank');
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
key: `${title}-key-${uuid()}`,
|
key: `${title}-key-${uuid()}`,
|
||||||
title: (
|
title: (
|
||||||
@ -49,7 +90,13 @@ function ErrorTitleAndKey({
|
|||||||
{title}
|
{title}
|
||||||
</Typography.Text>
|
</Typography.Text>
|
||||||
<Tooltip title={errorMsg}>
|
<Tooltip title={errorMsg}>
|
||||||
<div className="attribute-error-warning">
|
<div
|
||||||
|
className="attribute-error-warning"
|
||||||
|
onClick={(e): void => {
|
||||||
|
e.preventDefault();
|
||||||
|
handleRedirection();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<OctagonAlert size={14} />
|
<OctagonAlert size={14} />
|
||||||
Fix
|
Fix
|
||||||
</div>
|
</div>
|
||||||
@ -98,6 +145,9 @@ function treeTitleAndKey({
|
|||||||
|
|
||||||
function generateTreeDataNodes(
|
function generateTreeDataNodes(
|
||||||
response: OnboardingStatusResponse['data'],
|
response: OnboardingStatusResponse['data'],
|
||||||
|
parentTitle: string,
|
||||||
|
isCloudUserVal: boolean,
|
||||||
|
history: History<unknown>,
|
||||||
): TreeDataNode[] {
|
): TreeDataNode[] {
|
||||||
return response
|
return response
|
||||||
.map((item) => {
|
.map((item) => {
|
||||||
@ -109,6 +159,9 @@ function generateTreeDataNodes(
|
|||||||
return ErrorTitleAndKey({
|
return ErrorTitleAndKey({
|
||||||
title: item.attribute,
|
title: item.attribute,
|
||||||
errorMsg: item.error_message || '',
|
errorMsg: item.error_message || '',
|
||||||
|
parentTitle,
|
||||||
|
history,
|
||||||
|
isCloudUserVal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,6 +182,8 @@ function AttributeCheckList({
|
|||||||
const handleFilterChange = (value: AttributesFilters): void => {
|
const handleFilterChange = (value: AttributesFilters): void => {
|
||||||
setFilter(value);
|
setFilter(value);
|
||||||
};
|
};
|
||||||
|
const isCloudUserVal = isCloudUser();
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const filteredData = onboardingStatusResponses.map((response) => {
|
const filteredData = onboardingStatusResponses.map((response) => {
|
||||||
@ -137,6 +192,9 @@ function AttributeCheckList({
|
|||||||
title: response.title,
|
title: response.title,
|
||||||
errorMsg: response.errorMsg,
|
errorMsg: response.errorMsg,
|
||||||
isLeaf: true,
|
isLeaf: true,
|
||||||
|
parentTitle: response.title,
|
||||||
|
history,
|
||||||
|
isCloudUserVal,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let filteredData = response.data;
|
let filteredData = response.data;
|
||||||
@ -149,11 +207,17 @@ function AttributeCheckList({
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...treeTitleAndKey({ title: response.title }),
|
...treeTitleAndKey({ title: response.title }),
|
||||||
children: generateTreeDataNodes(filteredData),
|
children: generateTreeDataNodes(
|
||||||
|
filteredData,
|
||||||
|
response.title,
|
||||||
|
isCloudUserVal,
|
||||||
|
history,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
setTreeData(filteredData);
|
setTreeData(filteredData);
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [filter, onboardingStatusResponses]);
|
}, [filter, onboardingStatusResponses]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -68,6 +68,8 @@
|
|||||||
|
|
||||||
.ant-tree {
|
.ant-tree {
|
||||||
.ant-tree-title {
|
.ant-tree-title {
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
.attribute-error-title {
|
.attribute-error-title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -88,6 +90,7 @@
|
|||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,28 +45,22 @@
|
|||||||
|
|
||||||
border-bottom: 1px solid var(--bg-slate-500);
|
border-bottom: 1px solid var(--bg-slate-500);
|
||||||
|
|
||||||
.header-content {
|
.header-config {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.header-config {
|
.messaging-queue-options {
|
||||||
display: flex;
|
.ant-select-selector {
|
||||||
gap: 10px;
|
display: flex;
|
||||||
align-items: center;
|
height: 32px;
|
||||||
|
padding: 6px 6px 6px 8px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
.messaging-queue-options {
|
border-radius: 2px;
|
||||||
.ant-select-selector {
|
border: 1px solid var(--bg-slate-400);
|
||||||
display: flex;
|
background: var(--bg-ink-300);
|
||||||
height: 32px;
|
|
||||||
padding: 6px 6px 6px 8px;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
|
|
||||||
border-radius: 2px;
|
|
||||||
border: 1px solid var(--bg-slate-400);
|
|
||||||
background: var(--bg-ink-300);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,8 +60,8 @@ function MessagingQueues(): JSX.Element {
|
|||||||
{t('breadcrumb')}
|
{t('breadcrumb')}
|
||||||
</div>
|
</div>
|
||||||
<div className="messaging-header">
|
<div className="messaging-header">
|
||||||
<div className="header-content">
|
<div className="header-config">
|
||||||
<div className="header-config">{t('header')}</div>
|
{t('header')} /
|
||||||
<MessagingQueueHealthCheck
|
<MessagingQueueHealthCheck
|
||||||
serviceToInclude={[
|
serviceToInclude={[
|
||||||
MessagingQueueHealthCheckService.Consumers,
|
MessagingQueueHealthCheckService.Consumers,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user