[Feature request] Support Prometheus-compatible PromQL rate(), irate(), increase(), and delta() for range vectors
Mantenedores costumam responder em até 1 dia
@CoollZzz já está trabalhando nisso.
Desde 17/6/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Search before asking
- I searched in the issues and found nothing similar.
Motivation
Description
IoTDB should support Prometheus-compatible semantics for the PromQL rate(), irate(), increase(), and delta() functions on range vectors.
The expected behavior should follow Prometheus:
rate(v range-vector)returns the per-second average rate of increase over the selected range.irate(v range-vector)returns the per-second instant rate based on the last two samples in the selected range.increase(v range-vector)returns the total increase over the selected range.delta(v range-vector)returns the difference between the first and last values over the selected range.rate(),irate(), andincrease()should be used with counters and should handle counter resets correctly.delta()should be used with gauges and should not apply counter-reset correction.rate(),increase(), anddelta()should use all samples in the range and extrapolate to the range boundaries.irate()should use only the last two samples and should not extrapolate to range boundaries.
Expected Implementation Semantics
For rate() on float counters:
- Require at least two samples.
- Compute the raw increase as
last - first. - For each adjacent sample pair, detect counter reset when
current < previous. - For each detected reset, add the previous value to the corrected increase.
- If start timestamp metadata is available, also treat start timestamp reset as a counter reset.
- Apply Prometheus-compatible boundary extrapolation.
- Divide by the full range duration in seconds.
For increase() on float counters:
- Require at least two samples.
- Use the same counter-reset correction and boundary extrapolation logic as
rate(). - Return the extrapolated total increase over the range.
- Do not divide by the range duration.
- The result should be equivalent to
rate(v) * rangeDurationSeconds.
For irate() on float counters:
- Require at least two samples.
- Use only the last two samples in the range.
- If no reset is detected, return
(last - previous) / intervalSeconds. - If reset is detected, return
last / intervalSeconds. - Do not perform range-boundary extrapolation.
For delta() on float gauges:
- Require at least two samples.
- Compute the raw delta as
last - first. - Do not apply counter-reset correction.
- Apply Prometheus-compatible boundary extrapolation to cover the full range.
- Return the extrapolated delta directly.
- Do not divide by the range duration.
Test Cases
Please add compatibility tests for:
rate()without reset.rate()with one counter reset.rate()with multiple counter resets.rate()boundary extrapolation when samples are close to the range boundaries.rate()boundary extrapolation when samples are far from the range boundaries.rate()counter zero-point extrapolation guard.increase()without reset.increase()with one counter reset.increase()with multiple counter resets.increase()boundary extrapolation.increase()producing the same value asrate(v) * rangeDurationSeconds.irate()without reset.irate()with reset between the last two samples.irate()ignoring older samples except for selecting the last two points.delta()with increasing gauge values.delta()with decreasing gauge values.delta()boundary extrapolation.delta()not treating value decreases as counter resets.- Empty result when fewer than two samples are available.
References
- Prometheus
rate()documentation: https://prometheus.io/docs/prometheus/latest/querying/functions/#rate - Prometheus
irate()documentation: https://prometheus.io/docs/prometheus/latest/querying/functions/#irate - Prometheus
increase()documentation: https://prometheus.io/docs/prometheus/latest/querying/functions/#increase - Prometheus
delta()documentation: https://prometheus.io/docs/prometheus/latest/querying/functions/#delta - Prometheus
resets()documentation: https://prometheus.io/docs/prometheus/latest/querying/functions/#resets - Prometheus implementation: https://github.com/prometheus/prometheus/blob/main/promql/functions.go
Solution
No response
Alternatives
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Linguagem predominante
- Java
- Estrelas
- 6.4k
- Forks
- 1.2k
- Merge médio
- 1d 11h
- PRs com merge (30d)
- 182
Preparar o ambiente
- Sem Dockerfile nem 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 apache/iotdb
-
[Bug] sbin/replace-conf-from-env.sh word-splits the whole environment and corrupts iotdb-system.propertiesTalvez já em andamento @anishmehta24 assumiu há 28 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/iotdb#18655 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
IoTDB Edge: stop-edge.sh does not stop its own process when IOTDB_HOME is set, and reports successTalvez já em andamento @PDGGK assumiu há 48 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
[Bug] findColumn throws NullPointerException instead of SQLException for an unknown column nameTalvez já em andamento @PDGGK assumiu há 90 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
[Bug] ResultSetMetaData.getCatalogName throws IndexOutOfBoundsException instead of SQLException for out-of-range columnsTalvez já em andamento @PDGGK assumiu há 91 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
Todas as issues de apache/iotdb
Issues semelhantes
-
BC remittance upload: a claim MSP refused (S03) is saved with a blank status instead of refused (F)Abertatype: bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
carlos-emr/carlos#4933 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
apache/rocketmq-dashboard#6925 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Vakore/ZappierGames#147 ·
-
Post 1.11.2 to SpigotMCAbertaspigotmc
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 92/100
Dans-Plugins/Wild-Pets#356 ·
Mantenedores costumam responder em até 1 dia
-
Post 1.16.2 to SpigotMCAbertaspigotmc
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 85/100
Dans-Plugins/Medieval-Roleplay-Engine#371 ·
Mantenedores costumam responder em até 1 dia