2017-07-25 10:11:43 -04:00
|
|
|
{%- if pillar.prometheus is defined %}
|
2017-09-25 06:52:58 -04:00
|
|
|
{%- from "prometheus/map.jinja" import server, alertmanager, remote_storage_adapter, monitoring with context %}
|
2017-04-11 06:17:08 -04:00
|
|
|
server:
|
|
|
|
alert:
|
2017-07-25 10:11:43 -04:00
|
|
|
{%- if server.get('enabled', False) %}
|
|
|
|
{% raw %}
|
2017-07-24 09:38:28 -04:00
|
|
|
PrometheusTargetDown:
|
2017-04-11 09:34:25 -04:00
|
|
|
if: 'up != 1'
|
2017-09-12 09:14:21 -04:00
|
|
|
for: 2m
|
2017-04-11 06:17:08 -04:00
|
|
|
labels:
|
|
|
|
severity: critical
|
|
|
|
service: prometheus
|
|
|
|
annotations:
|
2017-09-12 09:14:21 -04:00
|
|
|
summary: 'Prometheus endpoint {{ $labels.instance }} down'
|
|
|
|
description: 'The Prometheus target {{ $labels.instance }} is down for the job {{ $labels.job }}.'
|
2017-09-25 06:52:58 -04:00
|
|
|
PrometheusRushMode:
|
|
|
|
if: 'prometheus_local_storage_rushed_mode != 0'
|
|
|
|
for: 10m
|
|
|
|
labels:
|
|
|
|
severity: warning
|
|
|
|
service: prometheus
|
|
|
|
annotations:
|
|
|
|
summary: 'Prometheus {{ $labels.instance }} in rush mode'
|
|
|
|
description: 'The Prometheus {{ $labels.instance }} is in rush mode for 10m.'
|
2017-04-11 06:17:08 -04:00
|
|
|
{% endraw %}
|
2017-07-25 10:11:43 -04:00
|
|
|
{%- endif %}
|
2017-09-25 06:52:58 -04:00
|
|
|
{%- if alertmanager.get('enabled', False) %}
|
|
|
|
AlertmanagerNotificationFailed:
|
|
|
|
{%- set threshold = monitoring.alertmanager.notification_failed_rate|float %}
|
|
|
|
if: >-
|
|
|
|
rate(alertmanager_notifications_failed_total[5m]) > {{ threshold }}
|
|
|
|
for: 2m
|
|
|
|
{%- raw %}
|
|
|
|
labels:
|
|
|
|
severity: warning
|
|
|
|
service: alertmanager
|
|
|
|
annotations:
|
|
|
|
summary: 'Alertmanager {{ $labels.instance }} failed notifications'
|
|
|
|
description: 'Alertmanager {{ $labels.instance }} failed notifications for {{ $labels.integration }} (current value={{ $value }}, threshold={%- endraw %}{{ threshold }})'
|
|
|
|
{%- endif %}
|
|
|
|
{%- if server.get('config', {}).get('remote_write') %}
|
|
|
|
PrometheusRemoteStorageQueue:
|
|
|
|
{%- set threshold = monitoring.prometheus.remote_storage_queue_full_percent|float %}
|
|
|
|
if: >-
|
|
|
|
prometheus_remote_storage_queue_length / prometheus_remote_storage_queue_capacity * 100 > {{ threshold }}
|
|
|
|
{%- raw %}
|
|
|
|
for: 2m
|
|
|
|
labels:
|
|
|
|
severity: warning
|
|
|
|
service: prometheus
|
|
|
|
annotations:
|
|
|
|
summary: 'Prometheus {{ $labels.instance }} remote storage queue is filling'
|
|
|
|
description: 'The Prometheus {{ $labels.instance }} remote storage queue almost full (current value={{ $value }}%, threshold={%- endraw %}{{ threshold }}%)'
|
|
|
|
{%- endif %}
|
2017-07-25 10:11:43 -04:00
|
|
|
{%- if remote_storage_adapter.get('enabled', False) %}
|
|
|
|
RemoteStorageAdapterSendingTooSlow:
|
|
|
|
{%- set threshold = monitoring.remote_storage_adapter.sent_vs_received_ratio|float %}
|
|
|
|
if: >-
|
|
|
|
100.0 - (100.0 * sent_samples_total{job="remote_storage_adapter"} / on (job, instance) received_samples_total) > {{ threshold }}
|
|
|
|
{% raw %}
|
|
|
|
labels:
|
|
|
|
severity: warning
|
|
|
|
service: remote_storage_adapter
|
|
|
|
annotations:
|
|
|
|
summary: 'Remote storage adapter too slow on {{ $labels.instance }}'
|
|
|
|
description: 'Remote storage adapter can not ingest samples fast enough on {{ $labels.instance }} (current value={{ $value }}%, threshold={%- endraw %}{{ threshold }}%).'
|
|
|
|
RemoteStorageAdapterIgnoredTooHigh:
|
|
|
|
{%- set threshold = monitoring.remote_storage_adapter.ignored_vs_sent_ratio|float %}
|
|
|
|
if: >-
|
|
|
|
100.0 * prometheus_influxdb_ignored_samples_total{job="remote_storage_adapter"} / on (job, instance) sent_samples_total > {{ threshold }}
|
|
|
|
{% raw %}
|
|
|
|
labels:
|
|
|
|
severity: warning
|
|
|
|
service: remote_storage_adapter
|
|
|
|
annotations:
|
|
|
|
summary: 'Remote storage adapter receiving too many invalid metrics on {{ $labels.instance }}'
|
|
|
|
description: 'Remote storage adapter is receiving too many invalid metrics on {{ $labels.instance }} (current value={{ $value }}%, threshold={%- endraw %}{{ threshold }}%).'
|
|
|
|
{%- endif %}
|
|
|
|
{%- endif %}
|