Materialized views for cumulative metrics (counter increase/rate, histograms)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- clickhouse, typescript
- Domínio
- databases, observability
Direção de pesquisa
Start with the existing gauge materialized view work in #3482 and the histogram handling in core/histogram.ts. Trace how cumulative Sum and histogram series compute per-series deltas before aggregation, then assess how a refreshable materialized view could preserve reset handling and histogram bounds. Done means defining and implementing a supported rollup shape for counters and histograms, with corresponding query and alert behavior.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
What are you trying to do?
Make counter-rate and histogram-quantile charts fast over long ranges, for example increase of an Istio request counter grouped by response code over 24 h. On our deployment (@hyperdx/app 2.42.0, about 4.7 B metric rows per day) that panel takes 6–7 s and reads 52 GiB. Most of the cost is the per-series step: the chart keys each series on cityHash64(ScopeAttributes, ResourceAttributes, Attributes) and computes deltas with lagInFrame over it, so it reads both full Maps whatever the filter. Materialized columns can't help.
What would you like to see?
Materialized view support for cumulative metrics: Sum (counters) and histograms. It's related to #3482 (gauges), but it needs a different shape, because today the delta is computed per series before aggregation:
- Sum:
IF(AggregationTemporality = 1, Value, greatest(Value - lagInFrame(Value) OVER (PARTITION BY AttributesHash ORDER BY TimeUnix), 0)) - Histogram: per-series, per-bounds deltas of
Count/BucketCounts(core/histogram.ts)
So a rollup can't just aggregate Value. One shape that works for us: a view (likely a refreshable MV) that stores, per time bucket and per group, the sum of per-series increases. For histograms, it would store summed per-bucket count deltas with the same ExplicitBounds. HyperDX would read increase / rate from that column as a plain sum per bucket (rate = sum / bucket seconds), and derive quantiles from the summed bucket counts. We'd like your view on:
- how such a view should be declared on the source: a "pre-computed delta" column type next to the
aggFnmappings; - reset handling: the rollup would do the same
greatest(..., 0)/ reset logic once, at write time; - whether refreshable MVs (
REFRESH EVERY 1 MINUTE) are acceptable as the producer, since an incremental MV can't see the previous point of a series.
Alternatives you've considered
Raw-SQL tiles over our own counter-rate rollup. It works (milliseconds instead of seconds), but each panel is hand-written SQL, and alerts need the SQL path.
Anything else?
Happy to test a branch.
- Linguagem predominante
- TypeScript
- Estrelas
- 10.1k
- Forks
- 527
- Merge médio
- 1d 20h
- PRs com merge (30d)
- 186
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de ClickHouse/ClickStack
-
external
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ClickHouse/ClickStack#3761 ·
Mantenedores costumam responder em até 1 dia
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several argumentsTalvez já em andamento @CG-5228 assumiu há 26 dias. Abertaexternal
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
ClickHouse/ClickStack#3477 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limitTalvez já em andamento @Tyagiquamar assumiu há 27 dias. Abertaalerting bug external
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
ClickHouse/ClickStack#3452 ·
Mantenedores costumam responder em até 1 dia
-
check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still onTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Abertabug external Needs Feedback
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ClickHouse/ClickStack#3308 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
count_distinct aggFn on metric tiles ignores valueExpression, always counts distinct metric ValuesTalvez já em andamento @Harshul1484 assumiu há 54 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ClickHouse/ClickStack#2311 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de ClickHouse/ClickStack
Issues semelhantes
-
Add: GTrekkerAbertacheck:passed streams:add
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
area: ui Bug Payload OSS
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
payloadcms/payload#19839 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
Mantenedores costumam responder em até 1 dia
-
fix(auth): add the email OTP verification step to Pollar loginTalvez já em andamento @akansnoro assumiu hoje. AbertaStellar Wave
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
safetrustcr/dApp-SafeTrust#584 · 10 comentários ·
Mantenedores costumam responder em até 1 dia
-
The manager preset saves launch definitions without the required file and digest pairTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 80/100
Mantenedores costumam responder em até 1 dia