Skip to content

adding alert templates support for AlertManager#1237

Merged
khaines merged 2 commits intocortexproject:masterfrom
rsteneteg:rsteneteg/alert-templates
Mar 9, 2019
Merged

adding alert templates support for AlertManager#1237
khaines merged 2 commits intocortexproject:masterfrom
rsteneteg:rsteneteg/alert-templates

Conversation

@rsteneteg
Copy link
Contributor

Signed-off-by: Roger Steneteg rsteneteg@ea.com

Signed-off-by: Roger Steneteg <rsteneteg@ea.com>
Signed-off-by: Roger Steneteg <rsteneteg@ea.com>
Copy link
Contributor

@khaines khaines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved from internal reviews. Needs another maintainer's approval as well.

@rsteneteg rsteneteg mentioned this pull request Feb 23, 2019
@rsteneteg
Copy link
Contributor Author

This PR adds the ability to add reusable templates in the Alert Managers notification output to the receivers. As described here https://prometheus.io/docs/alerting/notification_examples/#defining-reusable-templates

This can be used to avoid repeating alert templates in the configuration in the alertmanager config, or moving long multiline alert templates into separate files to make the alert manager configuration file leaner

Copy link
Contributor

@bboreham bboreham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@khaines khaines merged commit d166217 into cortexproject:master Mar 9, 2019
@bboreham
Copy link
Contributor

bboreham commented May 2, 2019

Just looked this over again - it actually writes out disk files for the templates?
That's a bit different from what we do for other ruler stuff, but I guess it's workable because the contents of the files are rewritten any time the config is reloaded.

@rsteneteg
Copy link
Contributor Author

@bboreham yes, the template files are written to disk, just as silences are. The alertmanager uses this Prometheus package to load templates from files on disk "github.com/prometheus/alertmanager/template".

And as you said, they are rewritten and reloaded each time the config changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants