Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upParametrised rules #3804
Comments
This comment has been minimized.
This comment has been minimized.
|
This sort of thing is something that we expect users to handle using the templating feature of your configuration management system. In this case it sounds like you may be looking for the existing external_labels setting combined with alert notification templates in the Alertmanager. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil When you have a configuration management then you can use it - and that's fine. However often we have only scheduler (like kubernetes, or others) to run a container and pre-defined configuration that can use service discovery. Currently I'm using a bunch of sed/awk scripts to tune main config file + concatenate only needed alerts Of course using scheduler we can deliver a whole configuration and all needed alerts. In our case we deliver an application with profiled prometheus to monitor it (rules, console templates) - in this case you have to adjust configuration in a scheduler (prometheus params, new rules) - we can't deliver a template of that. As long as I'm thinking about that it could be useful to have an ability to override parameters from a command line or env variable - maybe we can template config and alerts based from env variables, cmd line or hardcoded as proposed above? |
This comment has been minimized.
This comment has been minimized.
|
Prometheus intends to be a monitoring system, not to duplicate the functionality of configuration management. There's no plans to add any such features to Prometheus. You should look into something like ksonnet. |
brian-brazil
closed this
Feb 6, 2018
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 22, 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. |
jsuchenia commentedFeb 6, 2018
Enhancement request
It could be nice that rule files can be loaded with some parameters attached. Those parameters could be useful as a context to 'for' or some default labels assignments
Currently all rules are loaded as they are so it's hard to maintain rules with different settings or threshold levels
How to implement that
We can evaluate rule file before YAML parser as a template. I know that inside Alert rules we use templating, so initial params can be included using other notation like
[[and]]instead of typical mustaches (looks like in go templating you can define Delims)Example usage:
Then we can skip groups, change thresholds, conditionally load/skip alerts based on cofiguration
Currently in 2.1.0 there are no such solution