SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: tabs deprecation warning from antd (#2479)
GitStartda4cbf6c2f88
diff --git a/frontend/src/components/RouteTab/index.tsx b/frontend/src/components/RouteTab/index.tsxindex 1192f2f8e2..0059f5b84c 100644--- a/frontend/src/components/RouteTab/index.tsx+++ b/frontend/src/components/RouteTab/index.tsx@@ -2,8 +2,6 @@ import { Tabs, TabsProps } from 'antd';import history from 'lib/history';import React from 'react';-const { TabPane } = Tabs;-function RouteTab({routes,activeKey,@@ -22,29 +20,23 @@ function RouteTab({}};+ const items = routes.map(({ Component, name, route }) => ({+ label: name,+ key: name,+ tabKey: route,+ children: <Component />,+ }));+return (<TabsonChange={onChange}destroyInactiveTabPaneactiveKey={activeKey}animated+ items={items}// eslint-disable-next-line react/jsx-props-no-spreading{...rest}- >- {routes.map(- ({ Component, name, route }): JSX.Element => (- <TabPane- tabKey={route}- animated- destroyInactiveTabPane- tab={name}- key={name}- >- <Component />- </TabPane>- ),- )}- </Tabs>+ />);}diff --git a/frontend/src/container/FormAlertRules/QuerySection.tsx b/frontend/src/container/FormAlertRules/QuerySection.tsxindex f02299dbc8..ab39c51083 100644--- a/frontend/src/container/FormAlertRules/QuerySection.tsx+++ b/frontend/src/container/FormAlertRules/QuerySection.tsx@@ -23,7 +23,6 @@ import PromqlSection from './PromqlSection';import { FormContainer, QueryButton, StepHeading } from './styles';import { toIMetricsBuilderQuery } from './utils';-const { TabPane } = Tabs;function QuerySection({queryCategory,setQueryCategory,@@ -282,6 +281,24 @@ function QuerySection({runQuery();};+ const tabs = [+ {+ label: t('tab_qb'),+ key: EQueryType.QUERY_BUILDER.toString(),+ disabled: true,+ },+ {+ label: t('tab_chquery'),+ key: EQueryType.CLICKHOUSE.toString(),+ },+ ];++ const items = [+ { label: t('tab_qb'), key: EQueryType.QUERY_BUILDER.toString() },+ { label: t('tab_chquery'), key: EQueryType.CLICKHOUSE.toString() },+ { label: t('tab_promql'), key: EQueryType.PROM.toString() },+ ];+const renderTabs = (typ: AlertTypes): JSX.Element | null => {switch (typ) {case AlertTypes.TRACES_BASED_ALERT:@@ -303,14 +320,8 @@ function QuerySection({)}</span>}- >- <TabPane- tab={t('tab_qb')}- key={EQueryType.QUERY_BUILDER.toString()}- disabled- />- <TabPane tab={t('tab_chquery')} key={EQueryType.CLICKHOUSE.toString()} />- </Tabs>+ items={tabs}+ />);case AlertTypes.METRICS_BASED_ALERT:default:@@ -330,11 +341,8 @@ function QuerySection({)}</span>}- >- <TabPane tab={t('tab_qb')} key={EQueryType.QUERY_BUILDER.toString()} />- <TabPane tab={t('tab_chquery')} key={EQueryType.CLICKHOUSE.toString()} />- <TabPane tab={t('tab_promql')} key={EQueryType.PROM.toString()} />- </Tabs>+ items={items}+ />);}};diff --git a/frontend/src/container/Licenses/index.tsx b/frontend/src/container/Licenses/index.tsxindex b326a5b0e7..d7dc4ab22b 100644--- a/frontend/src/container/Licenses/index.tsx+++ b/frontend/src/container/Licenses/index.tsx@@ -8,8 +8,6 @@ import { useQuery } from 'react-query';import ApplyLicenseForm from './ApplyLicenseForm';import ListLicenses from './ListLicenses';-const { TabPane } = Tabs;-function Licenses(): JSX.Element {const { t } = useTranslation(['licenses']);const { data, isError, isLoading, refetch } = useQuery({@@ -28,17 +26,21 @@ function Licenses(): JSX.Element {const allValidLicense =data?.payload?.filter((license) => license.isCurrent) || [];+ const tabs = [+ {+ label: t('tab_current_license'),+ key: 'licenses',+ children: <ApplyLicenseForm licenseRefetch={refetch} />,+ },+ {+ label: t('tab_license_history'),+ key: 'history',+ children: <ListLicenses licenses={allValidLicense} />,+ },+ ];+return (- <Tabs destroyInactiveTabPane defaultActiveKey="licenses">- <TabPane tabKey="licenses" tab={t('tab_current_license')} key="licenses">- <ApplyLicenseForm licenseRefetch={refetch} />- <ListLicenses licenses={allValidLicense} />- </TabPane>-- <TabPane tabKey="history" tab={t('tab_license_history')} key="history">- <ListLicenses licenses={allValidLicense} />- </TabPane>- </Tabs>+ <Tabs destroyInactiveTabPane defaultActiveKey="licenses" items={tabs} />);}diff --git a/frontend/src/container/LogDetailedView/index.tsx b/frontend/src/container/LogDetailedView/index.tsxindex 930dfbf0d8..98ab0909a4 100644--- a/frontend/src/container/LogDetailedView/index.tsx+++ b/frontend/src/container/LogDetailedView/index.tsx@@ -24,6 +24,19 @@ function LogDetailedView(): JSX.Element {});};+ const items = [+ {+ label: 'Table',+ key: '1',+ children: detailedLog && <TableView logData={detailedLog} />,+ },+ {+ label: 'JSON',+ key: '2',+ children: detailedLog && <JSONView logData={detailedLog} />,+ },+ ];+return (<Drawerwidth="60%"@@ -35,14 +48,7 @@ function LogDetailedView(): JSX.Element {style={{ overscrollBehavior: 'contain' }}destroyOnClose>- <Tabs defaultActiveKey="1">- <Tabs.TabPane tab="Table" key="1">- {detailedLog && <TableView logData={detailedLog} />}- </Tabs.TabPane>- <Tabs.TabPane tab="JSON" key="2">- {detailedLog && <JSONView logData={detailedLog} />}- </Tabs.TabPane>- </Tabs>+ <Tabs defaultActiveKey="1" items={items} /></Drawer>);}diff --git a/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx b/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsxindex 4db70b7db2..9aff0b6dd7 100644--- a/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx+++ b/frontend/src/container/LogsSearchFilter/SearchFields/QueryBuilder/QueryBuilder.tsx@@ -27,8 +27,9 @@ function QueryConditionField({return (<SelectdefaultValue={- (query as any).value &&- (((query as any)?.value as any) as string).toUpperCase()+ (query as QueryFields).value &&+ (((((query as QueryFields)+ ?.value as unknown) as QueryFields) as unknown) as string).toUpperCase()}onChange={(e): void => {onUpdate({ ...query, value: e }, queryIndex);diff --git a/frontend/src/container/NewDashboard/DashboardSettings/index.tsx b/frontend/src/container/NewDashboard/DashboardSettings/index.tsxindex d8cfa57ff6..40176c3d1e 100644--- a/frontend/src/container/NewDashboard/DashboardSettings/index.tsx+++ b/frontend/src/container/NewDashboard/DashboardSettings/index.tsx@@ -4,19 +4,13 @@ import React from 'react';import GeneralDashboardSettings from './General';import VariablesSetting from './Variables';-const { TabPane } = Tabs;-function DashboardSettingsContent(): JSX.Element {- return (- <Tabs>- <TabPane tab="General" key="general">- <GeneralDashboardSettings />- </TabPane>- <TabPane tab="Variables" key="variables">- <VariablesSetting />- </TabPane>- </Tabs>- );+ const items = [+ { label: 'General', key: 'general', children: <GeneralDashboardSettings /> },+ { label: 'Variables', key: 'variables', children: <VariablesSetting /> },+ ];++ return <Tabs items={items} />;}export default DashboardSettingsContent;diff --git a/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx b/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsxindex ffa9a49635..ff0b5c356a 100644--- a/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx+++ b/frontend/src/container/NewWidget/LeftContainer/QuerySection/index.tsx@@ -34,7 +34,6 @@ import TabHeader from './TabHeader';import { getQueryKey } from './utils/getQueryKey';import { showUnstagedStashConfirmBox } from './utils/userSettings';-const { TabPane } = Tabs;function QuerySection({handleUnstagedChanges,updateQuery,@@ -144,6 +143,77 @@ function QuerySection({setLocalQueryChanges(cloneDeep(updatedQuery));};+ const items = [+ {+ key: EQueryType.QUERY_BUILDER.toString(),+ tab: (+ <TabHeader+ tabName="Query Builder"+ hasUnstagedChanges={queryDiff(+ query,+ localQueryChanges,+ EQueryType.QUERY_BUILDER,+ )}+ />+ ),+ children: (+ <QueryBuilderQueryContainer+ key={rctTabKey.QUERY_BUILDER}+ queryData={localQueryChanges}+ updateQueryData={({ updatedQuery }: IHandleUpdatedQuery): void => {+ handleLocalQueryUpdate({ updatedQuery });+ }}+ metricsBuilderQueries={+ localQueryChanges[WIDGET_QUERY_BUILDER_QUERY_KEY_NAME]+ }+ selectedGraph={selectedGraph}+ />+ ),+ },+ {+ key: EQueryType.CLICKHOUSE.toString(),+ tab: (+ <TabHeader+ tabName="ClickHouse Query"+ hasUnstagedChanges={queryDiff(+ query,+ localQueryChanges,+ EQueryType.CLICKHOUSE,+ )}+ />+ ),+ children: (+ <ClickHouseQueryContainer+ key={rctTabKey.CLICKHOUSE}+ queryData={localQueryChanges}+ updateQueryData={({ updatedQuery }: IHandleUpdatedQuery): void => {+ handleLocalQueryUpdate({ updatedQuery });+ }}+ clickHouseQueries={localQueryChanges[WIDGET_CLICKHOUSE_QUERY_KEY_NAME]}+ />+ ),+ },+ {+ key: EQueryType.PROM.toString(),+ tab: (+ <TabHeader+ tabName="PromQL"+ hasUnstagedChanges={queryDiff(query, localQueryChanges, EQueryType.PROM)}+ />+ ),+ children: (+ <PromQLQueryContainer+ key={rctTabKey.PROM}+ queryData={localQueryChanges}+ updateQueryData={({ updatedQuery }: IHandleUpdatedQuery): void => {+ handleLocalQueryUpdate({ updatedQuery });+ }}+ promQLQueries={localQueryChanges[WIDGET_PROMQL_QUERY_KEY_NAME]}+ />+ ),+ },+ ];+return (<><div style={{ display: 'flex' }}>@@ -165,77 +235,8 @@ function QuerySection({</Button></span>}- >- <TabPane- tab={- <TabHeader- tabName="Query Builder"- hasUnstagedChanges={queryDiff(- query,- localQueryChanges,- EQueryType.QUERY_BUILDER,- )}- />- }- key={EQueryType.QUERY_BUILDER.toString()}- >- <QueryBuilderQueryContainer- key={rctTabKey.QUERY_BUILDER}- queryData={localQueryChanges}- updateQueryData={({ updatedQuery }: IHandleUpdatedQuery): void => {- handleLocalQueryUpdate({ updatedQuery });- }}- metricsBuilderQueries={- localQueryChanges[WIDGET_QUERY_BUILDER_QUERY_KEY_NAME]- }- selectedGraph={selectedGraph}- />- </TabPane>- <TabPane- tab={- <TabHeader- tabName="ClickHouse Query"- hasUnstagedChanges={queryDiff(- query,- localQueryChanges,- EQueryType.CLICKHOUSE,- )}- />- }- key={EQueryType.CLICKHOUSE.toString()}- >- <ClickHouseQueryContainer- key={rctTabKey.CLICKHOUSE}- queryData={localQueryChanges}- updateQueryData={({ updatedQuery }: IHandleUpdatedQuery): void => {- handleLocalQueryUpdate({ updatedQuery });- }}- clickHouseQueries={localQueryChanges[WIDGET_CLICKHOUSE_QUERY_KEY_NAME]}- />- </TabPane>- <TabPane- tab={- <TabHeader- tabName="PromQL"- hasUnstagedChanges={queryDiff(- query,- localQueryChanges,- EQueryType.PROM,- )}- />- }- key={EQueryType.PROM.toString()}- >- <PromQLQueryContainer- key={rctTabKey.PROM}- queryData={localQueryChanges}- updateQueryData={({ updatedQuery }: IHandleUpdatedQuery): void => {- handleLocalQueryUpdate({ updatedQuery });- }}- promQLQueries={localQueryChanges[WIDGET_PROMQL_QUERY_KEY_NAME]}- />- </TabPane>- </Tabs>+ items={items}+ /></div>{/* {localQueryChanges.map((e, index) => (// <Querydiff --git a/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx b/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsxindex a9bf00cd0f..c7e0755a37 100644--- a/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx+++ b/frontend/src/container/TraceDetail/SelectedSpanDetails/index.tsx@@ -15,8 +15,6 @@ import {} from './styles';import Tags from './Tags';-const { TabPane } = Tabs;-function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element {const { tree, firstSpanStartTime } = props;@@ -44,6 +42,33 @@ function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element {const { tags, nonChildReferences } = tree;+ const items = [+ {+ label: 'Tags',+ key: '1',+ children: (+ <Tags+ onToggleHandler={onToggleHandler}+ setText={setText}+ tags={tags}+ linkedSpans={nonChildReferences}+ />+ ),+ },+ {+ label: 'Events',+ key: '2',+ children: (+ <Events+ events={tree.event}+ onToggleHandler={onToggleHandler}+ setText={setText}+ firstSpanStartTime={firstSpanStartTime}+ />+ ),+ },+ ];+return (<CardContainer><StyledSpace@@ -81,24 +106,7 @@ function SelectedSpanDetails(props: SelectedSpanDetailsProps): JSX.Element {)}</Modal>- <Tabs defaultActiveKey="1">- <TabPane tab="Tags" key="1">- <Tags- onToggleHandler={onToggleHandler}- setText={setText}- tags={tags}- linkedSpans={nonChildReferences}- />- </TabPane>- <TabPane tab="Events" key="2">- <Events- events={tree.event}- onToggleHandler={onToggleHandler}- setText={setText}- firstSpanStartTime={firstSpanStartTime}- />- </TabPane>- </Tabs>+ <Tabs defaultActiveKey="1" items={items} /></CardContainer>);}diff --git a/frontend/src/pages/AlertList/index.tsx b/frontend/src/pages/AlertList/index.tsxindex ac5db017c6..8cfd48ed6c 100644--- a/frontend/src/pages/AlertList/index.tsx+++ b/frontend/src/pages/AlertList/index.tsx@@ -4,31 +4,23 @@ import AllAlertRules from 'container/ListAlertRules';import TriggeredAlerts from 'container/TriggeredAlerts';import React from 'react';-const { TabPane } = Tabs;-function AllAlertList(): JSX.Element {- return (- <Tabs destroyInactiveTabPane defaultActiveKey="Alert Rules">- <TabPane tabKey="Alert Rules" tab="Alert Rules" key="Alert Rules">- <AllAlertRules />- </TabPane>+ const items = [+ { label: 'Alert Rules', key: 'Alert Rules', children: <AllAlertRules /> },+ {+ label: 'Triggered Alerts',+ key: 'Triggered Alerts',+ children: <TriggeredAlerts />,+ },+ // {+ // label: 'Map Alert Channels',+ // key = 'Map Alert Channels',+ // children: <MapAlertChannels />,+ // },+ ];- <TabPane- tabKey="Triggered Alerts"- key="Triggered Alerts"- tab="Triggered Alerts"- >- <TriggeredAlerts />- </TabPane>-- {/* <TabPane- tabKey="Map Alert Channels"- key="Map Alert Channels"- tab="Map Alert Channels"- >- <MapAlertChannels />- </TabPane> */}- </Tabs>+ return (+ <Tabs destroyInactiveTabPane defaultActiveKey="Alert Rules" items={items} />);}