Repository navigation
Conversation
Exemplars.TimeUnix is Array(DateTime) in the seed schema and the OTel ClickHouse exporter; toUnixTimestamp64Milli only accepts DateTime64.
test(common-utils): expect the DateTime64 cast in the exemplar scan
|
@Achlesha is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
|
|
Hi @Achlesha, thanks for the pull request! Before we review code from a first-time contributor, a maintainer vouches for them, and you're not on our list yet. There's nothing else to file and this PR stays open — a maintainer will look at it, usually within a day or two, and vouch for you right here if it's a genuine attempt at the problem. To make that quick, check the PR description has:
More detail in our contributing guide. |
PR Review✅ No issues found. |
Deep ReviewThe core change is sound. The issues worth raising are the unrelated documentation edits bundled into this bug-fix diff, two of which are factually inconsistent with the current repository. 🟡 P2 -- recommended
🔵 P3 nitpicks (3)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
Tried this branch against a Metrics source whose
otel_metrics_histogramwas created by the OTel ClickHouse exporter. No markers render. The exemplar scan fails:renderMetricExemplarsChartConfigselectstoUnixTimestamp64Milli(ex_TimeUnix). That works with the e2e schema (docker/clickhouse/local/init-db-e2e.sh:190,Array(DateTime64(9))), but not whereExemplars.TimeUnixisArray(DateTime):clickhouseexporterv0.159.0)docker/otel-collector/schema/seed/00003_otel_metrics.sql:21Same result on ClickHouse 26.5 and 26.8. Casting first fixes it. It is a no-op for
DateTime64columns and keeps their precision:in
packages/common-utils/src/core/renderChartConfig.ts. The matching assertion inpackages/common-utils/src/__tests__/renderChartConfig.test.tsbecomestoContain('toUnixTimestamp64Milli(toDateTime64(ex_TimeUnix, 9))').With that change, markers render, the hover card shows the exemplar, and "Inspect trace" opens the trace.
queryChartConfig.int.test.tsalready creates anArray(DateTime)exemplar table, so an integration test of the scan there would catch this.Quick repro:
Screenshots or video
ClickHouseQueryError: … toUnixTimestamp64Milli … Expected: DateTime64, got: DateTime