Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(logs): persist column configuration on saved views (#69876)

Jon McCallum91093e043d35
diff --git a/posthog/settings/web.py b/posthog/settings/web.py
index 1bf8a72a9b81..8ca016832698 100644
--- a/posthog/settings/web.py
+++ b/posthog/settings/web.py
@@ -622,6 +622,7 @@ SPECTACULAR_SETTINGS = {
# Tracing's span-filter `type` and attribute-breakdown `breakdownType` share one
# choice set (top-level column vs span attribute vs resource attribute).
"SpanPropertyTypeEnum": ["span", "span_attribute", "span_resource_attribute"],
+ "LogsViewColumnTypeEnum": ["timestamp", "level", "source", "trace_id", "span_id", "message", "custom"],
"CustomPropertyDisplayTypeEnum": [
"text",
"number",
diff --git a/products/logs/backend/migrations/0016_logsview_columns.py b/products/logs/backend/migrations/0016_logsview_columns.py
new file mode 100644
index 000000000000..0d4aa323c64d
--- /dev/null
+++ b/products/logs/backend/migrations/0016_logsview_columns.py
@@ -0,0 +1,17 @@
+# Generated by Django 5.2.14 on 2026-07-10 07:22
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("logs", "0015_teamlogsconfig_logs_session_id_attribute_keys"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="logsview",
+ name="columns",
+ field=models.JSONField(default=None, null=True),
+ ),
+ ]
diff --git a/products/logs/backend/migrations/max_migration.txt b/products/logs/backend/migrations/max_migration.txt
index 4406e97a9d7b..aa69fa2f352d 100644
--- a/products/logs/backend/migrations/max_migration.txt
+++ b/products/logs/backend/migrations/max_migration.txt
@@ -1 +1 @@
-0015_teamlogsconfig_logs_session_id_attribute_keys
+0016_logsview_columns
diff --git a/products/logs/backend/models.py b/products/logs/backend/models.py
index b8d811d3f9e1..5b95ee94714f 100644
--- a/products/logs/backend/models.py
+++ b/products/logs/backend/models.py
@@ -79,6 +79,8 @@ class LogsView(CreatedMetaFields, UpdatedMetaFields, UUIDModel):
short_id = models.CharField(max_length=12, blank=True, default=generate_short_id)
name = models.CharField(max_length=400)
filters = models.JSONField(default=dict)
+ # Display config (LogsColumnConfig[]), separate from filter state. Null = default column set.
+ columns = models.JSONField(null=True, default=None)
pinned = models.BooleanField(default=False)
class Meta:
diff --git a/products/logs/backend/presentation/views/views_api.py b/products/logs/backend/presentation/views/views_api.py
index 3cab77d90c9a..5659614239be 100644
--- a/products/logs/backend/presentation/views/views_api.py
+++ b/products/logs/backend/presentation/views/views_api.py
@@ -10,6 +10,44 @@ from posthog.permissions import PostHogFeatureFlagPermission
from products.logs.backend.models import LogsView
+class LogsViewColumnSerializer(serializers.Serializer):
+ id = serializers.CharField(
+ help_text="Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server.",
+ )
+ type = serializers.ChoiceField(
+ choices=["timestamp", "level", "source", "trace_id", "span_id", "message", "custom"],
+ help_text="Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.",
+ )
+ # Optional keys are omitted (not null) so the stored JSON round-trips the client shape exactly
+ name = serializers.CharField(
+ required=False,
+ help_text="Header label override. Defaults to the built-in type's label, or to the expression for custom columns.",
+ )
+ expression = serializers.CharField(
+ required=False,
+ help_text=(
+ "Only meaningful for `type: custom`: a source-prefixed shorthand (`attributes.<key>`, "
+ "`resource_attributes.<key>`, `body.<json.path>`) or a scalar HogQL expression, sent verbatim "
+ "in the logs query's `customColumns`."
+ ),
+ )
+ width = serializers.IntegerField(
+ required=False,
+ min_value=1,
+ # Mirrors MAX_ATTRIBUTE_COLUMN_WIDTH in the frontend resizer so a legitimate drag can't
+ # persist a width the API would reject.
+ max_value=2000,
+ help_text="Column width in pixels (1–2000). Omitted for the default width; ignored for the flex message column.",
+ )
+
+ def validate(self, attrs: dict[str, Any]) -> dict[str, Any]:
+ # A `custom` column is only renderable if it carries an expression to query;
+ # without one the table would show a permanently blank column.
+ if attrs.get("type") == "custom" and not attrs.get("expression"):
+ raise serializers.ValidationError({"expression": "Custom columns require an expression."})
+ return attrs
+
+
class LogsViewSerializer(serializers.ModelSerializer):
created_by = UserBasicSerializer(read_only=True)
filters = serializers.DictField(
@@ -17,6 +55,16 @@ class LogsViewSerializer(serializers.ModelSerializer):
default=dict,
help_text="Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys.",
)
+ columns = serializers.ListField(
+ child=LogsViewColumnSerializer(),
+ required=False,
+ allow_null=True,
+ help_text=(
+ "Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. "
+ "Null means the view has no column preference and the client renders its default column set. "
+ "Omitting the field on update leaves the saved configuration unchanged; send null to clear it."
+ ),
+ )
class Meta:
model = LogsView
@@ -25,6 +73,7 @@ class LogsViewSerializer(serializers.ModelSerializer):
"short_id",
"name",
"filters",
+ "columns",
"pinned",
"created_at",
"created_by",
diff --git a/products/logs/backend/test/test_views_api.py b/products/logs/backend/test/test_views_api.py
index 56d08830cae9..12d3d8e934ff 100644
--- a/products/logs/backend/test/test_views_api.py
+++ b/products/logs/backend/test/test_views_api.py
@@ -1,6 +1,8 @@
from posthog.test.base import APIBaseTest
from unittest.mock import patch
+from django.test import SimpleTestCase
+
from parameterized import parameterized
from rest_framework import status
from rest_framework.test import APIClient
@@ -8,6 +10,7 @@ from rest_framework.test import APIClient
from posthog.models.team.team import Team
from products.logs.backend.models import LogsView
+from products.logs.backend.presentation.views.views_api import LogsViewColumnSerializer
class TestLogsViewAPI(APIBaseTest):
@@ -120,6 +123,63 @@ class TestLogsViewAPI(APIBaseTest):
assert response.status_code == status.HTTP_201_CREATED
assert response.json()["filters"] == {}
+ def test_columns_round_trip(self):
+ columns = [
+ {"id": "ts", "type": "timestamp"},
+ {
+ "id": "c1",
+ "type": "custom",
+ "name": "Pod",
+ "expression": "resource_attributes.k8s.pod.name",
+ "width": 240,
+ },
+ {"id": "msg", "type": "message"},
+ ]
+ data = self._create_via_api(columns=columns)
+ assert data["columns"] == columns
+
+ # Update replaces the whole list; other fields untouched
+ response = self.client.patch(f"{self.base_url}{data['short_id']}/", {"columns": columns[:2]}, format="json")
+ assert response.status_code == status.HTTP_200_OK
+ assert response.json()["columns"] == columns[:2]
+ assert response.json()["filters"] == {"severityLevels": ["error", "fatal"]}
+
+ def test_update_omitting_columns_preserves_saved_layout(self):
+ columns = [{"id": "ts", "type": "timestamp", "width": 200}]
+ created = self._create_via_api(columns=columns)
+
+ # A full PUT that omits columns must leave the saved layout untouched
+ response = self.client.put(
+ f"{self.base_url}{created['short_id']}/",
+ {"name": "Renamed"},
+ format="json",
+ )
+ assert response.status_code == status.HTTP_200_OK, response.json()
+ assert response.json()["columns"] == columns
+
+ # Sending null explicitly clears the layout
+ response = self.client.patch(
+ f"{self.base_url}{created['short_id']}/",
+ {"columns": None},
+ format="json",
+ )
+ assert response.status_code == status.HTTP_200_OK
+ assert response.json()["columns"] is None
+
+ def test_columns_default_to_null_and_reject_bad_type(self):
+ # Pre-columns views (and views saved without a column preference) round-trip null
+ data = self._create_via_api()
+ assert data["columns"] is None
+ response = self.client.get(f"{self.base_url}{data['short_id']}/")
+ assert response.json()["columns"] is None
+
+ bad = self.client.post(
+ self.base_url,
+ self._valid_payload(columns=[{"id": "x", "type": "not_a_type"}]),
+ format="json",
+ )
+ assert bad.status_code == status.HTTP_400_BAD_REQUEST
+
def test_create_with_complex_filters(self):
filters = {
"severityLevels": ["error"],
@@ -236,3 +296,24 @@ class TestLogsViewAPI(APIBaseTest):
)
assert response.status_code == status.HTTP_200_OK
assert response.json()["pinned"] is True
+
+
+class TestLogsViewColumnSerializer(SimpleTestCase):
+ # Field-level validation runs without a DB; the endpoint test above is the wiring guard.
+
+ @parameterized.expand(
+ [
+ ("custom_without_expression", {"id": "c", "type": "custom"}),
+ ("width_zero", {"id": "c", "type": "message", "width": 0}),
+ ("width_negative", {"id": "c", "type": "message", "width": -10}),
+ ("width_too_large", {"id": "c", "type": "message", "width": 5000}),
+ ]
+ )
+ def test_rejects_invalid_column(self, _label, column):
+ assert not LogsViewColumnSerializer(data=column).is_valid()
+
+ def test_accepts_custom_with_expression(self):
+ serializer = LogsViewColumnSerializer(
+ data={"id": "c", "type": "custom", "expression": "attributes.foo", "width": 240}
+ )
+ assert serializer.is_valid(), serializer.errors
diff --git a/products/logs/frontend/components/VirtualizedLogsList/columnDefinitions.tsx b/products/logs/frontend/components/VirtualizedLogsList/columnDefinitions.tsx
index 7bb451f3f4f2..c8d3d111674d 100644
--- a/products/logs/frontend/components/VirtualizedLogsList/columnDefinitions.tsx
+++ b/products/logs/frontend/components/VirtualizedLogsList/columnDefinitions.tsx
@@ -23,6 +23,7 @@ import {
CHECKBOX_WIDTH,
DEFAULT_ATTRIBUTE_COLUMN_WIDTH,
EXPAND_WIDTH,
+ MAX_ATTRIBUTE_COLUMN_WIDTH,
MESSAGE_MIN_WIDTH,
MIN_ATTRIBUTE_COLUMN_WIDTH,
RESIZER_HANDLE_WIDTH,
@@ -326,7 +327,7 @@ export function createConfiguredColumn(params: {
<ResizableElement
defaultWidth={totalWidth}
minWidth={MIN_ATTRIBUTE_COLUMN_WIDTH + RESIZER_HANDLE_WIDTH}
- maxWidth={Infinity}
+ maxWidth={MAX_ATTRIBUTE_COLUMN_WIDTH + RESIZER_HANDLE_WIDTH}
onResize={(newWidth) => callbacks.onResize?.(config.id, newWidth - RESIZER_HANDLE_WIDTH)}
className="flex items-center h-full shrink-0 group/header"
innerClassName="h-full"
diff --git a/products/logs/frontend/components/VirtualizedLogsList/layoutUtils.ts b/products/logs/frontend/components/VirtualizedLogsList/layoutUtils.ts
index fd25e2728749..8c7bf471fd7c 100644
--- a/products/logs/frontend/components/VirtualizedLogsList/layoutUtils.ts
+++ b/products/logs/frontend/components/VirtualizedLogsList/layoutUtils.ts
@@ -5,6 +5,9 @@ import { VirtualizedTableColumn } from 'products/logs/frontend/components/Virtua
// Layout constants for log rows
export const DEFAULT_ATTRIBUTE_COLUMN_WIDTH = 150
export const MIN_ATTRIBUTE_COLUMN_WIDTH = 80
+// Upper bound on a resizable column, mirrored by the saved-view serializer's `width` max_value
+// so a legitimate drag can't persist a width the backend would reject.
+export const MAX_ATTRIBUTE_COLUMN_WIDTH = 2000
export const RESIZER_HANDLE_WIDTH = 16
// Fixed column widths
diff --git a/products/logs/frontend/generated/api.schemas.ts b/products/logs/frontend/generated/api.schemas.ts
index d87ddd8afe4f..3568d3cd9eb9 100644
--- a/products/logs/frontend/generated/api.schemas.ts
+++ b/products/logs/frontend/generated/api.schemas.ts
@@ -1687,6 +1687,52 @@ export interface _LogsValuesResponseApi {
refreshing: boolean
}
+/**
+ * * `timestamp` - timestamp
+ * * `level` - level
+ * * `source` - source
+ * * `trace_id` - trace_id
+ * * `span_id` - span_id
+ * * `message` - message
+ * * `custom` - custom
+ */
+export type LogsViewColumnTypeEnumApi = (typeof LogsViewColumnTypeEnumApi)[keyof typeof LogsViewColumnTypeEnumApi]
+
+export const LogsViewColumnTypeEnumApi = {
+ Timestamp: 'timestamp',
+ Level: 'level',
+ Source: 'source',
+ TraceId: 'trace_id',
+ SpanId: 'span_id',
+ Message: 'message',
+ Custom: 'custom',
+} as const
+
+export interface LogsViewColumnApi {
+ /** Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server. */
+ id: string
+ /** Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.
+ *
+ * * `timestamp` - timestamp
+ * * `level` - level
+ * * `source` - source
+ * * `trace_id` - trace_id
+ * * `span_id` - span_id
+ * * `message` - message
+ * * `custom` - custom */
+ type: LogsViewColumnTypeEnumApi
+ /** Header label override. Defaults to the built-in type's label, or to the expression for custom columns. */
+ name?: string
+ /** Only meaningful for `type: custom`: a source-prefixed shorthand (`attributes.<key>`, `resource_attributes.<key>`, `body.<json.path>`) or a scalar HogQL expression, sent verbatim in the logs query's `customColumns`. */
+ expression?: string
+ /**
+ * Column width in pixels (1–2000). Omitted for the default width; ignored for the flex message column.
+ * @minimum 1
+ * @maximum 2000
+ */
+ width?: number
+}
+
/**
* Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys.
*/
@@ -1699,6 +1745,11 @@ export interface LogsViewApi {
name: string
/** Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys. */
filters?: LogsViewApiFilters
+ /**
+ * Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.
+ * @nullable
+ */
+ columns?: LogsViewColumnApi[] | null
pinned?: boolean
readonly created_at: string
readonly created_by: UserBasicApi
@@ -1727,6 +1778,11 @@ export interface PatchedLogsViewApi {
name?: string
/** Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys. */
filters?: PatchedLogsViewApiFilters
+ /**
+ * Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.
+ * @nullable
+ */
+ columns?: LogsViewColumnApi[] | null
pinned?: boolean
readonly created_at?: string
readonly created_by?: UserBasicApi
diff --git a/products/logs/frontend/generated/api.zod.ts b/products/logs/frontend/generated/api.zod.ts
index fce14d85ece0..072bb706bb12 100644
--- a/products/logs/frontend/generated/api.zod.ts
+++ b/products/logs/frontend/generated/api.zod.ts
@@ -1474,6 +1474,8 @@ export const LogsSparklineCreateBody = /* @__PURE__ */ zod.object({
export const logsViewsCreateBodyNameMax = 400
+export const logsViewsCreateBodyColumnsItemWidthMax = 2000
+
export const LogsViewsCreateBody = /* @__PURE__ */ zod.object({
name: zod.string().max(logsViewsCreateBodyNameMax),
filters: zod
@@ -1482,11 +1484,55 @@ export const LogsViewsCreateBody = /* @__PURE__ */ zod.object({
.describe(
'Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys.'
),
+ columns: zod
+ .array(
+ zod.object({
+ id: zod
+ .string()
+ .describe(
+ 'Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server.'
+ ),
+ type: zod
+ .enum(['timestamp', 'level', 'source', 'trace_id', 'span_id', 'message', 'custom'])
+ .describe(
+ '\* `timestamp` - timestamp\n\* `level` - level\n\* `source` - source\n\* `trace_id` - trace_id\n\* `span_id` - span_id\n\* `message` - message\n\* `custom` - custom'
+ )
+ .describe(
+ 'Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.\n\n\* `timestamp` - timestamp\n\* `level` - level\n\* `source` - source\n\* `trace_id` - trace_id\n\* `span_id` - span_id\n\* `message` - message\n\* `custom` - custom'
+ ),
+ name: zod
+ .string()
+ .optional()
+ .describe(
+ "Header label override. Defaults to the built-in type's label, or to the expression for custom columns."
+ ),
+ expression: zod
+ .string()
+ .optional()
+ .describe(
+ "Only meaningful for `type: custom`: a source-prefixed shorthand (`attributes.<key>`, `resource_attributes.<key>`, `body.<json.path>`) or a scalar HogQL expression, sent verbatim in the logs query's `customColumns`."
+ ),
+ width: zod
+ .number()
+ .min(1)
+ .max(logsViewsCreateBodyColumnsItemWidthMax)
+ .optional()
+ .describe(
+ 'Column width in pixels (1–2000). Omitted for the default width; ignored for the flex message column.'
+ ),
+ })
+ )
+ .nullish()
+ .describe(
+ 'Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.'
+ ),
pinned: zod.boolean().optional(),
})
export const logsViewsUpdateBodyNameMax = 400
+export const logsViewsUpdateBodyColumnsItemWidthMax = 2000
+
export const LogsViewsUpdateBody = /* @__PURE__ */ zod.object({
name: zod.string().max(logsViewsUpdateBodyNameMax),
filters: zod
@@ -1495,11 +1541,55 @@ export const LogsViewsUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys.'
),
+ columns: zod
+ .array(
+ zod.object({
+ id: zod
+ .string()
+ .describe(
+ 'Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server.'
+ ),
+ type: zod
+ .enum(['timestamp', 'level', 'source', 'trace_id', 'span_id', 'message', 'custom'])
+ .describe(
+ '\* `timestamp` - timestamp\n\* `level` - level\n\* `source` - source\n\* `trace_id` - trace_id\n\* `span_id` - span_id\n\* `message` - message\n\* `custom` - custom'
+ )
+ .describe(
+ 'Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.\n\n\* `timestamp` - timestamp\n\* `level` - level\n\* `source` - source\n\* `trace_id` - trace_id\n\* `span_id` - span_id\n\* `message` - message\n\* `custom` - custom'
+ ),
+ name: zod
+ .string()
+ .optional()
+ .describe(
+ "Header label override. Defaults to the built-in type's label, or to the expression for custom columns."
+ ),
+ expression: zod
+ .string()
+ .optional()
+ .describe(
+ "Only meaningful for `type: custom`: a source-prefixed shorthand (`attributes.<key>`, `resource_attributes.<key>`, `body.<json.path>`) or a scalar HogQL expression, sent verbatim in the logs query's `customColumns`."
+ ),
+ width: zod
+ .number()
+ .min(1)
+ .max(logsViewsUpdateBodyColumnsItemWidthMax)
+ .optional()
+ .describe(
+ 'Column width in pixels (1–2000). Omitted for the default width; ignored for the flex message column.'
+ ),
+ })
+ )
+ .nullish()
+ .describe(
+ 'Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.'
+ ),
pinned: zod.boolean().optional(),
})
export const logsViewsPartialUpdateBodyNameMax = 400
+export const logsViewsPartialUpdateBodyColumnsItemWidthMax = 2000
+
export const LogsViewsPartialUpdateBody = /* @__PURE__ */ zod.object({
name: zod.string().max(logsViewsPartialUpdateBodyNameMax).optional(),
filters: zod
@@ -1508,5 +1598,47 @@ export const LogsViewsPartialUpdateBody = /* @__PURE__ */ zod.object({
.describe(
'Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys.'
),
+ columns: zod
+ .array(
+ zod.object({
+ id: zod
+ .string()
+ .describe(
+ 'Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server.'
+ ),
+ type: zod
+ .enum(['timestamp', 'level', 'source', 'trace_id', 'span_id', 'message', 'custom'])
+ .describe(
+ '\* `timestamp` - timestamp\n\* `level` - level\n\* `source` - source\n\* `trace_id` - trace_id\n\* `span_id` - span_id\n\* `message` - message\n\* `custom` - custom'
+ )
+ .describe(
+ 'Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.\n\n\* `timestamp` - timestamp\n\* `level` - level\n\* `source` - source\n\* `trace_id` - trace_id\n\* `span_id` - span_id\n\* `message` - message\n\* `custom` - custom'
+ ),
+ name: zod
+ .string()
+ .optional()
+ .describe(
+ "Header label override. Defaults to the built-in type's label, or to the expression for custom columns."
+ ),
+ expression: zod
+ .string()
+ .optional()
+ .describe(
+ "Only meaningful for `type: custom`: a source-prefixed shorthand (`attributes.<key>`, `resource_attributes.<key>`, `body.<json.path>`) or a scalar HogQL expression, sent verbatim in the logs query's `customColumns`."
+ ),
+ width: zod
+ .number()
+ .min(1)
+ .max(logsViewsPartialUpdateBodyColumnsItemWidthMax)
+ .optional()
+ .describe(
+ 'Column width in pixels (1–2000). Omitted for the default width; ignored for the flex message column.'
+ ),
+ })
+ )
+ .nullish()
+ .describe(
+ 'Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.'
+ ),
pinned: zod.boolean().optional(),
})
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 7bccefa85bab..205e2b5062e9 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -32841,6 +32841,53 @@ export namespace Schemas {
*/
export type LogsViewFilters = { [key: string]: unknown };
+ /**
+ * * `timestamp` - timestamp
+ * * `level` - level
+ * * `source` - source
+ * * `trace_id` - trace_id
+ * * `span_id` - span_id
+ * * `message` - message
+ * * `custom` - custom
+ */
+ export type LogsViewColumnTypeEnum = typeof LogsViewColumnTypeEnum[keyof typeof LogsViewColumnTypeEnum];
+
+
+ export const LogsViewColumnTypeEnum = {
+ Timestamp: 'timestamp',
+ Level: 'level',
+ Source: 'source',
+ TraceId: 'trace_id',
+ SpanId: 'span_id',
+ Message: 'message',
+ Custom: 'custom',
+ } as const;
+
+ export interface LogsViewColumn {
+ /** Client-generated stable identity for list operations (React keys, reorder). Never interpreted by the server. */
+ id: string;
+ /** Column type. Built-in types resolve client-side from log row fields; `custom` columns are computed server-side from `expression`.
+ *
+ * * `timestamp` - timestamp
+ * * `level` - level
+ * * `source` - source
+ * * `trace_id` - trace_id
+ * * `span_id` - span_id
+ * * `message` - message
+ * * `custom` - custom */
+ type: LogsViewColumnTypeEnum;
+ /** Header label override. Defaults to the built-in type's label, or to the expression for custom columns. */
+ name?: string;
+ /** Only meaningful for `type: custom`: a source-prefixed shorthand (`attributes.<key>`, `resource_attributes.<key>`, `body.<json.path>`) or a scalar HogQL expression, sent verbatim in the logs query's `customColumns`. */
+ expression?: string;
+ /**
+ * Column width in pixels (1–2000). Omitted for the default width; ignored for the flex message column.
+ * @minimum 1
+ * @maximum 2000
+ */
+ width?: number;
+ }
+
export interface LogsView {
readonly id: string;
readonly short_id: string;
@@ -32848,6 +32895,11 @@ export namespace Schemas {
name: string;
/** Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys. */
filters?: LogsViewFilters;
+ /**
+ * Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.
+ * @nullable
+ */
+ columns?: LogsViewColumn[] | null;
pinned?: boolean;
readonly created_at: string;
readonly created_by: UserBasic;
@@ -43425,6 +43477,11 @@ export namespace Schemas {
name?: string;
/** Filter criteria — subset of LogsViewerFilters. May contain severityLevels, serviceNames, searchTerm, filterGroup, dateRange, and other keys. */
filters?: PatchedLogsViewFilters;
+ /**
+ * Ordered column configuration for the logs table (LogsColumnConfig[]). Order is array index. Null means the view has no column preference and the client renders its default column set. Omitting the field on update leaves the saved configuration unchanged; send null to clear it.
+ * @nullable
+ */
+ columns?: LogsViewColumn[] | null;
pinned?: boolean;
readonly created_at?: string;
readonly created_by?: UserBasic;