Merge "Add alerts and targets for prometheus LTS and relay"
diff --git a/metadata/service/gainsight/container.yml b/metadata/service/gainsight/container.yml
new file mode 100644
index 0000000..d59e0ad
--- /dev/null
+++ b/metadata/service/gainsight/container.yml
@@ -0,0 +1,8 @@
+applications:
+  - prometheus
+parameters:
+  prometheus:
+    gainsight:
+      enabled: true
+      dir:
+        config: /srv/volumes/local/gainsight
diff --git a/prometheus/files/alerta/alerta.conf b/prometheus/files/alerta/alerta.conf
index 12eb2cc..31b0b49 100644
--- a/prometheus/files/alerta/alerta.conf
+++ b/prometheus/files/alerta/alerta.conf
@@ -10,7 +10,7 @@
         'critical'     : '{{ alerta.get("colors", {}).get("critical", "#D8122A") }}',
         'major'        : '{{ alerta.get("colors", {}).get("major", "#EA680F") }}',
         'minor'        : '{{ alerta.get("colors", {}).get("minor", "#FFBE1E") }}',
-        'warning'      : '{{ alerta.get("colors", {}).get("warning", "#BA2222") }}',
+        'warning'      : '{{ alerta.get("colors", {}).get("warning", "#1E90FF") }}',
         'indeterminate': '{{ alerta.get("colors", {}).get("indeterminate", "#A6ACA8") }}',
         'cleared'      : '{{ alerta.get("colors", {}).get("cleared", "#00AA5A") }}',
         'normal'       : '{{ alerta.get("colors", {}).get("normal", "#00AA5A") }}',
diff --git a/prometheus/files/gainsight.yml b/prometheus/files/gainsight.yml
new file mode 100644
index 0000000..5e8330b
--- /dev/null
+++ b/prometheus/files/gainsight.yml
@@ -0,0 +1,5 @@
+{% from "prometheus/map.jinja" import gainsight with context %}
+[Queries]
+{%- for query,value in gainsight.queries.iteritems() %}
+{{ query }}={{ value }}
+{%- endfor %}
diff --git a/prometheus/gainsight.sls b/prometheus/gainsight.sls
new file mode 100644
index 0000000..e5c26eb
--- /dev/null
+++ b/prometheus/gainsight.sls
@@ -0,0 +1,18 @@
+{% from "prometheus/map.jinja" import gainsight with context %}
+{%- if gainsight.enabled %}
+
+{%- if pillar.docker is defined and pillar.docker.host is defined %}
+
+{{gainsight.dir.config}}:
+  file.directory:
+    - makedirs: True
+
+{{gainsight.dir.config}}/config.ini:
+  file.managed:
+  - source: salt://prometheus/files/gainsight.yml
+  - template: jinja
+  - require:
+    - file: {{gainsight.dir.config}}
+
+{%- endif %}
+{%- endif %}
diff --git a/prometheus/map.jinja b/prometheus/map.jinja
index 4df2a85..e8cc0e1 100644
--- a/prometheus/map.jinja
+++ b/prometheus/map.jinja
@@ -49,3 +49,10 @@
   },
 }, merge=salt['pillar.get']('prometheus:alerta')) %}}
 
+{% set gainsight = salt['grains.filter_by']({
+  'default': {
+    'queries': {
+    }
+  }
+}, merge=salt['pillar.get']('prometheus:gainsight')) %}}
+