[15:35:58] godog: do you have any idea if it is even possible in promql to say "if X, use this metric; else use this metric"? context is I'm thinking of adding recording rules for overall aggregates for ripe atlas stats, but still want to support easy drilldown based on country_code or asn variables [15:45:58] cdanis: right off the bat I'd say "or" could do it, but could you give me an example? [15:46:27] hm yeah I guess 'or' would probably do it [15:47:06] since recording_rule_that_aggregates_everything won't yield any results for recording_rule_that_aggregates_everything{country_code="it"} ... but hm, that won't save you any execution time for when you don't select any variables [15:47:40] and also recording_rule_that_aggregates_everything{country_code=~".*"} probably doesn't yield anything either [15:48:35] yeah if country_code isn't in the labelset I'm expecting it shouldn't yield anything [15:48:52] basically if the two drilldown variables are the "all" value, you'd want to display the already-aggregated-across-everything rule, and if they weren't, you'd want to use the underlying metric that the recording rule is aggregating from [15:53:13] maybe I just need multiple panels in grafana :) [15:54:20] heheh multiple panels will work for sure, although yeah it'd be neat to get what you are describing [15:54:40] I'm guessing/hoping that prometheus will DTRT and short circuit "or" operands [15:55:02] the docs describe "or" as a simple set union, essentially [15:55:09] vector1 or vector2 results in a vector that contains all original elements (label sets + values) of vector1 and additionally all elements of vector2 which do not have matching label sets in vector1. [15:56:21] mmhh right, so in the "all" case the underlying metric will be evaluated anyways (?) essentially negating the recording rule speedup if I understand correctly [15:57:03] yeah, and also I think the aggregate metric will 'always' appear regardless of what you set country_code to [15:57:40] since you can't just put the variable inside its labels, as that label doesn't appear there at all -- and that also means it will 'always' not match the label set of the rhs [15:58:56] aye, now it feels more like a conditional for different queries to be done on the grafana side, depending on the state of templating variables [15:59:02] gotta join a meeting [16:00:05] have fun :) [17:02:01] jbond42, XioNoX ping!