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.

feat: default max lines to 1 in logs (#9874)

Yunus Me124a6a26994
diff --git a/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx b/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
index fa980cce9d..d88a2a82c1 100644
--- a/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
+++ b/frontend/src/components/ExplorerCard/test/ExplorerCard.test.tsx
@@ -59,7 +59,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
diff --git a/frontend/src/components/LogsFormatOptionsMenu/__tests__/LogsFormatOptionsMenu.test.tsx b/frontend/src/components/LogsFormatOptionsMenu/__tests__/LogsFormatOptionsMenu.test.tsx
index 3f4120cba4..252518167c 100644
--- a/frontend/src/components/LogsFormatOptionsMenu/__tests__/LogsFormatOptionsMenu.test.tsx
+++ b/frontend/src/components/LogsFormatOptionsMenu/__tests__/LogsFormatOptionsMenu.test.tsx
@@ -10,7 +10,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
@@ -51,7 +51,7 @@ describe('LogsFormatOptionsMenu (unit)', () => {
selectedOptionFormat="table"
config={{
format: { value: 'table', onChange: formatOnChange },
- maxLines: { value: 2, onChange: maxLinesOnChange },
+ maxLines: { value: 1, onChange: maxLinesOnChange },
fontSize: { value: FontSize.SMALL, onChange: fontSizeOnChange },
addColumn: {
isFetching: false,
diff --git a/frontend/src/container/LogsExplorerList/__tests__/LogsExplorerList.test.tsx b/frontend/src/container/LogsExplorerList/__tests__/LogsExplorerList.test.tsx
index de73bb9006..38bee03869 100644
--- a/frontend/src/container/LogsExplorerList/__tests__/LogsExplorerList.test.tsx
+++ b/frontend/src/container/LogsExplorerList/__tests__/LogsExplorerList.test.tsx
@@ -35,7 +35,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
diff --git a/frontend/src/container/LogsExplorerViews/tests/LogsExplorerViews.test.tsx b/frontend/src/container/LogsExplorerViews/tests/LogsExplorerViews.test.tsx
index 698e0df4b5..4e6b619d6f 100644
--- a/frontend/src/container/LogsExplorerViews/tests/LogsExplorerViews.test.tsx
+++ b/frontend/src/container/LogsExplorerViews/tests/LogsExplorerViews.test.tsx
@@ -119,7 +119,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
diff --git a/frontend/src/container/OptionsMenu/__test__/useOptionsMenu.test.ts b/frontend/src/container/OptionsMenu/__test__/useOptionsMenu.test.ts
index e94e4aeb6b..28aeb4e788 100644
--- a/frontend/src/container/OptionsMenu/__test__/useOptionsMenu.test.ts
+++ b/frontend/src/container/OptionsMenu/__test__/useOptionsMenu.test.ts
@@ -37,7 +37,7 @@ describe('useOptionsMenu', () => {
columns: [],
formatting: {
format: 'raw',
- maxLines: 2,
+ maxLines: 1,
fontSize: 'small',
},
},
@@ -49,7 +49,7 @@ describe('useOptionsMenu', () => {
columns: [],
formatting: {
format: 'raw',
- maxLines: 2,
+ maxLines: 1,
fontSize: 'small',
},
},
diff --git a/frontend/src/container/OptionsMenu/constants.ts b/frontend/src/container/OptionsMenu/constants.ts
index c03d1a97f1..3b2a8c5c91 100644
--- a/frontend/src/container/OptionsMenu/constants.ts
+++ b/frontend/src/container/OptionsMenu/constants.ts
@@ -7,7 +7,7 @@ export const URL_OPTIONS = 'options';
export const defaultOptionsQuery: OptionsQuery = {
selectColumns: [],
- maxLines: 2,
+ maxLines: 1,
format: 'raw',
fontSize: FontSize.SMALL,
};
diff --git a/frontend/src/container/PipelinePage/tests/PipelineListsView.test.tsx b/frontend/src/container/PipelinePage/tests/PipelineListsView.test.tsx
index f0cba76f62..43884893af 100644
--- a/frontend/src/container/PipelinePage/tests/PipelineListsView.test.tsx
+++ b/frontend/src/container/PipelinePage/tests/PipelineListsView.test.tsx
@@ -62,7 +62,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
diff --git a/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx b/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx
index 7ee4ab7512..08b4d7ec90 100644
--- a/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx
+++ b/frontend/src/pages/LogsExplorer/__tests__/LogsExplorer.test.tsx
@@ -68,7 +68,7 @@ jest.mock('providers/preferences/sync/usePreferenceSync', () => ({
preferences: {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
diff --git a/frontend/src/pages/TracesExplorer/__test__/testUtils.ts b/frontend/src/pages/TracesExplorer/__test__/testUtils.ts
index 1fdc8b36b2..9b907c6aab 100644
--- a/frontend/src/pages/TracesExplorer/__test__/testUtils.ts
+++ b/frontend/src/pages/TracesExplorer/__test__/testUtils.ts
@@ -59,7 +59,7 @@ export const optionMenuReturn = {
id: 'dbName--string--tag--true',
},
],
- maxLines: 2,
+ maxLines: 1,
format: 'list',
},
handleOptionsChange: jest.fn(),
diff --git a/frontend/src/providers/preferences/__tests__/logsLoaderConfig.test.ts b/frontend/src/providers/preferences/__tests__/logsLoaderConfig.test.ts
index 78ce41a532..8c0d549199 100644
--- a/frontend/src/providers/preferences/__tests__/logsLoaderConfig.test.ts
+++ b/frontend/src/providers/preferences/__tests__/logsLoaderConfig.test.ts
@@ -160,7 +160,7 @@ describe('logsLoaderConfig', () => {
expect(result).toEqual({
columns: defaultLogsSelectedColumns,
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table' as LogViewMode,
fontSize: 'small' as FontSize,
version: 1,
diff --git a/frontend/src/providers/preferences/__tests__/logsUpdaterConfig.test.ts b/frontend/src/providers/preferences/__tests__/logsUpdaterConfig.test.ts
index c707d1ce02..7daed39685 100644
--- a/frontend/src/providers/preferences/__tests__/logsUpdaterConfig.test.ts
+++ b/frontend/src/providers/preferences/__tests__/logsUpdaterConfig.test.ts
@@ -41,7 +41,7 @@ describe('logsUpdaterConfig', () => {
const mockPreferences: Preferences = {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table' as LogViewMode,
fontSize: 'small' as FontSize,
version: 1,
@@ -80,7 +80,7 @@ describe('logsUpdaterConfig', () => {
dataType: DataTypes.String,
},
],
- maxLines: 2,
+ maxLines: 1,
});
logsUpdater.updateColumns(newColumns, PreferenceMode.DIRECT);
@@ -97,7 +97,7 @@ describe('logsUpdaterConfig', () => {
mockLocalStorage[LOCALSTORAGE.LOGS_LIST_OPTIONS],
);
expect(storedData.selectColumns).toEqual(newColumns);
- expect(storedData.maxLines).toBe(2); // Should preserve other fields
+ expect(storedData.maxLines).toBe(1); // Should preserve other fields
// Should not update saved view preferences
expect(setSavedViewPreferences).not.toHaveBeenCalled();
@@ -153,7 +153,7 @@ describe('logsUpdaterConfig', () => {
dataType: DataTypes.String,
},
],
- maxLines: 2,
+ maxLines: 1,
format: 'table',
});
@@ -206,7 +206,7 @@ describe('logsUpdaterConfig', () => {
dataType: DataTypes.String,
},
],
- maxLines: 2,
+ maxLines: 1,
format: 'table',
});
@@ -216,7 +216,7 @@ describe('logsUpdaterConfig', () => {
const storedData = JSON.parse(
mockLocalStorage[LOCALSTORAGE.LOGS_LIST_OPTIONS],
);
- expect(storedData.maxLines).toBe(2); // Should remain the same
+ expect(storedData.maxLines).toBe(1); // Should remain the same
expect(storedData.format).toBe('table'); // Should remain the same
// Should update saved view preferences
diff --git a/frontend/src/providers/preferences/__tests__/tracesUpdaterConfig.test.ts b/frontend/src/providers/preferences/__tests__/tracesUpdaterConfig.test.ts
index d8cfb8c65d..05ec145ff8 100644
--- a/frontend/src/providers/preferences/__tests__/tracesUpdaterConfig.test.ts
+++ b/frontend/src/providers/preferences/__tests__/tracesUpdaterConfig.test.ts
@@ -113,7 +113,7 @@ describe('tracesUpdaterConfig', () => {
expect(mockSetSavedViewPreferences).toHaveBeenCalledWith({
columns: mockColumns,
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small',
version: 1,
diff --git a/frontend/src/providers/preferences/__tests__/usePreferenceUpdater.test.tsx b/frontend/src/providers/preferences/__tests__/usePreferenceUpdater.test.tsx
index 3bb372a9ed..413cd8502a 100644
--- a/frontend/src/providers/preferences/__tests__/usePreferenceUpdater.test.tsx
+++ b/frontend/src/providers/preferences/__tests__/usePreferenceUpdater.test.tsx
@@ -46,7 +46,7 @@ describe('usePreferenceUpdater', () => {
const mockPreferences: Preferences = {
columns: [],
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table' as LogViewMode,
fontSize: 'small' as FontSize,
version: 1,
diff --git a/frontend/src/providers/preferences/configs/logsLoaderConfig.ts b/frontend/src/providers/preferences/configs/logsLoaderConfig.ts
index f9f717ad3b..78ac8755f7 100644
--- a/frontend/src/providers/preferences/configs/logsLoaderConfig.ts
+++ b/frontend/src/providers/preferences/configs/logsLoaderConfig.ts
@@ -39,7 +39,7 @@ const logsLoaders = {
return {
columns: validLogColumns.length > 0 ? validLogColumns : [],
formatting: {
- maxLines: parsed.maxLines ?? 2,
+ maxLines: parsed.maxLines ?? 1,
format: parsed.format ?? 'table',
fontSize: parsed.fontSize ?? 'small',
version: parsed.version ?? 1,
@@ -65,7 +65,7 @@ const logsLoaders = {
return {
columns: validLogColumns.length > 0 ? validLogColumns : [],
formatting: {
- maxLines: options.maxLines ?? 2,
+ maxLines: options.maxLines ?? 1,
format: options.format ?? 'table',
fontSize: options.fontSize ?? 'small',
version: options.version ?? 1,
@@ -80,7 +80,7 @@ const logsLoaders = {
} => ({
columns: defaultLogsSelectedColumns,
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small' as FontSize,
version: 1,
diff --git a/frontend/src/providers/preferences/configs/logsUpdaterConfig.ts b/frontend/src/providers/preferences/configs/logsUpdaterConfig.ts
index 6b04782338..44e762a422 100644
--- a/frontend/src/providers/preferences/configs/logsUpdaterConfig.ts
+++ b/frontend/src/providers/preferences/configs/logsUpdaterConfig.ts
@@ -23,7 +23,7 @@ const getLogsUpdaterConfig = (
return {
columns: newColumns,
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small' as FontSize,
version: 1,
diff --git a/frontend/src/providers/preferences/configs/tracesUpdaterConfig.ts b/frontend/src/providers/preferences/configs/tracesUpdaterConfig.ts
index a45cf6edce..59fdd4531a 100644
--- a/frontend/src/providers/preferences/configs/tracesUpdaterConfig.ts
+++ b/frontend/src/providers/preferences/configs/tracesUpdaterConfig.ts
@@ -21,7 +21,7 @@ const getTracesUpdaterConfig = (
setSavedViewPreferences({
columns: newColumns,
formatting: {
- maxLines: 2,
+ maxLines: 1,
format: 'table',
fontSize: 'small' as FontSize,
version: 1,
diff --git a/frontend/src/providers/preferences/sync/usePreferenceSync.ts b/frontend/src/providers/preferences/sync/usePreferenceSync.ts
index eeda0b9be3..2cc64e5830 100644
--- a/frontend/src/providers/preferences/sync/usePreferenceSync.ts
+++ b/frontend/src/providers/preferences/sync/usePreferenceSync.ts
@@ -58,7 +58,7 @@ export function usePreferenceSync({
updateExtraDataSelectColumns(parsedExtraData?.selectColumns) ||
defaultLogsSelectedColumns;
formatting = {
- maxLines: parsedExtraData?.maxLines ?? 2,
+ maxLines: parsedExtraData?.maxLines ?? 1,
format: parsedExtraData?.format ?? 'table',
fontSize: parsedExtraData?.fontSize ?? 'small',
version: parsedExtraData?.version ?? 1,