Add Prometheus exporters
Change-Id: I71538bc6b39edaa6a0856c8bba9de11b88cec67a
This commit is contained in:
parent
ba40adbc35
commit
e8c7be754f
5 changed files with 48 additions and 1 deletions
13
metadata/service/exporters/jmx.yml
Normal file
13
metadata/service/exporters/jmx.yml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
applications:
|
||||||
|
- prometheus
|
||||||
|
parameters:
|
||||||
|
_param:
|
||||||
|
prometheus_exporter_jmx_port: 9111
|
||||||
|
prometheus:
|
||||||
|
exporters:
|
||||||
|
jmx:
|
||||||
|
enabled: true
|
||||||
|
packages:
|
||||||
|
- jmx-exporter
|
||||||
|
bind:
|
||||||
|
port: ${_param:prometheus_exporter_jmx_port}
|
14
metadata/service/exporters/libvirt.yml
Normal file
14
metadata/service/exporters/libvirt.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
applications:
|
||||||
|
- prometheus
|
||||||
|
parameters:
|
||||||
|
_param:
|
||||||
|
prometheus_exporter_libvirt_port: 9177
|
||||||
|
prometheus:
|
||||||
|
exporters:
|
||||||
|
libvirt:
|
||||||
|
enabled: true
|
||||||
|
packages:
|
||||||
|
- libvirt-exporter
|
||||||
|
bind:
|
||||||
|
address: 0.0.0.0
|
||||||
|
port: ${_param:prometheus_exporter_libvirt_port}
|
11
prometheus/exporters.sls
Normal file
11
prometheus/exporters.sls
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{% from "prometheus/map.jinja" import exporters with context %}
|
||||||
|
|
||||||
|
{%- for exporter, parameters in exporters.iteritems() %}
|
||||||
|
{%- if parameters.get('enabled', False) %}
|
||||||
|
{%- if parameters.get('packages', False) %}
|
||||||
|
{{ exporter }}_exporter_packages:
|
||||||
|
pkg.installed:
|
||||||
|
- names: {{ parameters.packages }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endfor %}
|
|
@ -1,5 +1,6 @@
|
||||||
{%- if pillar.prometheus.server is defined or
|
{%- if pillar.prometheus.server is defined or
|
||||||
pillar.prometheus.alertmanager is defined %}
|
pillar.prometheus.alertmanager is defined or
|
||||||
|
pillar.prometheus.exporters is defined %}
|
||||||
include:
|
include:
|
||||||
{%- if pillar.prometheus.server is defined %}
|
{%- if pillar.prometheus.server is defined %}
|
||||||
- prometheus.server
|
- prometheus.server
|
||||||
|
@ -7,4 +8,7 @@ include:
|
||||||
{%- if pillar.prometheus.alertmanager is defined %}
|
{%- if pillar.prometheus.alertmanager is defined %}
|
||||||
- prometheus.alertmanager
|
- prometheus.alertmanager
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
{%- if pillar.prometheus.exporters is defined %}
|
||||||
|
- prometheus.exporters
|
||||||
|
{%- endif %}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -7,3 +7,8 @@
|
||||||
'default': {
|
'default': {
|
||||||
},
|
},
|
||||||
}, merge=salt['pillar.get']('prometheus:alertmanager')) %}
|
}, merge=salt['pillar.get']('prometheus:alertmanager')) %}
|
||||||
|
|
||||||
|
{% set exporters = salt['grains.filter_by']({
|
||||||
|
'default': {
|
||||||
|
},
|
||||||
|
}, merge=salt['pillar.get']('prometheus:exporters')) %}
|
||||||
|
|
Loading…
Reference in a new issue