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
chore: update home page task tracker for metrics explorer (#8631)
Amlan Kumar Nandy372372694ee7
diff --git a/frontend/src/constants/orgPreferences.ts b/frontend/src/constants/orgPreferences.tsindex 83a4a1e3f3..f96aa4a014 100644--- a/frontend/src/constants/orgPreferences.ts+++ b/frontend/src/constants/orgPreferences.ts@@ -7,8 +7,8 @@ export const ORG_PREFERENCES = {'welcome_checklist_setup_alerts_skipped',WELCOME_CHECKLIST_SETUP_SAVED_VIEW_SKIPPED:'welcome_checklist_setup_saved_view_skipped',- WELCOME_CHECKLIST_SEND_INFRA_METRICS_SKIPPED:- 'welcome_checklist_send_infra_metrics_skipped',+ WELCOME_CHECKLIST_SEND_METRICS_SKIPPED:+ 'welcome_checklist_send_metrics_skipped',WELCOME_CHECKLIST_SETUP_DASHBOARDS_SKIPPED:'welcome_checklist_setup_dashboards_skipped',WELCOME_CHECKLIST_SETUP_WORKSPACE_SKIPPED:diff --git a/frontend/src/container/Home/Home.tsx b/frontend/src/container/Home/Home.tsxindex 33e9637422..d9133095b9 100644--- a/frontend/src/container/Home/Home.tsx+++ b/frontend/src/container/Home/Home.tsx@@ -4,21 +4,17 @@ import './Home.styles.scss';import { Color } from '@signozhq/design-tokens';import { Button, Popover } from 'antd';import logEvent from 'api/common/logEvent';-import { HostListPayload } from 'api/infraMonitoring/getHostLists';-import { K8sPodsListPayload } from 'api/infraMonitoring/getK8sPodsList';import listUserPreferences from 'api/v1/user/preferences/list';import updateUserPreferenceAPI from 'api/v1/user/preferences/name/update';import Header from 'components/Header/Header';import { ENTITY_VERSION_V5 } from 'constants/app';-import { FeatureKeys } from 'constants/features';import { LOCALSTORAGE } from 'constants/localStorage';import { ORG_PREFERENCES } from 'constants/orgPreferences';import { initialQueriesMap, PANEL_TYPES } from 'constants/queryBuilder';import { REACT_QUERY_KEY } from 'constants/reactQueryKeys';import ROUTES from 'constants/routes';-import { getHostListsQuery } from 'container/InfraMonitoringHosts/utils';-import { useGetHostList } from 'hooks/infraMonitoring/useGetHostList';-import { useGetK8sPodsList } from 'hooks/infraMonitoring/useGetK8sPodsList';+import { getMetricsListQuery } from 'container/MetricsExplorer/Summary/utils';+import { useGetMetricsList } from 'hooks/metricsExplorer/useGetMetricsList';import { useGetQueryRange } from 'hooks/queryBuilder/useGetQueryRange';import { useGetTenantLicense } from 'hooks/useGetTenantLicense';import history from 'lib/history';@@ -132,9 +128,9 @@ export default function Home(): JSX.Element {},);- // Detect Infra Metrics - Hosts+ // Detect Metricsconst query = useMemo(() => {- const baseQuery = getHostListsQuery();+ const baseQuery = getMetricsListQuery();let queryStartTime = startTime;let queryEndTime = endTime;@@ -161,26 +157,11 @@ export default function Home(): JSX.Element {};}, [startTime, endTime]);- const { data: hostData } = useGetHostList(query as HostListPayload, {- queryKey: ['hostList', query],+ const { data: metricsData } = useGetMetricsList(query, {enabled: !!query,+ queryKey: ['metricsList', query],});- const { featureFlags } = useAppContext();- const dotMetricsEnabled =- featureFlags?.find((flag) => flag.name === FeatureKeys.DOT_METRICS_ENABLED)- ?.active || false;-- const { data: k8sPodsData } = useGetK8sPodsList(- query as K8sPodsListPayload,- {- queryKey: ['K8sPodsList', query],- enabled: !!query,- },- undefined,- dotMetricsEnabled,- );-const [isLogsIngestionActive, setIsLogsIngestionActive] = useState(false);const [isTracesIngestionActive, setIsTracesIngestionActive] = useState(false);const [isMetricsIngestionActive, setIsMetricsIngestionActive] = useState(@@ -305,15 +286,14 @@ export default function Home(): JSX.Element {}, [tracesData, handleUpdateChecklistDoneItem]);useEffect(() => {- const hostDataTotal = hostData?.payload?.data?.total ?? 0;- const k8sPodsDataTotal = k8sPodsData?.payload?.data?.total ?? 0;+ const metricsDataTotal = metricsData?.payload?.data?.total ?? 0;- if (hostDataTotal > 0 || k8sPodsDataTotal > 0) {+ if (metricsDataTotal > 0) {setIsMetricsIngestionActive(true);handleUpdateChecklistDoneItem('ADD_DATA_SOURCE');- handleUpdateChecklistDoneItem('SEND_INFRA_METRICS');+ handleUpdateChecklistDoneItem('SEND_METRICS');}- }, [hostData, k8sPodsData, handleUpdateChecklistDoneItem]);+ }, [metricsData, handleUpdateChecklistDoneItem]);useEffect(() => {logEvent('Homepage: Visited', {});@@ -520,19 +500,19 @@ export default function Home(): JSX.Element {logEvent('Homepage: Ingestion Active Explore clicked', {source: 'Metrics',});- history.push(ROUTES.INFRASTRUCTURE_MONITORING_HOSTS);+ history.push(ROUTES.METRICS_EXPLORER);}}onKeyDown={(e): void => {if (e.key === 'Enter') {logEvent('Homepage: Ingestion Active Explore clicked', {source: 'Metrics',});- history.push(ROUTES.INFRASTRUCTURE_MONITORING_HOSTS);+ history.push(ROUTES.METRICS_EXPLORER);}}}><CompassIcon size={12} />- Explore Infra Metrics+ Explore Metrics</div></div></Card.Content>@@ -593,6 +573,20 @@ export default function Home(): JSX.Element {>Open Traces Explorer</Button>++ <Button+ type="default"+ className="periscope-btn secondary"+ icon={<Wrench size={14} />}+ onClick={(): void => {+ logEvent('Homepage: Explore clicked', {+ source: 'Metrics',+ });+ history.push(ROUTES.METRICS_EXPLORER_EXPLORER);+ }}+ >+ Open Metrics Explorer+ </Button></div></div></Card.Content>diff --git a/frontend/src/container/Home/SavedViews/SavedViews.tsx b/frontend/src/container/Home/SavedViews/SavedViews.tsxindex a89f898de5..0e3272fc36 100644--- a/frontend/src/container/Home/SavedViews/SavedViews.tsx+++ b/frontend/src/container/Home/SavedViews/SavedViews.tsx@@ -7,6 +7,7 @@ import { useHandleExplorerTabChange } from 'hooks/useHandleExplorerTabChange';import {ArrowRight,ArrowUpRight,+ BarChart,CompassIcon,DraftingCompass,} from 'lucide-react';@@ -42,6 +43,12 @@ export default function SavedViews({isError: tracesViewsError,} = useGetAllViews(DataSource.TRACES);+ const {+ data: metricsViewsData,+ isLoading: metricsViewsLoading,+ isError: metricsViewsError,+ } = useGetAllViews(DataSource.METRICS);+const logsViews = useMemo(() => [...(logsViewsData?.data.data || [])], [logsViewsData,]);@@ -50,14 +57,25 @@ export default function SavedViews({tracesViewsData,]);+ const metricsViews = useMemo(() => [...(metricsViewsData?.data.data || [])], [+ metricsViewsData,+ ]);+useEffect(() => {- setSelectedEntityViews(selectedEntity === 'logs' ? logsViews : tracesViews);- }, [selectedEntity, logsViews, tracesViews]);+ if (selectedEntity === 'logs') {+ setSelectedEntityViews(logsViews);+ } else if (selectedEntity === 'traces') {+ setSelectedEntityViews(tracesViews);+ } else if (selectedEntity === 'metrics') {+ setSelectedEntityViews(metricsViews);+ }+ }, [selectedEntity, logsViews, tracesViews, metricsViews]);const hasTracesViews = tracesViews.length > 0;const hasLogsViews = logsViews.length > 0;+ const hasMetricsViews = metricsViews.length > 0;- const hasSavedViews = hasTracesViews || hasLogsViews;+ const hasSavedViews = hasTracesViews || hasLogsViews || hasMetricsViews;const { handleExplorerTabChange } = useHandleExplorerTabChange();@@ -68,10 +86,16 @@ export default function SavedViews({entity: selectedEntity,});- const currentViewDetails = getViewDetailsUsingViewKey(- view.id,- selectedEntity === 'logs' ? logsViews : tracesViews,- );+ let currentViews: ViewProps[] = [];+ if (selectedEntity === 'logs') {+ currentViews = logsViews;+ } else if (selectedEntity === 'traces') {+ currentViews = tracesViews;+ } else if (selectedEntity === 'metrics') {+ currentViews = metricsViews;+ }++ const currentViewDetails = getViewDetailsUsingViewKey(view.id, currentViews);if (!currentViewDetails) return;const { query, name, id, panelType: currentPanelType } = currentViewDetails;@@ -94,6 +118,32 @@ export default function SavedViews({}}, [hasSavedViews, onUpdateChecklistDoneItem, loadingUserPreferences]);+ const footerLink = useMemo(() => {+ if (selectedEntity === 'logs') {+ return ROUTES.LOGS_SAVE_VIEWS;+ }+ if (selectedEntity === 'traces') {+ return ROUTES.TRACES_SAVE_VIEWS;+ }+ if (selectedEntity === 'metrics') {+ return ROUTES.METRICS_EXPLORER_VIEWS;+ }+ return '';+ }, [selectedEntity]);++ const getStartedLink = useMemo(() => {+ if (selectedEntity === 'logs') {+ return ROUTES.LOGS_EXPLORER;+ }+ if (selectedEntity === 'traces') {+ return ROUTES.TRACES_EXPLORER;+ }+ if (selectedEntity === 'metrics') {+ return ROUTES.METRICS_EXPLORER_EXPLORER;+ }+ return '';+ }, [selectedEntity]);+const emptyStateCard = (): JSX.Element => (<div className="empty-state-container"><div className="empty-state-content-container">@@ -115,13 +165,7 @@ export default function SavedViews({{user?.role !== USER_ROLES.VIEWER && (<div className="empty-actions-container">- <Link- to={- selectedEntity === 'logs'- ? ROUTES.LOGS_EXPLORER- : ROUTES.TRACES_EXPLORER- }- >+ <Link to={getStartedLink}><Buttontype="default"className="periscope-btn secondary"@@ -238,6 +282,14 @@ export default function SavedViews({</div></div>)}++ {selectedEntity === 'metrics' && metricsViewsError && (+ <div className="metrics-saved-views-error-container">+ <div className="metrics-saved-views-error-message">+ Oops, something went wrong while loading your saved views.+ </div>+ </div>+ )}</div></div>);@@ -246,11 +298,19 @@ export default function SavedViews({logEvent('Homepage: Saved views switched', {tab,});- setSelectedEntityViews(tab === 'logs' ? logsViews : tracesViews);+ let currentViews: ViewProps[] = [];+ if (tab === 'logs') {+ currentViews = logsViews;+ } else if (tab === 'traces') {+ currentViews = tracesViews;+ } else if (tab === 'metrics') {+ currentViews = metricsViews;+ }+ setSelectedEntityViews(currentViews);setSelectedEntity(tab);};- if (logsViewsLoading || tracesViewsLoading) {+ if (logsViewsLoading || tracesViewsLoading || metricsViewsLoading) {return (<Card className="saved-views-list-card home-data-card loading-card"><Card.Content>@@ -260,7 +320,7 @@ export default function SavedViews({);}- if (logsViewsError || tracesViewsError) {+ if (logsViewsError || tracesViewsError || metricsViewsError) {return (<Card className="saved-views-list-card home-data-card error-card"><Card.Content>@@ -299,6 +359,16 @@ export default function SavedViews({><DraftingCompass size={14} /> Traces</Button>+ <Button+ value="metrics"+ className={+ // eslint-disable-next-line sonarjs/no-duplicate-string+ selectedEntity === 'metrics' ? 'selected tab' : 'tab'+ }+ onClick={(): void => handleTabChange('metrics')}+ >+ <BarChart size={14} /> Metrics+ </Button></Button.Group></div></div>@@ -312,13 +382,7 @@ export default function SavedViews({{selectedEntityViews.length > 0 && (<Card.Footer><div className="services-footer home-data-card-footer">- <Link- to={- selectedEntity === 'logs'- ? ROUTES.LOGS_SAVE_VIEWS- : ROUTES.TRACES_SAVE_VIEWS- }- >+ <Link to={footerLink}><Buttontype="link"className="periscope-btn link learn-more-link"diff --git a/frontend/src/container/Home/constants.ts b/frontend/src/container/Home/constants.tsindex 60eaf95bd2..63a0db8b91 100644--- a/frontend/src/container/Home/constants.ts+++ b/frontend/src/container/Home/constants.ts@@ -7,8 +7,7 @@ export const checkListStepToPreferenceKeyMap = {WILL_DO_LATER: ORG_PREFERENCES.WELCOME_CHECKLIST_DO_LATER,SEND_LOGS: ORG_PREFERENCES.WELCOME_CHECKLIST_SEND_LOGS_SKIPPED,SEND_TRACES: ORG_PREFERENCES.WELCOME_CHECKLIST_SEND_TRACES_SKIPPED,- SEND_INFRA_METRICS:- ORG_PREFERENCES.WELCOME_CHECKLIST_SEND_INFRA_METRICS_SKIPPED,+ SEND_METRICS: ORG_PREFERENCES.WELCOME_CHECKLIST_SEND_METRICS_SKIPPED,SETUP_DASHBOARDS: ORG_PREFERENCES.WELCOME_CHECKLIST_SETUP_DASHBOARDS_SKIPPED,SETUP_ALERTS: ORG_PREFERENCES.WELCOME_CHECKLIST_SETUP_ALERTS_SKIPPED,SETUP_SAVED_VIEWS: ORG_PREFERENCES.WELCOME_CHECKLIST_SETUP_SAVED_VIEW_SKIPPED,@@ -20,8 +19,7 @@ export const DOCS_LINKS = {ADD_DATA_SOURCE: 'https://signoz.io/docs/instrumentation/overview/',SEND_LOGS: 'https://signoz.io/docs/userguide/logs/',SEND_TRACES: 'https://signoz.io/docs/userguide/traces/',- SEND_INFRA_METRICS:- 'https://signoz.io/docs/infrastructure-monitoring/overview/',+ SEND_METRICS: 'https://signoz.io/docs/metrics-management/metrics-explorer/',SETUP_ALERTS: 'https://signoz.io/docs/userguide/alerts-management/',SETUP_SAVED_VIEWS:'https://signoz.io/docs/product-features/saved-view/#step-2-save-your-view',@@ -74,16 +72,16 @@ export const defaultChecklistItemsState: ChecklistItem[] = [docsLink: DOCS_LINKS.SEND_TRACES,},{- id: 'SEND_INFRA_METRICS',- title: 'Send your infra metrics',+ id: 'SEND_METRICS',+ title: 'Send your metrics',description:- 'Send your infra metrics to SigNoz to get more visibility into your infrastructure.',+ 'Send your metrics to SigNoz to get more visibility into how your resources interact.',completed: false,isSkipped: false,isSkippable: true,- skippedPreferenceKey: checkListStepToPreferenceKeyMap.SEND_INFRA_METRICS,+ skippedPreferenceKey: checkListStepToPreferenceKeyMap.SEND_METRICS,toRoute: ROUTES.GET_STARTED_WITH_CLOUD,- docsLink: DOCS_LINKS.SEND_INFRA_METRICS,+ docsLink: DOCS_LINKS.SEND_METRICS,},{id: 'SETUP_ALERTS',