Adding exporters: sidekiq, pgbouncer and thanos.

Adding rules to: prometheus, kubernetes, redis, docker and postgresql.
Arranging exporters into categories.
Showing number of rules.
Thanks to Gitlab for opensourcing alerting rules!
This commit is contained in:
Samuel Berthe 2020-03-09 21:13:55 +01:00
parent affacde49b
commit 0b89a764ee
No known key found for this signature in database
GPG key ID: 9D7813625412A946
4 changed files with 1221 additions and 924 deletions

View file

@ -14,39 +14,60 @@ Collection available here: **[https://awesome-prometheus-alerts.grep.to](https:/
## 🚨 Rules ## 🚨 Rules
- [Prometheus internals](https://awesome-prometheus-alerts.grep.to/rules#prometheus-internals) #### Basic resource monitoring
- [Prometheus self-monitoring](https://awesome-prometheus-alerts.grep.to/rules#prometheus-internals)
- [Host/Hardware](https://awesome-prometheus-alerts.grep.to/rules#host-and-hardware) - [Host/Hardware](https://awesome-prometheus-alerts.grep.to/rules#host-and-hardware)
- [Docker Containers](https://awesome-prometheus-alerts.grep.to/rules#docker-containers) - [Docker Containers](https://awesome-prometheus-alerts.grep.to/rules#docker-containers)
- [RabbitMQ](https://awesome-prometheus-alerts.grep.to/rules#rabbitmq) - [Blackbox](https://awesome-prometheus-alerts.grep.to/rules#blackbox)
- [Windows](https://awesome-prometheus-alerts.grep.to/rules#windows-server)
#### Databases and brokers
- [MySQL](https://awesome-prometheus-alerts.grep.to/rules#mysql) - [MySQL](https://awesome-prometheus-alerts.grep.to/rules#mysql)
- [PostgreSQL](https://awesome-prometheus-alerts.grep.to/rules#postgresql) - [PostgreSQL](https://awesome-prometheus-alerts.grep.to/rules#postgresql)
- [PGBouncer](https://awesome-prometheus-alerts.grep.to/rules#pgbouncer)
- [Redis](https://awesome-prometheus-alerts.grep.to/rules#redis) - [Redis](https://awesome-prometheus-alerts.grep.to/rules#redis)
- [MongoDB](https://awesome-prometheus-alerts.grep.to/rules#mongodb) - [MongoDB](https://awesome-prometheus-alerts.grep.to/rules#mongodb)
- [RabbitMQ](https://awesome-prometheus-alerts.grep.to/rules#rabbitmq)
- [Elasticsearch](https://awesome-prometheus-alerts.grep.to/rules#elasticsearch) - [Elasticsearch](https://awesome-prometheus-alerts.grep.to/rules#elasticsearch)
- [Cassandra](https://awesome-prometheus-alerts.grep.to/rules#cassandra) - [Cassandra](https://awesome-prometheus-alerts.grep.to/rules#cassandra)
- [Zookeeper](https://awesome-prometheus-alerts.grep.to/rules#zookeeper)
- [Kafka](https://awesome-prometheus-alerts.grep.to/rules#kafka)
#### Reverse proxies and load balancers
- [Nginx](https://awesome-prometheus-alerts.grep.to/rules#nginx) - [Nginx](https://awesome-prometheus-alerts.grep.to/rules#nginx)
- [Apache](https://awesome-prometheus-alerts.grep.to/rules#apache) - [Apache](https://awesome-prometheus-alerts.grep.to/rules#apache)
- [HaProxy](https://awesome-prometheus-alerts.grep.to/rules#haproxy) - [HaProxy](https://awesome-prometheus-alerts.grep.to/rules#haproxy)
- [Traefik](https://awesome-prometheus-alerts.grep.to/rules#traefik) - [Traefik](https://awesome-prometheus-alerts.grep.to/rules#traefik)
#### Runtimes
- [PHP-FPM](https://awesome-prometheus-alerts.grep.to/rules#php-fpm) - [PHP-FPM](https://awesome-prometheus-alerts.grep.to/rules#php-fpm)
- [JVM](https://awesome-prometheus-alerts.grep.to/rules#jvm) - [JVM](https://awesome-prometheus-alerts.grep.to/rules#jvm)
- [ZFS](https://awesome-prometheus-alerts.grep.to/rules#zfs) - [Sidekiq](https://awesome-prometheus-alerts.grep.to/rules#sidekiq)
#### Orchestrators
- [Kubernetes](https://awesome-prometheus-alerts.grep.to/rules#kubernetes) - [Kubernetes](https://awesome-prometheus-alerts.grep.to/rules#kubernetes)
- [Nomad](https://awesome-prometheus-alerts.grep.to/rules#nomad) - [Nomad](https://awesome-prometheus-alerts.grep.to/rules#nomad)
- [Consul](https://awesome-prometheus-alerts.grep.to/rules#consul) - [Consul](https://awesome-prometheus-alerts.grep.to/rules#consul)
- [Etcd](https://awesome-prometheus-alerts.grep.to/rules#etcd) - [Etcd](https://awesome-prometheus-alerts.grep.to/rules#etcd)
- [Zookeeper](https://awesome-prometheus-alerts.grep.to/rules#zookeeper)
- [Kafka](https://awesome-prometheus-alerts.grep.to/rules#kafka)
- [Linkerd](https://awesome-prometheus-alerts.grep.to/rules#linkerd) - [Linkerd](https://awesome-prometheus-alerts.grep.to/rules#linkerd)
- [Istio](https://awesome-prometheus-alerts.grep.to/rules#istio) - [Istio](https://awesome-prometheus-alerts.grep.to/rules#istio)
- [Blackbox](https://awesome-prometheus-alerts.grep.to/rules#blackbox)
- [Windows](https://awesome-prometheus-alerts.grep.to/rules#windows-server) #### Network and storage
- [Juniper](https://awesome-prometheus-alerts.grep.to/rules#juniper)
- [ZFS](https://awesome-prometheus-alerts.grep.to/rules#zfs)
- [OpenEBS](https://awesome-prometheus-alerts.grep.to/rules#openebs) - [OpenEBS](https://awesome-prometheus-alerts.grep.to/rules#openebs)
- [Minio](https://awesome-prometheus-alerts.grep.to/rules#minio) - [Minio](https://awesome-prometheus-alerts.grep.to/rules#minio)
- [Juniper](https://awesome-prometheus-alerts.grep.to/rules#juniper) - [Juniper](https://awesome-prometheus-alerts.grep.to/rules#juniper)
- [CoreDNS](https://awesome-prometheus-alerts.grep.to/rules#coredns) - [CoreDNS](https://awesome-prometheus-alerts.grep.to/rules#coredns)
#### Other
- [Thanos](https://awesome-prometheus-alerts.grep.to/rules#thanos)
## 🤝 Contributing ## 🤝 Contributing
Contributions from community (you!) are most welcome! Contributions from community (you!) are most welcome!
@ -66,6 +87,10 @@ Give a ⭐️ if this project helped you!
[![support us](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/samber) [![support us](https://c5.patreon.com/external/logo/become_a_patron_button.png)](https://www.patreon.com/samber)
## 👏 Thanks
Gratitude for the Gitlab operation team that provided 50+ rules. \o/
## 📝 License ## 📝 License
[![CC4](https://mirrors.creativecommons.org/presskit/cc.srr.primary.svg)](https://creativecommons.org/licenses/by/4.0/legalcode) [![CC4](https://mirrors.creativecommons.org/presskit/cc.srr.primary.svg)](https://creativecommons.org/licenses/by/4.0/legalcode)

File diff suppressed because it is too large Load diff

View file

@ -24,11 +24,27 @@
</h2> </h2>
<ul> <ul>
{% for service in site.data.rules.services %} {% for group in site.data.rules.groups %}
<li> <li style="margin-top: 30px;">
<a href="/rules#{{ service.name | replace: " ", "-" | downcase }}"> {% assign nbrRules = 0 %}
{{ service.name }} {% for service in group.services %}
</a> {% for exporter in service.exporters %}
{% for rule in exporter.rules %}
{% assign nbrRules = nbrRules | plus: 1 %}
{% endfor %}
{% endfor %}
{% endfor %}
<h3>{{ group.name }} <small style="margin-left: 20px;">({{ nbrRules }} rules)</small></h3>
<ul>
{% for service in group.services %}
<li>
<a href="/rules#{{ service.name | replace: " ", "-" | downcase }}">
{{ service.name }}
</a>
</li>
{% endfor %}
</ul>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>

133
rules.md
View file

@ -19,78 +19,83 @@
<br> <br>
<br> <br>
<h1></h1>
<ul> <ul>
{% for service in site.data.rules.services %} {% for group in site.data.rules.groups %}
{% assign serviceIndex = forloop.index %} {% for service in group.services %}
{% for exporter in service.exporters %} {% assign serviceIndex = forloop.index %}
{% assign nbrRules = exporter.rules | size %} {% for exporter in service.exporters %}
<li> {% assign nbrRules = exporter.rules | size %}
<h2 id="{{ service.name | replace: " ", "-" | downcase }}"> <li>
{{ serviceIndex }}. <h2 id="{{ service.name | replace: " ", "-" | downcase }}">
{{ service.name }} {{ serviceIndex }}.
{% if exporter.name %} {{ service.name }}
: {% if exporter.name %}:
{% if exporter.doc_url %} {% if exporter.doc_url %}
<a href="{{ exporter.doc_url }}"> <a href="{{ exporter.doc_url }}">
{{ exporter.name }}
</a>
{% else %}
{{ exporter.name }} {{ exporter.name }}
</a> {% endif %}
{% else %} {% endif %}
{{ exporter.name }}
{% endif %} {% if nbrRules > 0 %}
<small style="font-size: 60%; vertical-align: middle; margin-left: 10px;">
({{ nbrRules }} rules)
</small>
<span class="clipboard-multiple" data-clipboard-target-id="service-{{ serviceIndex }}">[copy all]</span>
{% endif %}
</h2>
{% if nbrRules == 0 %}
{% highlight javascript %}
// @TODO: Please contribute => https://github.com/samber/awesome-prometheus-alerts 👋
{% endhighlight %}
{% endif %} {% endif %}
{% if nbrRules > 0 %} <ul>
<span class="clipboard-multiple" data-clipboard-target-id="service-{{ serviceIndex }}">[copy all]</span> {% for rule in exporter.rules %}
{% endif %} {% assign ruleIndex = forloop.index %}
</h2> {% assign comments = rule.comments | strip | newline_to_br | split: '<br />' %}
<li>
<h4>
{{ serviceIndex }}.{{ ruleIndex }}.
{{ rule.name }}
</h4>
<details id="service-{{ serviceIndex }}-rule-{{ ruleIndex }}" {% if true || (serviceIndex == 1 && ruleIndex == 1) %} open {% endif %}>
<summary>
{{ rule.description }}
<span class="clipboard-single" data-clipboard-target-id="service-{{ serviceIndex }}-rule-{{ ruleIndex }}" onclick="event.preventDefault();">[copy]</span>
</summary>
<p>
{% assign ruleName = rule.name | split: ' ' %}
{% capture ruleNameCamelcase %}{% for word in ruleName %}{{ word | capitalize }} {% endfor %}{% endcapture %}
{% if nbrRules == 0 %} {% highlight yaml %}
{% highlight javascript %} {% for comment in comments %}# {{ comment | strip }}
// @TODO: Please contribute => https://github.com/samber/awesome-prometheus-alerts 👋 {% endfor %}- alert: {{ ruleNameCamelcase | remove: ' ' }}
{% endhighlight %} expr: {{ rule.query }}
{% endif %} for: 5m
labels:
<ul> severity: {{ rule.severity }}
{% for rule in exporter.rules %} annotations:
{% assign ruleIndex = forloop.index %} summary: "{{ rule.name }} (instance {% raw %}{{ $labels.instance }}{% endraw %})"
{% assign comments = rule.comments | strip | newline_to_br | split: '<br />' %} description: "{{ rule.description }}\n VALUE = {% raw %}{{ $value }}{% endraw %}\n LABELS: {% raw %}{{ $labels }}{% endraw %}"
<li>
<h4>
{{ serviceIndex }}.{{ ruleIndex }}.
{{ rule.name }}
</h4>
<details id="service-{{ serviceIndex }}-rule-{{ ruleIndex }}" {% if true || (serviceIndex == 1 && ruleIndex == 1) %} open {% endif %}>
<summary>
{{ rule.description }}
<span class="clipboard-single" data-clipboard-target-id="service-{{ serviceIndex }}-rule-{{ ruleIndex }}" onclick="event.preventDefault();">[copy]</span>
</summary>
<p>
{% assign ruleName = rule.name | split: ' ' %}
{% 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
labels:
severity: {{ rule.severity }}
annotations:
summary: "{{ rule.name }} (instance {% raw %}{{ $labels.instance }}{% endraw %})"
description: "{{ rule.description }}\n VALUE = {% raw %}{{ $value }}{% endraw %}\n LABELS: {% raw %}{{ $labels }}{% endraw %}"
{% endhighlight %} {% endhighlight %}
</p> </p>
</details> </details>
<br/> <br/>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
<hr/> <hr/>
</li> </li>
{% endfor %} {% endfor %}
{% endfor %}
{% endfor %} {% endfor %}
</ul> </ul>