Files
signoz/pkg/statementbuilder/tracesstatementbuilder
srikanthccv 7bd2cdb461 feat: resolve semantic convention names in trace queries
A referenced name now resolves to logical fields (LogicalField, #12499).
A slice shows ambiguity: each logical field gets its own condition. A
group shows a semantic-convention family: one field with more than one
spelling. Compilers merge a family with current-wins precedence, and
the response keeps the spelling that the request used.

- FieldMapper gets one new method: ExistsFor, the per-key existence
  primitive. Each mapper already had this knowledge; two rename a
  private method and five expose logic from their condition builders.
- LogicalValueExpr and LogicalExistsExpr build all family SQL in one
  place, only from FieldFor and ExistsFor. No signal implements family
  logic.
- Statement builders prefetch sibling spellings with
  ExpandKeySelectorsForFamilies. The metadata store stays family-blind,
  and autocomplete stays literal.
- The traces and resource-filter condition builders compile per logical
  field. The traces group-by path upgrades legacy candidates to their
  family in a post-pass; the legacy candidate flow does not change.
- Logs, metrics, audit, metadata, and rule-state-history flatten to
  single keys; their SQL does not change.

The resolve_semconv_families feature flag (default: disabled) gates all
family behavior. The components that resolve names hold the flagger and
evaluate the flag at the point of use, with the org from the call, the
same way the logs mapper uses use_json_body. A nil flagger means off,
so resolution stays literal on any path without one. With the flag off,
the generated SQL is the same as main, and tests pin this. The legacy
compatibility-key map stays in place for the same reason.

Assisted-by: Claude Fable 5
2026-08-13 18:04:28 +05:30
..