diff --git a/templates/alerts.epp b/templates/alerts.epp new file mode 100644 index 000000000..ba0816c38 --- /dev/null +++ b/templates/alerts.epp @@ -0,0 +1,15 @@ +<% $prometheus::alerts::alerts.each |$alert| { -%> +ALERT <%= $alert['name'] %> + IF <%= $alert['condition'] %> + FOR <%= $alert['timeduration'] %> + LABELS { + <% $alert['labels'].each |$label| { -%> + <%= $label['name'] %> = "<%= $label['content'] %>", + <% } -%> + } + ANNOTATIONS { + <% $alert['annotations'].each |$annotation| { -%> + <%= $annotation['name'] %> = "<%= $annotation['content'] %>", + <% } -%> + } +<% } -%> diff --git a/templates/alerts.erb b/templates/alerts.erb deleted file mode 100644 index 92f574686..000000000 --- a/templates/alerts.erb +++ /dev/null @@ -1,15 +0,0 @@ -<% @alerts.each do |alert| -%> -ALERT <%= alert['name'] %> - IF <%= alert['condition'] %> - FOR <%= alert['timeduration'] %> - LABELS { - <% alert['labels'].each do |label| -%> - <%= label['name'] %> = "<%= label['content'] %>", - <% end -%> - } - ANNOTATIONS { - <% alert['annotations'].each do |annotation| -%> - <%= annotation['name'] %> = "<%= annotation['content'] %>", - <% end -%> - } -<% end -%>