X-Git-Url: https://gerrit.mcp.mirantis.com/gitweb?p=salt-formulas%2Felasticsearch.git;a=blobdiff_plain;f=elasticsearch%2Fmeta%2Fprometheus.yml;h=f0aa983b0d997c2ef7bbf3498220598f7a9edcab;hp=464111d1feb7d32f57ffe58f84a08944b1222af3;hb=29fb4553518f6471f322f0704d5c5fd23375afe0;hpb=85c27aa47cd904d8b487a169d0e56b4c268b9259 diff --git a/elasticsearch/meta/prometheus.yml b/elasticsearch/meta/prometheus.yml index 464111d..f0aa983 100644 --- a/elasticsearch/meta/prometheus.yml +++ b/elasticsearch/meta/prometheus.yml @@ -1,19 +1,13 @@ -{%- if pillar.elasticsearch.server is defined %} -{% raw %} +{%- if pillar.elasticsearch.server is defined or pillar.elasticsearch.client is defined %} +{%- from "elasticsearch/map.jinja" import server, client with context %} + server: alert: - ElasticsearchDown: - if: >- - elasticsearch_up != 1 - labels: - severity: warning - service: elasticsearch - annotations: - summary: 'Elasticsearch service down' - description: 'Elasticsearch service is down on node {{ $labels.host }}' +{%- if client.get('enabled', False) %} +{%- raw %} ElasticsearchClusterHealthStatusYellow: if: >- - max_over_time(elasticsearch_cluster_health_status[5m]) == 2 + elasticsearch_cluster_health_status == 2 labels: severity: warning service: elasticsearch @@ -23,7 +17,7 @@ server: The Elasticsearch cluster status is YELLOW for the last 5 minutes. ElasticsearchClusterHealthStatusRed: if: >- - max_over_time(elasticsearch_cluster_health_status[5m]) == 3 + elasticsearch_cluster_health_status == 3 labels: severity: critical service: elasticsearch @@ -31,6 +25,19 @@ server: summary: 'Elasticsearch cluster status is RED' description: >- The Elasticsearch cluster status is RED for the last 5 minutes. +{%- endraw %} +{%- endif %} +{%- if server.get('enabled', False) %} +{%- raw %} + ElasticsearchDown: + if: >- + elasticsearch_up{host=~'.*'} != 1 + labels: + severity: warning + service: elasticsearch + annotations: + summary: 'Elasticsearch service down' + description: 'Elasticsearch service is down on node {{ $labels.host }}' ElasticsearchClusterDiskLowWaterMark: if: >- (max(elasticsearch_fs_total_total_in_bytes) by (host, instance) - max(elasticsearch_fs_total_available_in_bytes) by (host, instance)) / max(elasticsearch_fs_total_total_in_bytes) by (host, instance) * 100.0 >= 85 @@ -54,5 +61,6 @@ server: labels: severity: critical service: elasticsearch -{% endraw %} +{%- endraw %} +{%- endif %} {%- endif %}