Merge "Fix warning color"
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/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')) %}}
+