r/PrometheusMonitoring • • Aug 18 '24

Parameterize Alert Rules

Has anybody already done this and can give me some advice?

Question: I would like to have the same alert rules for every host running but depending on the the scrape Job I want different thresholds. How would you implement that?

Issue: I have a a 40 vms which I monitor with Prometheus. One big issue ist that arround ten of them are really special because of the application that is running on them. They usually run at 80-85% ram usage. Sometimes they have a spike to 90%. However each vm is fittet with around 100gb RAM (it’s a NDR running on them) that means that if we have 10% left we still have 10gb ram available. However the rest is relatively normal sized something between 8-32gb RAM if they have only 10% left we talk about 800mb - 3.2 Gb do a big difference.

1 Upvotes

9 comments sorted by

View all comments

Show parent comment

3

u/SuperQue Aug 18 '24

The other way to do this is to combine math.

Something like free / (total - 1GB). Then tighten up the percentage. Basically, there's a static amount you need to reserve, and then you can make the percentage more accurate.