Skip to content

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.

fix: issue #3034, add columns to end of the list (#3035)

dnazarenkooc1664dde6a34
diff --git a/frontend/src/container/TracesExplorer/ListView/configs.tsx b/frontend/src/container/TracesExplorer/ListView/configs.tsx
index 3b05ed8169..308ca1995e 100644
--- a/frontend/src/container/TracesExplorer/ListView/configs.tsx
+++ b/frontend/src/container/TracesExplorer/ListView/configs.tsx
@@ -1,11 +1,11 @@
import { DEFAULT_PER_PAGE_OPTIONS } from 'hooks/queryPagination';
export const defaultSelectedColumns: string[] = [
- 'name',
'serviceName',
- 'responseStatusCode',
- 'httpMethod',
+ 'name',
'durationNano',
+ 'httpMethod',
+ 'responseStatusCode',
];
export const PER_PAGE_OPTIONS: number[] = [10, ...DEFAULT_PER_PAGE_OPTIONS];
diff --git a/frontend/src/container/TracesExplorer/ListView/utils.tsx b/frontend/src/container/TracesExplorer/ListView/utils.tsx
index eb6be9a90d..350ba98a6d 100644
--- a/frontend/src/container/TracesExplorer/ListView/utils.tsx
+++ b/frontend/src/container/TracesExplorer/ListView/utils.tsx
@@ -28,21 +28,18 @@ export const modifyColumns = (
columns: ColumnsType<RowData>,
selectedColumns: BaseAutocompleteData[],
): ColumnsType<RowData> => {
- const initialColumns = columns.filter(({ key }) => {
- let isValidColumn = true;
+ const initialColumns = selectedColumns.reduce(
+ (acc, { key: selectedColumnKey }) => {
+ const column = columns.find(({ key }) => selectedColumnKey === key);
- const checkIsExistColumnByKey = (attributeKey: string): boolean =>
- !selectedColumns.find(({ key }) => key === attributeKey) &&
- attributeKey === key;
-
- const isSelectedSpanId = checkIsExistColumnByKey('spanID');
- const isSelectedTraceId = checkIsExistColumnByKey('traceID');
-
- if (isSelectedSpanId || isSelectedTraceId || key === 'date')
- isValidColumn = false;
+ if (column) {
+ return [...acc, column];
+ }
- return isValidColumn;
- });
+ return acc;
+ },
+ [] as ColumnsType<RowData>,
+ );
const dateColumn = columns.find(({ key }) => key === 'date');