Ensure 'instances_major_threshold_percent' is a number
Closes-Bug: PROD-20305
Change-Id: Ie9f7032cae0f745737728c9b89edbd8e6f3a8b4f
diff --git a/etcd/map.jinja b/etcd/map.jinja
index 1a326a6..d209956 100644
--- a/etcd/map.jinja
+++ b/etcd/map.jinja
@@ -22,6 +22,6 @@
{%- set monitoring = salt['grains.filter_by']({
'default': {
'failed_http_requests_percentage': 1,
- 'instances_major_threshold_percent': '0.3'
+ 'instances_major_threshold_percent': 0.3
},
}, grain='os_family', merge=salt['pillar.get']('etcd:monitoring')) %}
diff --git a/etcd/meta/prometheus.yml b/etcd/meta/prometheus.yml
index 2addb4c..f9a006d 100644
--- a/etcd/meta/prometheus.yml
+++ b/etcd/meta/prometheus.yml
@@ -57,7 +57,7 @@
description: "The etcd {{ $labels.instance }} instance is down for at least 2 minutes."
{%- endraw %}
EtcdServiceDownMajor:
- {%- set instances_major_threshold_percent = monitoring.instances_major_threshold_percent %}
+ {%- set instances_major_threshold_percent = monitoring.instances_major_threshold_percent|float %}
if: "count(up{job='etcd'} == 0) > count(up{job='etcd'}) * {{ monitoring.instances_major_threshold_percent }}"
{%- raw %}
for: 2m