Search sidebar JSON resource filters use map access
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 9.9k
- Forks
- 471
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 117
Description
Summary
After #2537, JSON-backed metadata value/distribution queries are typed correctly, but the Search dashboard sidebar can still serialize a selected resource attribute filter as a map-style expression instead of a typed ClickHouse JSON subcolumn.
This still breaks JSON-schema OTel log/trace sources when a user selects a resource attribute value from the filter sidebar, for example ResourceAttributes.k8s.namespace.name.
Repro
On a source where ResourceAttributes is a ClickHouse JSON(max_dynamic_types=8, max_dynamic_paths=64) column:
- Open Search for a logs source.
- Expand/pin
ResourceAttributes.k8s.namespace.namein the filter sidebar. - Select a namespace value from the sidebar filter values.
- Run the search or use the distribution button for that filtered attribute.
Actual
The dashboard can persist/send a filter using map access against the JSON column, for example:
ResourceAttributes['k8s.namespace.name'] IN ('traefik-private')
or an untyped JSON path. ClickHouse then sees a JSON/Dynamic value where a concrete string expression is needed and returns errors like:
First argument for function 'arrayElement' must be array, got 'JSON(max_dynamic_types=8, max_dynamic_paths=64)'
Expected
For source columns whose schema type is JSON(...), dashboard filter serialization should emit typed JSON subcolumns, for example:
ResourceAttributes.`k8s`.`namespace`.`name`.:String IN ('traefik-private')
Map-backed attributes should keep the existing bracket syntax.
Notes
- Related to #2482 and #2537, but narrower: this is the frontend/search-filter state path rather than common-utils metadata query generation.
- I did not find another open issue or PR that fixes this remaining Search dashboard filter serialization path.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the Search dashboard sidebar filter serialization and reproduce the issue with a JSON-schema OTel logs source using ResourceAttributes.k8s.namespace.name. Compare the emitted expression for JSON(...) columns with the existing map-backed bracket syntax. Done means selected resource attribute filters and distribution queries use typed JSON subcolumns while map-backed attributes remain unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clickhouse, typescript
- Domain
- frontend, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 57/100