mirror of
https://github.com/rfmoz/grafana-dashboards.git
synced 2025-03-05 20:51:45 -08:00
Add alerts to apache mixin
This commit is contained in:
parent
7de51eeedd
commit
321e3f3df4
52
prometheus/apache-http-mixin/alerts/alerts.libsonnet
Normal file
52
prometheus/apache-http-mixin/alerts/alerts.libsonnet
Normal file
|
@ -0,0 +1,52 @@
|
|||
{
|
||||
prometheusAlerts+:: {
|
||||
groups+: [
|
||||
{
|
||||
name: 'apache-http-alerts',
|
||||
rules: [
|
||||
{
|
||||
alert: 'ApacheDown',
|
||||
expr: 'apache_up == 0',
|
||||
labels: {
|
||||
severity: 'warning',
|
||||
},
|
||||
annotations: {
|
||||
summary: 'Apache is down.',
|
||||
description: 'Apache is down on {{ $labels.instance }}.',
|
||||
},
|
||||
'for': '5m',
|
||||
},
|
||||
{
|
||||
alert: 'ApacheRestart',
|
||||
expr: 'apache_uptime_seconds_total / 60 < 1',
|
||||
labels: {
|
||||
severity: 'info',
|
||||
},
|
||||
annotations: {
|
||||
summary: 'Apache restart.',
|
||||
description: 'Apache has just been restarted.',
|
||||
},
|
||||
'for': '0',
|
||||
},
|
||||
{
|
||||
alert: 'ApacheWorkersLoad',
|
||||
expr: |||
|
||||
(sum by (instance) (apache_workers{state="busy"}) / sum by (instance) (apache_scoreboard) ) * 100 > %(alertsWarningWorkersBusy)s
|
||||
||| % $._config,
|
||||
'for': '15m',
|
||||
labels: {
|
||||
severity: 'warning',
|
||||
},
|
||||
annotations: {
|
||||
summary: 'Apache workers load is too high.',
|
||||
description: |||
|
||||
Apache workers in busy state approach the max workers count %(alertsWarningWorkersBusy)s%% workers busy on {{ $labels.instance }}.
|
||||
The currect value is {{ $value }}%%.
|
||||
||| % $._config,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
|
@ -4,5 +4,8 @@
|
|||
dashboardPeriod: 'now-1h',
|
||||
dashboardTimezone: 'default',
|
||||
dashboardRefresh: '1m',
|
||||
|
||||
// for alerts
|
||||
alertsWarningWorkersBusy: '80', // %
|
||||
},
|
||||
}
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
(import 'dashboards/apache-exporter-full.libsonnet') +
|
||||
// (import 'alerts/alerts.libsonnet') +
|
||||
(import 'alerts/alerts.libsonnet') +
|
||||
(import 'config.libsonnet')
|
||||
|
|
Loading…
Reference in a new issue