From 3bddae63103871df1f68ab1e30499e7819d02985 Mon Sep 17 00:00:00 2001 From: Sergiy Dybskiy Date: Thu, 28 May 2026 19:00:29 -0400 Subject: [PATCH 1/3] docs(logs): clarify attribute value types for Python logs Log attribute values must be primitives (string/number/boolean) to be stored. Same-typed scalar lists are sent as arrays that aren't currently retained (they appear empty in the Logs UI), while mixed lists and dicts are stored as their string representation. Document this and recommend serializing complex values (e.g. json.dumps) before logging. Co-Authored-By: Claude Opus 4.8 --- platform-includes/logs/usage/python.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/platform-includes/logs/usage/python.mdx b/platform-includes/logs/usage/python.mdx index ff0e51f683cc4..4d23259bace47 100644 --- a/platform-includes/logs/usage/python.mdx +++ b/platform-includes/logs/usage/python.mdx @@ -30,3 +30,9 @@ sentry_sdk.logger.error( } ) ``` + + + +Attribute values should be primitives — strings, numbers, or booleans. Sentry's log storage only retains these scalar types, so other values are handled inconsistently: a `list` or `tuple` of same-typed scalars (for example `[1, 2, 3]`) is sent as an array, which is **not currently stored** and shows up empty in the Logs UI, while mixed lists and `dict`s are stored as their string representation. To keep a complex value searchable, serialize it to a string yourself before logging — for example `json.dumps(workflow_ids)`. + + From e60aaef15aa5d0b46f596952544a7b2913f83c35 Mon Sep 17 00:00:00 2001 From: Sergiy Dybskiy Date: Thu, 28 May 2026 19:07:41 -0400 Subject: [PATCH 2/3] docs(logs): stringify feature_flags example in Python best practices The "Include Business Context" example showed feature_flags as a raw list, which the Python SDK drops on ingestion (arrays aren't stored as attributes). Show the join-to-string pattern instead so the example actually works. Co-Authored-By: Claude Opus 4.8 --- platform-includes/logs/best-practices/python.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platform-includes/logs/best-practices/python.mdx b/platform-includes/logs/best-practices/python.mdx index 985fa2a1867f5..27a96143f925c 100644 --- a/platform-includes/logs/best-practices/python.mdx +++ b/platform-includes/logs/best-practices/python.mdx @@ -69,7 +69,8 @@ sentry_sdk.logger.info( # Business context "order_value": 149.99, - "feature_flags": ["new-checkout", "discount-v2"], + # Join lists into a string — array values aren't stored as attributes + "feature_flags": ",".join(["new-checkout", "discount-v2"]), } ) ``` From c9847f0dee75c27f1a0131b2c9ea285ab0f43f8b Mon Sep 17 00:00:00 2001 From: Sergiy Dybskiy Date: Tue, 2 Jun 2026 14:25:06 -0400 Subject: [PATCH 3/3] Update platform-includes/logs/usage/python.mdx Co-authored-by: Shannon Anahata --- platform-includes/logs/usage/python.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform-includes/logs/usage/python.mdx b/platform-includes/logs/usage/python.mdx index 4d23259bace47..ad073e66a0c60 100644 --- a/platform-includes/logs/usage/python.mdx +++ b/platform-includes/logs/usage/python.mdx @@ -33,6 +33,6 @@ sentry_sdk.logger.error( -Attribute values should be primitives — strings, numbers, or booleans. Sentry's log storage only retains these scalar types, so other values are handled inconsistently: a `list` or `tuple` of same-typed scalars (for example `[1, 2, 3]`) is sent as an array, which is **not currently stored** and shows up empty in the Logs UI, while mixed lists and `dict`s are stored as their string representation. To keep a complex value searchable, serialize it to a string yourself before logging — for example `json.dumps(workflow_ids)`. +Attribute values should be primitives — strings, numbers, or booleans. Sentry's log storage only retains these scalar types, so other values are handled inconsistently. A `list` or `tuple` of same-typed scalars (for example `[1, 2, 3]`) is sent as an array, which is **not currently stored** and shows up empty in the Logs UI. Mixed lists and `dict`s are stored as their string representation. To keep a complex value searchable, serialize it to a string before logging, for example `json.dumps(workflow_ids)`.