Files
signoz/pkg/statementbuilder/tracesstatementbuilder
Nikhil Soni 0fe45e7114
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
feat(traces-qb): read the list-view attributes bag from the JSON column (#12749)
#### Description

Stacked on #12715. Makes the list-view ("all fields", empty
`selectFields`) attributes bag read from the `attributes` JSON column,
evolution-aware, so the bag stays complete once we stop dual-writing the
legacy maps.

- The empty-`selectFields` list path was a static, map-only column list
(`attributes_string/number/bool`). It now picks attribute homes by
column evolution for the query window: legacy maps before the JSON
rollout, the `attributes` JSON column after it, both across it — via a
new `MetadataStore.GetColumnEvolutions` and
`tracestelemetryschema.BulkAttributeColumns`, mirroring the per-key
selection.
- `mergeSpanAttributeColumns` merges the natively-decoded JSON column
(relies on #12555's `JSONValue` scan — no `toJSONString`, no second
unmarshal) into the flat bag: nested paths flatten back to dotted keys
and win over the legacy maps on collision, so the response shape is
identical across the rollout with a single decode and no re-marshal.
- Per-key group-by/aggregation is unchanged — it already resolves
JSON-only after the rollout — so those queries keep working once map
dual-write stops.

Follow-up (out of scope, tracked by #12555's known gaps): the
waterfall/flamegraph struct readers need the same `JSONValue` type
before span attributes can go JSON-only; `resources_string` moves to the
`resource` JSON column later.

#### Additional Information

Tests: bulk select across before/after/straddle windows; group-by after
rollout reads JSON not the map; consume flatten/merge (nested
flattening, type preservation, JSON-wins-on-collision).

Assisted-by: Claude Opus 4.8
2026-09-16 13:31:23 +00:00
..