-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Closed
Description
Proposal
If I have data in foo and data in bar, then foo + bar will add them up.
If there are some gaps in foo or bar then foo + bar will have gaps in all of those places.
I would like to add them and have PromQL treat a missing value as zero, so I don't get gaps.
I am aware of some work-arounds available today:
- I can write
sum ( {__name__=~"foo|bar"} ), but that is ugly, and runs into "duplicate labels" problems if I call a function likerate. - Probably I can use
or vector(0), with some trickery to get the right labels.
I want to be able to do it without an ugly workaround and without trickery.
What would the syntax look like? Maybe foo + default(0) bar ?
One possibility, if I only want addition, would to have sum take multiple selectors as inputs, i.e. sum(foo, bar).
Reactions are currently unavailable