log list/view --fields breaks on typed custom attributes
I maintainer di solito rispondono entro 1 giorno
@BYK ci sta già lavorando.
Dal 9/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
What happened
sentry log list / log view --fields supports requesting log attributes beyond the small set of fixed schema columns (timestamp, message, severity, trace, etc.). Those fixed columns resolve by plain name, but Sentry's logs backend requires custom/dynamic attributes to be requested with a type-qualified selector, tags[<name>,<type>] (e.g. tags[shard_id,number]) — because the same attribute name can be ingested as a different type across different log calls, so the query engine needs to know which typed column to read. Verified directly against the API: field=shard_id (plain) returns "shard_id": null, while field=tags[shard_id,number] returns the real value.
The bug: --fields is parsed by parseFieldsList() (packages/cli/src/lib/formatters/json.ts), which unconditionally splits the whole flag value on every comma. tags[shard_id,number] has a comma inside the attribute name, so requesting it shreds one valid field into two garbage fragments — tags[shard_id and number] — before it ever reaches the API. There is no escaping mechanism, and --fields cannot be repeated (a second --fields flag errors with "Too many arguments for --fields"), so there is currently no way to request a typed custom attribute through log list/log view --fields at all.
Why this is confusing in practice
sentry log list org/project --fields shard_id,num_shards looks like a normal, well-formed request and returns valid JSON — just with null for every custom field, with no error and no hint that these are custom attributes requiring the tags[name,type] form. Switching to the documented type-qualified syntax then hits a second, different-looking wall: --fields 'tags[shard_id,number]' still returns null, but now split into two malformed keys ({"tags[shard_id": null, "number]": null}). That looks like the type-qualified syntax itself isn't supported by these commands, when actually the comma inside it is being torn apart by the flag parser before the request is even built.
Root cause
parseFieldsList() in packages/cli/src/lib/formatters/json.ts does an unconditional .split(",") on the raw --fields string, with no awareness of the tags[name,type] bracket syntax used for custom log/span attributes elsewhere in the CLI. (sentry api -F 'field=tags[shard_id,number]' works correctly, because api.ts's field parsing doesn't have this issue — it's specific to the shared --fields flag parser used by log, trace, and span commands.) Any --fields value containing a bracketed, comma-containing attribute name breaks before it reaches the log/trace/span API layer.
Proposed fixes
- Make
parseFieldsList()bracket-aware: only split on top-level commas, treating[...]spans as atomic (a small tokenizer, or a regex that ignores commas inside brackets). - Alternatively/additionally, support repeating
--fields(currently rejected) so multi-value selection doesn't depend on the flag's own comma-splitting. - Document the
tags[name,type]syntax directly inlog list --help/log view --help— today it's only discoverable viasentry api --help.
via lorenzo.
--
- Lingua principale
- TypeScript
- Stelle
- 938
- Fork
- 166
- Merge medio
- 1g 7h
- PR unite (30g)
- 156
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/toolkit
-
bug MCP
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
getsentry/toolkit#1600 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
getsentry/toolkit#1471 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
getsentry/toolkit#1611 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement MCP
Difficoltà 4/5 1-2 giorni Idoneità per principianti 55/100
getsentry/toolkit#1601 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Use typed detector schemas from @sentry/api for metric monitorsForse già presa @MathurAditya724 l’ha presa 1 giorno fa. Aperta
getsentry/toolkit#1595 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di getsentry/toolkit
Issue simili
-
area: image-engine bug priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
snapotter-hq/SnapOtter#3885 ·
I maintainer di solito rispondono entro 1 giorno
-
Mend: dependency security vulnerability
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 3 giorni
-
pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug P3 UI/UX
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
openclaw/openclaw#182077 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno