hyperdxio / hyperdxio/hyperdx

UI generates invalid ClickHouse queries when filtering on parsed JSON strings

Open
#995 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug Improvement v2
Dominant language
TypeScript
Stars
9.9k
Forks
471
Avg merge
2d 4h
Merged PRs (30d)
117

Description

HyperDX UI automatically parses JSON strings in the StatusMessage column but fails to generate proper ClickHouse queries when users attempt to filter on nested JSON fields through the Search for this value only feature.

Steps to Reproduce

  1. Have a span with a StatusMessage field (stored as a String in ClickHouse) containing JSON data.

  2. In the HyperDX UI, the string is automatically parsed as JSON and displayed in a tree structure:

    Image
  3. Navigate to the nested field (e.g., failures.0.index with value "identities")

  4. Click Search for this value only:

    Image

Expected Behavior

The UI should generate a valid ClickHouse query using proper JSON Functions such as:

  • simpleJSONExtractString(StatusMessage, 'index') = 'identities' for field matching

    Image

Actual Behavior

HyperDX generates an invalid query that fails with a ClickHouse syntax error. The UI knows how to parse and display the JSON structure correctly but cannot translate user filtering actions into proper ClickHouse queries.

Image

Suggested Fix

The UI should:

  1. Detect when a field is a JSON string that has been automatically parsed
  2. Prefer simpleJSONExtractString for basic field matching as it's more reliable for nested JSON
  3. Fall back to JSONExtractString only when precise path specification is required

Impact

This significantly impacts usability as users cannot effectively filter on JSON data through the UI, forcing them to write raw ClickHouse queries manually.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue in the HyperDX UI with a JSON string in the ClickHouse StatusMessage column, then inspect the query generated by Search for this value only for a nested field. Done means the UI generates a valid ClickHouse query using the appropriate JSON extraction function and the filter works without a syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
clickhouse, typescript
Domain
databases, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.