Filter key and value limits are unordered and not configurable — fields and values silently disappear
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- clickhouse, react, typescript
- Lĩnh vực
- backend, databases, frontend, observability
Hướng nghiên cứu
Bắt đầu trong packages/common-utils/src/core/metadata.ts, lần theo getAllFields, getMapKeys, getAllKeyValues, getKeyValues và mẫu cắt ngắn của getMetricNames. Sau đó kiểm tra packages/app/src/hooks/useMetadata.tsx, TeamQueryConfigSection.tsx và DBSearchPageFilters/hooks.ts để nắm luồng thiết lập và cách render bộ lọc. Hoàn thành khi các giới hạn có thể cấu hình được truyền tới discovery và các giá trị, kết quả bị cắt ngắn là xác định và được hiển thị trong UI.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Field discovery and value autocomplete both truncate to a fixed number of results with no ORDER BY. On a high-cardinality source the survivors are an arbitrary subset, the UI gives no sign anything was dropped, and the one team setting that looks like it controls this doesn't reach either path.
We hit this on a source with ~6,150 distinct LogAttributes keys. Roughly 5,150 of them are invisible in the filter sidebar and there is no way to raise the ceiling.
Keys: capped at 1000, and Filter Keys Fetch Limit doesn't apply
getAllFields calls getMapKeys without maxKeys, so DEFAULT_MAX_KEYS = 1000 always wins:
metadata.ts:1536— the call, nomaxKeysargumentmetadata.ts:57—const DEFAULT_MAX_KEYS = 1000;metadata.ts:693—maxKeys = DEFAULT_MAX_KEYS
The team setting exists (TeamQueryConfigSection.tsx:320, "Filter Keys Fetch Limit") but is only read in useMultipleGetKeyValues, where it slices the already-truncated key array: useMetadata.tsx:372-373, applied at useMetadata.tsx:411. Raising it above 1000 changes nothing; lowering it below 1000 only trims what discovery already returned. Confirmed on the wire — discovery queries carry LIMIT 1000 regardless of the setting.
Keys: the text-index path has no ORDER BY
getMapKeys returns from the first non-empty path of four. On ClickHouse 26.4 with a text index on mapKeys(LogAttributes), the text-index path wins and the KV rollup is never consulted:
metadata.ts:754-759—SELECT token AS key … GROUP BY key HAVING key != '' LIMIT maxKeys, noORDER BYmetadata.ts:788-793— same for the kv-token index
Compare the rollup path, which does order by frequency: metadata.ts:846-853 — ORDER BY sum(count) DESC. Adding a text index therefore makes field discovery worse: you trade a frequency-ranked list for an arbitrary one.
Values: capped at a hardcoded 20, also unordered
metadata.ts:2267—getAllKeyValues({ maxValuesPerKey = 20 })metadata.ts:2494—getKeyValues({ limit = 20 })metadata.ts:2779—getKeyValuesWithMVs({ limit = 20 })useMetadata.tsx:412—maxValuesPerKey: 20, hardcodedDBSearchPageFilters/hooks.ts:33—INITIAL_LOAD_LIMIT = 20, passed at line 197
The SQL is groupUniqArray(limit)(…) throughout, with no ordering: 2570-2571, 2605, 1428, 1257, 1334.
"Load More" raises one key to 10,000 (hooks.ts:36), but it's a manual per-key click. The initial 20 that decides whether the value you're looking for is on screen at all has no setting behind it.
This is already documented in the codebase
metadata.ts:2652-2669 explains why getMetricNames avoids getKeyValues:
groupUniqArray(limit)(MetricName)"keeps an arbitrary subset once a table has more thanlimitdistinct names — the survivors follow hash order, not name order, and shift as the data and part layout change. On a high-cardinality source (a full Prometheus scrape) that silently hid metrics such asup, with no way to search for what had been dropped."
And useMetadata.tsx:526 tells callers to "Prefer this over useGetKeyValues({ keys: ['MetricName'] }), which samples an arbitrary subset via groupUniqArray".
The fix applied there is exactly what's missing everywhere else: a deterministic ORDER BY, LIMIT limit + 1, and a truncated flag so the caller knows the list was cut. A truncated field already exists in the shared type at metadata.ts:77.
What we'd like
A cap is reasonable. Being unable to raise it, and not being told it applied, is not.
- Pass
maxKeysfromfilterKeysFetchLimitthroughgetAllFieldsintogetMapKeys, so the existing setting actually controls key discovery. - Add a team setting for max values per key, replacing the hardcoded
20inuseMetadata.tsx:412andINITIAL_LOAD_LIMIT. - Add
ORDER BYto the truncating queries — frequency for keys (as the rollup path already does), something deterministic for values — so the subset is at least stable and useful. - Surface truncation in the UI, reusing the
limit + 1/truncatedpattern fromgetMetricNames.
Environment
- HyperDX 2.37.0, ClickHouse Cloud 26.4
otel_logswithtextindexes onmapKeys(LogAttributes),mapKeys(ResourceAttributes),mapKeys(ScopeAttributes)- ~6,150 distinct
LogAttributeskeys per 15-minute window
- Ngôn ngữ chính
- TypeScript
- Star
- 10.1k
- Fork
- 527
- Merge trung bình
- 1 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 186
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của ClickHouse/ClickStack
-
external
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ClickHouse/ClickStack#3761 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several argumentsCó thể đã có người làm @CG-5228 đã nhận 26 ngày trước. Đang mởexternal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/ClickStack#3477 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limitCó thể đã có người làm @Tyagiquamar đã nhận 27 ngày trước. Đang mởalerting bug external
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ClickHouse/ClickStack#3452 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still onCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug external Needs Feedback
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ClickHouse/ClickStack#3308 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric ValuesCó thể đã có người làm @Harshul1484 đã nhận 54 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ClickHouse/ClickStack#2311 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của ClickHouse/ClickStack
Issue tương tự
-
Add: GTrekkerĐang mởcheck:passed streams:add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: ui Bug Payload OSS
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
payloadcms/payload#19839 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix(auth): add the email OTP verification step to Pollar loginCó thể đã có người làm @akansnoro đã nhận hôm nay. Đang mởStellar Wave
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
safetrustcr/dApp-SafeTrust#584 · 10 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
The manager preset saves launch definitions without the required file and digest pairCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày