It is complicated to troubleshoot why particular PromQL expressions to not return timeseries, and the workarounds with the OR operator have been historically difficult to learn.
Dash0 worked with the Prometheus community to fix these gaps, and we just shipped the result in Dash0.
How it works
The fill modifier lets you substitute a default value for missing series in a binary operation. Three variants cover every scenario:
fill(<value>)applies the default to whichever side is missing, e.g.http_requests_total / fill(1) capacity_totalfill_left(<value>)substitutes only when the left-hand side has no match:(vector(0) > 1) / fill_left(0) requests_total(the left side is always empty, and thefilloperator handles it)fill_right(<value>)substitutes only when the right-hand side has no match:requests_total / fill_right(1) (vector(0) > 1)(the right side is always empty, and thefilloperator handles it)
Notice that, however, when both sides of an operator are missing, no time series is generated.
(We did wonder if the fill behaviour should have been the default, using fill(0) for addition and subtraction, fill(1) for multiplication, and fill_right(1) for division, but that would have been a breaking change for the Prometheus community.)
What changed
The fill operator is now available via the UI and the API in Dash0. Enjoy :-)
Want to know more?
For a detailed walkthrough of the problem and the fill solution, see the excellent Filling in Missing Series in Binary Operator Matching blog from PromLabs.
Want to learn more about PromQL in general?
We cannot recommend enough the Understanding PromQL course by PromLabs. Taking that course is effectively a right of passage for Dash0 engineers and product people :-)