Browse Source

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
tags/8.0.0.0b1
Kien Nguyen 5 months ago
parent
commit
835368524e

+ 5
- 0
ansible/group_vars/all.yml View File

@@ -910,3 +910,8 @@ enable_prometheus_cadvisor: "{{ enable_prometheus | bool }}"
910 910
 enable_prometheus_alertmanager: "{{ enable_prometheus | bool }}"
911 911
 enable_prometheus_ceph_mgr_exporter: "{{ enable_ceph | bool and enable_prometheus | bool }}"
912 912
 prometheus_alertmanager_user: "admin"
913
+
914
+############
915
+# Vitrage
916
+############
917
+enable_vitrage_prometheus_datasource: "{{ enable_prometheus | bool }}"

+ 9
- 0
ansible/roles/prometheus/templates/prometheus-alertmanager.yml.j2 View File

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

+ 2
- 0
ansible/roles/vitrage/defaults/main.yml View File

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

+ 3
- 0
ansible/roles/vitrage/templates/wsgi-vitrage.conf.j2 View File

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

+ 4
- 0
releasenotes/notes/add-prometheus-as-vitrage-datasource-3439b3f9925b8e8e.yaml View File

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

Loading…
Cancel
Save