You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Index optimisations (idea: minimise index reads per query):
We could notice when we're doing overlapping queries (for instance, fetching all chunk ids for a metric vs some subset) and do the filtering client side (ie (count(max(node_cpu{job="monitoring/prom-node-exporter"}) by (cpu, node)) by (node) - sum(irate(node_cpu{job="monitoring/prom-node-exporter",mode="idle"}[1m])) by (node)) / count(max(node_cpu{job="monitoring/prom-node-exporter"}) by (cpu, node)) by (node) * 100 fetches node_cpu{job="monitoring/prom-node-exporter"} and node_cpu{job="monitoring/prom-node-exporter",mode="idle"}, the later could be filtered client side) (Extend Prometheus storage interface to do multiple queries in parallel, and use that to dedupe index lookups. #967)
We could consider not doing parallel queries for the same hash-key, as this could overload a shard
We could consider keeping metrics of how many chunks match certain k=v combinations, then when presented with an intersection operation only fetch the smallest k=v combinations - ie __name__=foo will match lots of chunks, as will instance=bar, but job=baz might match fewer. Either way we don't necessarily need to query all k=v and intersect, once we get to a certain size we could just fetch the chunks (which contain the full metric) and filter. (Don't query very high cardinality labels #884)
(Please don't put any discussion / investigation on this ticket, its just for gathering all the ideas)
Target:
Architecture
Chunk iterators:
Index optimisations (idea: minimise index reads per query):
(count(max(node_cpu{job="monitoring/prom-node-exporter"}) by (cpu, node)) by (node) - sum(irate(node_cpu{job="monitoring/prom-node-exporter",mode="idle"}[1m])) by (node)) / count(max(node_cpu{job="monitoring/prom-node-exporter"}) by (cpu, node)) by (node) * 100
fetchesnode_cpu{job="monitoring/prom-node-exporter"}
andnode_cpu{job="monitoring/prom-node-exporter",mode="idle"}
, the later could be filtered client side) (Extend Prometheus storage interface to do multiple queries in parallel, and use that to dedupe index lookups. #967)foo{bar=~"bar,*", bar!="bazzer"}
, and if so optimise it (Optimise queries likefoo{bar=~"bar,*", bar!="bazzer"}
to only query the index once #966)k=v
combinations, then when presented with an intersection operation only fetch the smallest k=v combinations - ie__name__=foo
will match lots of chunks, as willinstance=bar
, butjob=baz
might match fewer. Either way we don't necessarily need to query allk=v
and intersect, once we get to a certain size we could just fetch the chunks (which contain the full metric) and filter. (Don't query very high cardinality labels #884)The text was updated successfully, but these errors were encountered: