Added new container for prometheus to gainsight

Change-Id: I28c88a10537a2b4aee235501b3854e52a10c7ab8
Related-Bug: PROD-19567
This commit is contained in:
Mateusz Matuszkowiak 2018-06-14 20:24:29 +02:00
parent d257cdbfe2
commit 520c9c6ebf
4 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,8 @@
applications:
- prometheus
parameters:
prometheus:
gainsight:
enabled: true
dir:
config: /srv/volumes/local/gainsight

View file

@ -0,0 +1,5 @@
{% from "prometheus/map.jinja" import gainsight with context %}
[Queries]
{%- for query,value in gainsight.queries.iteritems() %}
{{ query }}={{ value }}
{%- endfor %}

18
prometheus/gainsight.sls Normal file
View file

@ -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 %}

View file

@ -49,3 +49,10 @@
}, },
}, merge=salt['pillar.get']('prometheus:alerta')) %}} }, merge=salt['pillar.get']('prometheus:alerta')) %}}
{% set gainsight = salt['grains.filter_by']({
'default': {
'queries': {
}
}
}, merge=salt['pillar.get']('prometheus:gainsight')) %}}