mirror of
https://github.com/samber/awesome-prometheus-alerts.git
synced 2026-06-25 02:46:59 +08:00
moving prom config to alertmanager page
This commit is contained in:
parent
6408af5ba3
commit
189a3129c3
2 changed files with 41 additions and 37 deletions
|
|
@ -1,3 +1,39 @@
|
||||||
|
<h2>
|
||||||
|
Prometheus configuration
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
{% highlight yaml %}
|
||||||
|
# prometheus.yml
|
||||||
|
|
||||||
|
global:
|
||||||
|
scrape_interval: 15s
|
||||||
|
...
|
||||||
|
|
||||||
|
rule_files:
|
||||||
|
- 'alerts/*.yml'
|
||||||
|
|
||||||
|
scrape_configs:
|
||||||
|
...
|
||||||
|
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
|
{% highlight yaml %}
|
||||||
|
# alerts/example-redis.yml
|
||||||
|
|
||||||
|
groups:
|
||||||
|
|
||||||
|
- name: ExampleRedisGroup
|
||||||
|
rules:
|
||||||
|
- alert: ExampleRedisDown
|
||||||
|
expr: redis_up{} == 0
|
||||||
|
for: 2m
|
||||||
|
labels:
|
||||||
|
severity: error
|
||||||
|
annotations:
|
||||||
|
summary: "Redis instance down"
|
||||||
|
description: "Whatever"
|
||||||
|
|
||||||
|
{% endhighlight %}
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
AlertManager configuration
|
AlertManager configuration
|
||||||
|
|
@ -51,7 +87,7 @@ receivers:
|
||||||
|
|
||||||
- name: "sms"
|
- name: "sms"
|
||||||
webhook_config:
|
webhook_config:
|
||||||
- url: http://a.b.c:8080/send/sms
|
- url: http://a.b.c.d:8080/send/sms
|
||||||
send_resolved: true
|
send_resolved: true
|
||||||
|
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
|
||||||
40
rules.md
40
rules.md
|
|
@ -10,46 +10,14 @@
|
||||||
<p style="text-align:center;">
|
<p style="text-align:center;">
|
||||||
Alert thresholds depend on nature of applications.
|
Alert thresholds depend on nature of applications.
|
||||||
<br>
|
<br>
|
||||||
Some queries may have arbitrary tolerance threshold.
|
Some queries in this page may have arbitrary tolerance threshold.
|
||||||
<br><br>
|
<br><br>
|
||||||
Building an efficient an battle-tested monitoring platform takes time. 😉
|
Building an efficient and battle-tested monitoring platform takes time. 😉
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>0. Prometheus global configuration</h2>
|
<br>
|
||||||
|
<br>
|
||||||
{% highlight yaml %}
|
|
||||||
# prometheus.yml
|
|
||||||
|
|
||||||
global:
|
|
||||||
scrape_interval: 15s
|
|
||||||
...
|
|
||||||
|
|
||||||
rule_files:
|
|
||||||
- 'alerts/*.yml'
|
|
||||||
|
|
||||||
scrape_configs:
|
|
||||||
...
|
|
||||||
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
{% highlight yaml %}
|
|
||||||
# alerts/example-redis.yml
|
|
||||||
|
|
||||||
groups:
|
|
||||||
|
|
||||||
- name: ExampleRedisGroup
|
|
||||||
rules:
|
|
||||||
- alert: ExampleRedisDown
|
|
||||||
expr: redis_up{} == 0
|
|
||||||
for: 2m
|
|
||||||
labels:
|
|
||||||
severity: error
|
|
||||||
annotations:
|
|
||||||
summary: "Redis instance ($instance) down"
|
|
||||||
description: "Whatever"
|
|
||||||
|
|
||||||
{% endhighlight %}
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{% for service in site.data.rules.services %}
|
{% for service in site.data.rules.services %}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue