Add Prometheus as Vitrage datasource

Vitrage has already supported Prometheus as
datasource. Kolla can config it automatically,
just need a little changes, for example in
wsgi config file [1].

Co-Authored-By: Hieu LE <hieulq2@viettel.com.vn>

[1] https://review.openstack.org/#/c/584649/8/devstack/apache-vitrage.template

Change-Id: I64028a0dfd9887813b980a31c30c2c1b1046da61
This commit is contained in:
Kien Nguyen 2018-12-11 15:21:45 +07:00
parent d4dd1f0ac4
commit 835368524e
5 changed files with 23 additions and 0 deletions

View File

@ -910,3 +910,8 @@ enable_prometheus_cadvisor: "{{ enable_prometheus | bool }}"
enable_prometheus_alertmanager: "{{ enable_prometheus | bool }}" enable_prometheus_alertmanager: "{{ enable_prometheus | bool }}"
enable_prometheus_ceph_mgr_exporter: "{{ enable_ceph | bool and enable_prometheus | bool }}" enable_prometheus_ceph_mgr_exporter: "{{ enable_ceph | bool and enable_prometheus | bool }}"
prometheus_alertmanager_user: "admin" prometheus_alertmanager_user: "admin"
############
# Vitrage
############
enable_vitrage_prometheus_datasource: "{{ enable_prometheus | bool }}"

View File

@ -8,4 +8,13 @@ route:
repeat_interval: 3h repeat_interval: 3h
receivers: receivers:
- name: default-receiver - name: default-receiver
{% if enable_vitrage | bool and enable_vitrage_prometheus_datasource | bool %}
webhook_configs:
- send_resolved: true
url: '{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ vitrage_api_port }}/v1/event'
http_config:
basic_auth:
username: '{{ keystone_admin_user }}'
password: '{{ keystone_admin_password }}'
{% endif %}
templates: [] templates: []

View File

@ -152,6 +152,8 @@ vitrage_datasource:
# Document process to deploy vitrage+heat. # Document process to deploy vitrage+heat.
- name: "heat.stack" - name: "heat.stack"
enabled: "no" enabled: "no"
- name: "prometheus"
enabled: "{{ enable_vitrage_prometheus_datasource | bool }}"
vitrage_datasources: "{{ vitrage_datasource | selectattr('enabled', 'equalto', true) | list }}" vitrage_datasources: "{{ vitrage_datasource | selectattr('enabled', 'equalto', true) | list }}"

View File

@ -26,4 +26,7 @@ TraceEnable off
WSGIDaemonProcess vitrage group=vitrage processes={{ openstack_service_workers }} threads=1 user=vitrage python-path={{ python_path }} WSGIDaemonProcess vitrage group=vitrage processes={{ openstack_service_workers }} threads=1 user=vitrage python-path={{ python_path }}
WSGIProcessGroup vitrage WSGIProcessGroup vitrage
WSGIScriptAlias / "/var/www/cgi-bin/vitrage/app.wsgi" WSGIScriptAlias / "/var/www/cgi-bin/vitrage/app.wsgi"
{% if enable_vitrage_prometheus_datasource | bool %}
WSGIPassAuthorization On
{% endif %}
</VirtualHost> </VirtualHost>

View File

@ -0,0 +1,4 @@
---
features:
- |
Configure Prometheus as Vitrage datasource automatically.