Skip to content

fix: type JSON metadata filter attributes#2537

Merged
kodiakhq[bot] merged 3 commits into
hyperdxio:mainfrom
mfroembgen:codex/2482-json-schema-typed-paths
Jun 29, 2026
Merged

fix: type JSON metadata filter attributes#2537
kodiakhq[bot] merged 3 commits into
hyperdxio:mainfrom
mfroembgen:codex/2482-json-schema-typed-paths

Conversation

@mfroembgen

Copy link
Copy Markdown
Contributor

Summary

  • Render JSON-backed metadata filter keys as typed ClickHouse JSON subcolumns before using them in GROUP BY, groupUniqArray, and fallback value lookups.
  • Keep Map-backed attribute keys on the existing bracket syntax.
  • Add regression coverage for getKeyValues, getValuesDistribution, and getMapValues.

Validation:

  • mise exec node@22.16.0 -- corepack yarn workspace @hyperdx/common-utils jest --runInBand src/__tests__/metadata.test.ts
  • mise exec node@22.16.0 -- corepack yarn workspace @hyperdx/common-utils ci:lint
  • mise exec node@22.16.0 -- corepack yarn workspace @hyperdx/common-utils ci:unit

Duplicate/overlap check: I did not find another PR fixing #2482. #2423 touches faceted filter values but is a separate draft feature and does not address JSON typed subcolumn rendering.

Screenshots or video

N/A - non-UI change

How to test on Vercel preview

N/A - non-UI change

References

@changeset-bot

changeset-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e1d5250

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@hyperdx/common-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

@mfroembgen is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@mfroembgen mfroembgen marked this pull request as ready for review June 29, 2026 08:52
@greptile-apps

greptile-apps Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes metadata value sampling for JSON-backed attributes. The main changes are:

  • Typed ClickHouse JSON subcolumn rendering for metadata keys.
  • Existing bracket syntax preserved for Map-backed attributes.
  • Tests added for key values, value distribution, and map value lookups.
  • A patch changeset for @hyperdx/common-utils.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
packages/common-utils/src/core/metadata.ts Adds JSON metadata key rendering and applies it to metadata sampling queries while preserving Map access.
packages/common-utils/src/tests/metadata.test.ts Adds tests for JSON subcolumn rendering and Map-backed attribute behavior.
.changeset/type-json-metadata-filter-attributes.md Adds a patch changeset for the metadata filtering fix.

Reviews (2): Last reviewed commit: "fix: quote typed-looking JSON metadata k..." | Re-trigger Greptile

Comment thread packages/common-utils/src/core/metadata.ts
@kodiakhq kodiakhq Bot merged commit da3caab into hyperdxio:main Jun 29, 2026
17 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JSON schema filter distribution groups by Dynamic attribute paths

2 participants