title: Is there a simple PromQL statement used convert cumulative histogram into ordinal histogram?
body: <p>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?</p>
  <p>For example:</p>
  <pre><code>http_access_bucket{node=&quot;aaa&quot;,le=&quot;5&quot;} 20
  http_access_bucket{node=&quot;aaa&quot;,le=&quot;10&quot;} 30
  http_access_bucket{node=&quot;aaa&quot;,le=&quot;20&quot;} 35
  http_access_bucket{node=&quot;aaa&quot;,le=&quot;50&quot;} 38
  http_access_bucket{node=&quot;aaa&quot;,le=&quot;100&quot;} 40
  http_access_bucket{node=&quot;aaa&quot;,le=&quot;+Inf&quot;} 40
  </code></pre>
  <p>convert to:</p>
  <pre><code>temp_bucket{node=&quot;aaa&quot;,le=&quot;5&quot;} 20
  temp_bucket{node=&quot;aaa&quot;,le=&quot;10&quot;} 10
  temp_bucket{node=&quot;aaa&quot;,le=&quot;20&quot;} 5
  temp_bucket{node=&quot;aaa&quot;,le=&quot;50&quot;} 3
  temp_bucket{node=&quot;aaa&quot;,le=&quot;100&quot;} 2
  temp_bucket{node=&quot;aaa&quot;,le=&quot;+Inf&quot;} 0
  </code></pre>
  <p>thank you very much!</p>