Materialized view support for Metric sources (gauges)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- clickhouse, typescript
调研方向
Start with packages/api/src/models/source.ts, where materializedViews is currently defined for log and trace sources, then trace how gauge charts choose query tables and how log attributes map to __otel_materialized_* columns. The issue does not identify the routing or query files, so locate those entry points before estimating the full change. Done means gauge views can be registered and selected when metric name, aggregation, granularity, group-by, and filters fit, with other queries falling back to raw tables.
由索引模型根据 Issue 内容生成。
描述
What are you trying to do?
Make dashboard metric charts over long ranges fast. Materialized views (#1507) work well for Log and Trace sources: on our deployment (@hyperdx/app 2.42.0), a per-minute log rollup answered 24 h count-by-service charts and the search histogram in 4–16 ms instead of 1.9 s, with exact counts.
Metric sources can't use them. materializedViews is defined only for the log and trace kinds (packages/api/src/models/source.ts), so every metric chart scans the raw otel_metrics_* tables. Metric charts are now the slowest part of our dashboards, at about 4.7 B metric rows per day.
What would you like to see?
Materialized view support for Metric sources, starting with gauges. These are the simple case, because no per-series state is involved:
- A Metric source can register views for its gauge table: target table, timestamp column, granularity, dimension columns, and aggregated columns (
avg/min/max/last_valueas-State/SimpleAggregateFunctioncolumns, like log MVs). - A gauge chart is routed to a view when the metric name, aggregation, granularity, and group-by / filter attributes fit. Otherwise it falls back, as today.
- Attribute dimensions: let a view expose
Attributes['k']/ResourceAttributes['k']as named columns, the way filters are already mapped to__otel_materialized_*columns for logs.
Counters (Sum) and histograms are cumulative and need per-series deltas, so they are filed separately (#3483).
Alternatives you've considered
- Raw-SQL tiles pointing at our own rollup tables. They work, but every panel has to be rewritten by hand and loses the builder (filters, group-by, alerts).
- Materialized columns for hot attribute keys. They help filters, but each series is still keyed on
cityHash64(ScopeAttributes, ResourceAttributes, Attributes), which reads the full Maps.
Anything else?
Happy to test a branch on our deployment: ClickStack with a self-hosted ClickHouse cluster.
- 主要语言
- TypeScript
- 星标
- 10.1k
- 派生
- 527
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 186
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ClickHouse/ClickStack 的其他 Issue
-
external
难度 2/5 1-3 小时 新手友好度 72/100
ClickHouse/ClickStack#3761 ·
维护者通常 1 天内回复
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several arguments可能已有人在做 @CG-5228 于 26 天前认领。 未关闭external
难度 2/5 1-3 小时 新手友好度 76/100
ClickHouse/ClickStack#3477 · 1 条评论 ·
维护者通常 1 天内回复
-
Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limit可能已有人在做 @Tyagiquamar 于 27 天前认领。 未关闭alerting bug external
难度 2/5 1-3 小时 新手友好度 76/100
ClickHouse/ClickStack#3452 ·
维护者通常 1 天内回复
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still on可能重新可做 关联的 PR 已关闭且未合并。 未关闭bug external Needs Feedback
难度 2/5 1-3 小时 新手友好度 72/100
ClickHouse/ClickStack#3308 · 1 条评论 ·
维护者通常 1 天内回复
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric Values可能已有人在做 @Harshul1484 于 54 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
ClickHouse/ClickStack#2311 ·
维护者通常 1 天内回复
查看 ClickHouse/ClickStack 的全部 Issue
相似的 Issue
-
Add: GTrekker未关闭check:passed streams:add
难度 1/5 1 小时以内 新手友好度 72/100
维护者通常 1 天内回复
-
area: ui Bug Payload OSS
难度 1/5 1 小时以内 新手友好度 88/100
payloadcms/payload#19839 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
fix(auth): add the email OTP verification step to Pollar login可能已有人在做 @akansnoro 今天认领。 未关闭Stellar Wave
难度 2/5 1-3 小时 新手友好度 74/100
safetrustcr/dApp-SafeTrust#584 · 10 条评论 ·
维护者通常 1 天内回复
-
The manager preset saves launch definitions without the required file and digest pair可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复