adding comments in data structure

This commit is contained in:
Samuel Berthe 2019-10-26 17:25:35 +02:00
parent c70a5089c7
commit dfa5446cd5
2 changed files with 7 additions and 0 deletions

View file

@ -65,6 +65,10 @@ services:
description: Context switching is growing on node (> 1000 / s)
query: 'rate(node_context_switches_total[5m]) > 1000'
severity: warning
comments: |
1000 context switches is an arbitrary number.
Alert threshold depends on nature of application.
Please read: https://github.com/samber/awesome-prometheus-alerts/issues/58
- name: Swap is filling up
description: Swap is filling up (>80%)
query: '(1 - (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes)) * 100 > 80'

View file

@ -71,6 +71,7 @@ groups:
<ul>
{% for rule in exporter.rules %}
{% assign ruleIndex = forloop.index %}
{% assign comments = rule.comments | strip | newline_to_br | split: '<br />' %}
<li>
<h4>
{{ serviceIndex }}.{{ ruleIndex }}.
@ -86,6 +87,8 @@ groups:
{% capture ruleNameCamelcase %}{% for word in ruleName %}{{ word | capitalize }} {% endfor %}{% endcapture %}
{% highlight yaml %}
{% for comment in comments %}# {{ comment | strip }}
{% endfor %}
- alert: {{ ruleNameCamelcase | remove: ' ' }}
expr: {{ rule.query }}
for: 5m