Skip to content

Commit 3bddae6

Browse files
sergicalclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 07e394b commit 3bddae6

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

platform-includes/logs/usage/python.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ sentry_sdk.logger.error(
3030
}
3131
)
3232
```
33+
34+
<Alert title="Attribute value types">
35+
36+
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)`.
37+
38+
</Alert>

0 commit comments

Comments
 (0)