prometheus/alertmanager

Improve alert indexing and search

gouthamve opened this issue · 3 comments

From @brancz

currently there are various maps to improve access to certain alerts, but very scattered across the code base and seemingly unrelated

Further, I remember discussion of using the TSDB inverted index to do this.

Questionable whether we should use it 1 to 1 or just as a concept, but yes I think the concept of the inverted index would work nicely, there are other questions of how to populate it efficiently and remove alerts efficiently as well though as don't have the same expectations as TSDB in terms of "immutability" of historic data.

#GSOC-2018
I would like to take this issue up. Could someone elaborate a bit more on the problem at hand.

The problem is that Alertmanager currently holds the alerts ingested simply in a map, and when the frontend or anything using the API wants to filter something, then Alertmanager filters them naively in the HTTP handlers, whereas we should be able to index the alerts more precisely in order to not have to iterate over the entire set of alerts currently in memory.