Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion platform-includes/logs/best-practices/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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"]),
}
)
```
Expand Down
6 changes: 6 additions & 0 deletions platform-includes/logs/usage/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ sentry_sdk.logger.error(
}
)
```

<Alert title="Attribute value types">

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)`.

</Alert>
Loading