Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practice for configuring huge alert rules? #1971

Closed
zxwing opened this Issue Sep 9, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@zxwing
Copy link

zxwing commented Sep 9, 2016

My system allows users to create alarms dynamically which are essentially implemented by Prometheus's alert rules. I have two ways to do this:

  1. put all rules in a big single file
  2. create rule files for every single rule and list them in rule_files

reload the prometheus by kill -1.

Which approach will you recommend for a high concurrent environment with huge rules? for example, 10000 people create 10000 rules concurrently. The #1 may cause a very large file that blows up memory while #2 may lead to a long for...loop.

The DNSMASQ used to have the performance issue in the aforementioned scenario; they fixed it using inotify with rules per file after I reported the issue.

I know I have #3 that groups rules in files with decent size; I just want to know if prometheus has been designed for this scenario.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented Sep 9, 2016

I presume there's only a very small number of potential types of alerts users can create, likely less than 10.

The way to approach this is to create those 10 alerts, and have the thresholds and notification targets coming from 10 metrics (one per alert type).

This unittest should point you in the right direction: https://github.com/prometheus/prometheus/blob/master/promql/testdata/operators.test#L322

@zxwing

This comment has been minimized.

Copy link
Author

zxwing commented Sep 12, 2016

Thanks

@zxwing zxwing closed this Sep 12, 2016

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.