Commit f3287ce
docs(logs): clarify attribute value types for Python logs (#17921)
## Summary
Clarifies which value types are supported for Python log attributes,
after a user reported that array-valued attributes (e.g. `list[int]`
like `workflow_ids`/`detector_ids`) silently show up empty in the Logs
UI.
## Findings (validated against a real project)
Sentry's log storage (EAP) only retains **scalar** attribute types —
string, number, boolean. The Python SDK
(`sentry_sdk.utils.format_attribute`) sends a homogeneous scalar
`list`/`tuple` as a real **array**, which the backend does not store, so
it appears empty. Mixed lists and `dict`s are `repr`'d to strings and
*do* survive. (For contrast, `@sentry/core` stringifies all
non-primitives via `serializeAttributes(attrs, true)`, so JS users see
arrays as JSON strings — the two SDKs diverge here.)
## Change
Adds an `<Alert>` to the Python logs usage include documenting that
attribute values should be primitives, explaining the array behavior,
and recommending serializing complex values (e.g. `json.dumps(...)`)
before logging.
A separate `sentry-python` issue tracks the SDK-level inconsistency.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Kyle a.k.a. TechSquidTV <git@techsquidtv.com>
Co-authored-by: Shannon Anahata <shannon.anahata@gmail.com>1 parent 29b3cd7 commit f3287ce
2 files changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
0 commit comments