As we known, the bucket metrics got from prometheus are cumulative histogram. Is there a simple PromQL statement used convert cumulative histogram into ordinal histogram?
For example:
http_access_bucket{node="aaa",le="5"} 20
http_access_bucket{node="aaa",le="10"} 30
http_access_bucket{node="aaa",le="20"} 35
http_access_bucket{node="aaa",le="50"} 38
http_access_bucket{node="aaa",le="100"} 40
http_access_bucket{node="aaa",le="+Inf"} 40
convert to:
temp_bucket{node="aaa",le="5"} 20
temp_bucket{node="aaa",le="10"} 10
temp_bucket{node="aaa",le="20"} 5
temp_bucket{node="aaa",le="50"} 3
temp_bucket{node="aaa",le="100"} 2
temp_bucket{node="aaa",le="+Inf"} 0
thank you very much!