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
feat: add download option to trace view (#12116)
Aditya Singh10a0d262d9af
diff --git a/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx b/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsxindex c900b3b0b6..f8f21713ef 100644--- a/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx+++ b/frontend/src/components/DownloadOptionsMenu/DownloadOptionsMenu.tsx@@ -3,6 +3,7 @@ import { Button, Popover, Tooltip } from 'antd';import { RadioGroup, RadioGroupItem } from '@signozhq/ui/radio-group';import { Typography } from '@signozhq/ui/typography';import { TelemetryFieldKey } from 'api/v5/v5';+import { PANEL_TYPES } from 'constants/queryBuilder';import { useExportRawData } from 'hooks/useExportData/useServerExport';import { Download, LoaderCircle } from '@signozhq/icons';import { DataSource } from 'types/common/queryBuilder';@@ -18,11 +19,13 @@ import './DownloadOptionsMenu.styles.scss';interface DownloadOptionsMenuProps {dataSource: DataSource;selectedColumns?: TelemetryFieldKey[];+ panelType?: PANEL_TYPES;}export default function DownloadOptionsMenu({dataSource,selectedColumns,+ panelType,}: DownloadOptionsMenuProps): JSX.Element {const [exportFormat, setExportFormat] = useState<string>(DownloadFormats.CSV);const [rowLimit, setRowLimit] = useState<number>(DownloadRowCounts.TEN_K);@@ -33,6 +36,7 @@ export default function DownloadOptionsMenu({const { isDownloading, handleExportRawData } = useExportRawData({dataSource,+ panelType,});const handleExport = useCallback(async (): Promise<void> => {diff --git a/frontend/src/container/TracesExplorer/TracesView/index.tsx b/frontend/src/container/TracesExplorer/TracesView/index.tsxindex 2044b0ce4c..bfab81521e 100644--- a/frontend/src/container/TracesExplorer/TracesView/index.tsx+++ b/frontend/src/container/TracesExplorer/TracesView/index.tsx@@ -11,6 +11,7 @@ import {import { useSelector } from 'react-redux';import { Typography } from '@signozhq/ui/typography';import logEvent from 'api/common/logEvent';+import DownloadOptionsMenu from 'components/DownloadOptionsMenu/DownloadOptionsMenu';import ErrorInPlace from 'components/ErrorInPlace/ErrorInPlace';import { ResizeTable } from 'components/ResizeTable';import { ENTITY_VERSION_V5 } from 'constants/app';@@ -152,6 +153,11 @@ function TracesView({</Typography><div className="trace-explorer-controls">+ <DownloadOptionsMenu+ dataSource={DataSource.TRACES}+ panelType={PANEL_TYPES.TRACE}+ />+<TraceExplorerControlsisLoading={isLoading}totalCount={responseData?.length || 0}diff --git a/frontend/src/hooks/useExportData/useServerExport.ts b/frontend/src/hooks/useExportData/useServerExport.tsindex 9768039c51..379701e854 100644--- a/frontend/src/hooks/useExportData/useServerExport.ts+++ b/frontend/src/hooks/useExportData/useServerExport.ts@@ -19,6 +19,7 @@ interface ExportOptions {interface UseExportRawDataProps {dataSource: DataSource;+ panelType?: PANEL_TYPES;}interface UseExportRawDataReturn {@@ -28,6 +29,7 @@ interface UseExportRawDataReturn {export function useExportRawData({dataSource,+ panelType = PANEL_TYPES.LIST,}: UseExportRawDataProps): UseExportRawDataReturn {const [isDownloading, setIsDownloading] = useState<boolean>(false);@@ -83,7 +85,7 @@ export function useExportRawData({const { queryPayload } = prepareQueryRangePayloadV5({query: exportQuery,- graphType: PANEL_TYPES.LIST,+ graphType: panelType,selectedTime: 'GLOBAL_TIME',globalSelectedInterval,});@@ -96,7 +98,7 @@ export function useExportRawData({setIsDownloading(false);}},- [stagedQuery, globalSelectedInterval, dataSource],+ [stagedQuery, globalSelectedInterval, dataSource, panelType],);return { isDownloading, handleExportRawData };