Repository navigation
fix: apply source query settings to metric metadata lookups - #3766
karl-power wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 32516df The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
🔵 Tier 2 — Low RiskSmall, isolated change with no API route or data model modifications. Why this tier:
Additional context: spans packages but only 53 prod lines — under the 100-line cross-layer bar Review process: AI review + quick human skim (target: 5–15 min). Reviewer validates AI assessment and checks for domain-specific concerns. Stats
|
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
a1f9eff to
ee47337
Compare
PR Review
2 finding(s): 🔴 0 P0/P1 · 🟡 0 P2 · 🔵 2 P3 No inline comments. 2 P3 folded at the bottom. 🔵 2 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
E2E Test Results✅ All tests passed • 469 passed • 1 skipped • 1175s
Tests ran across 4 shards in parallel. |
Metric name, catalog, attribute, and Kubernetes facet lookups ignored the source's query settings, so settings like force_optimize_skip_unused_shards=0 never reached them and the metric browser failed on sharded tables. Refs HDX-6052
ee47337 to
32516df
Compare
Deep Review✅ No critical issues found. This is a focused, well-tested 53-line change that plumbs a metric source's 🟡 P2 — recommended
🔵 P3 nitpicks (4)
Reviewers (9): correctness, testing, maintainability, project-standards, kieran-typescript, api-contract, adversarial, security, performance. Testing gaps: The merge-order invariant is verified on only one of the three paths that pin a bound after the source spread; the new 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 |
Summary
Metric metadata lookups now apply the source's query settings, so settings like
force_optimize_skip_unused_shards=0reach them. Without this, the metric browser showed "Could not load metrics" on sharded metric tables whose server profile setsforce_optimize_skip_unused_shards=1, while chart queries on the same source worked.querySettingsToClickHouseSettings()in common-utils to turn a source'squerySettingsinto client settings.Metadata.getMetricNamesandMetadata.streamDistinctIndexValuesacceptquerySettings;useMetricNamespasses the source's settings to both and keys on them.useMetricCatalog(metric browser),useFetchMetricAttributeValues,useFetchMetricResourceAttrsanduseFetchMetricMetadataapply the source's settings.useAvailableMetricNamesandKubernetesFilterssetsourceon their chart config souseGetKeyValuesapplies the source's settings.How to reproduce
The original error needs a Distributed metrics table with a sharding key and
force_optimize_skip_unused_shards=1in the user's profile. The steps below check that the setting is sent instead, which works on any setup.Starting point:
yarn devwith a metrics source.On
main:force_optimize_skip_unused_shards=0and save.mergeTreeIndex(orGROUP BY MetricNameafter typing a search):force_optimize_skip_unused_shardsis not in its URL parameters.On this branch:
force_optimize_skip_unused_shards=0.How to test on Vercel preview
N/A — non-UI change
References