From 5ff7bab46b3cd2cf5b585318a35030d5ed9fc459 Mon Sep 17 00:00:00 2001 From: Dincer Celik Date: Wed, 18 Sep 2019 10:58:38 +0300 Subject: [PATCH] [prometheus] Added support for extra options This change introduces the way to pass extra options to prometheus. Currently, prometheus runs with nearly default options, and when clouds start getting bigger, you need to pass extra parameters to prometheus. Change-Id: Ic773c0b73062cf3b2285343bafb25d5923911834 --- ansible/group_vars/all.yml | 2 ++ ansible/roles/prometheus/templates/prometheus-server.json.j2 | 2 +- etc/kolla/globals.yml | 3 +++ .../notes/prometheus-cmdline-extras-2e680c8697c1a308.yaml | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/prometheus-cmdline-extras-2e680c8697c1a308.yaml diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 009b5881e2..06add8995d 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -1066,9 +1066,11 @@ enable_prometheus_ceph_mgr_exporter: "{{ enable_ceph | bool and enable_prometheu enable_prometheus_openstack_exporter: "{{ enable_prometheus | bool }}" enable_prometheus_elasticsearch_exporter: "{{ enable_prometheus | bool and enable_elasticsearch | bool }}" enable_prometheus_blackbox_exporter: "{{ enable_prometheus | bool }}" + prometheus_alertmanager_user: "admin" prometheus_openstack_exporter_interval: "60s" prometheus_elasticsearch_exporter_interval: "60s" +prometheus_cmdline_extras: ############ # Vitrage diff --git a/ansible/roles/prometheus/templates/prometheus-server.json.j2 b/ansible/roles/prometheus/templates/prometheus-server.json.j2 index 990185c7d5..3849cf9611 100644 --- a/ansible/roles/prometheus/templates/prometheus-server.json.j2 +++ b/ansible/roles/prometheus/templates/prometheus-server.json.j2 @@ -1,5 +1,5 @@ { - "command": "/opt/prometheus/prometheus -config.file /etc/prometheus/prometheus.yml -web.listen-address {{ api_interface_address }}:{{ prometheus_port }} -web.external-url={{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ prometheus_port }} -log.format logger:stdout -storage.local.path /var/lib/prometheus", + "command": "/opt/prometheus/prometheus -config.file /etc/prometheus/prometheus.yml -web.listen-address {{ api_interface_address }}:{{ prometheus_port }} -web.external-url={{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ prometheus_port }} -log.format logger:stdout -storage.local.path /var/lib/prometheus{% if prometheus_cmdline_extras %} {{ prometheus_cmdline_extras }}{% endif %}", "config_files": [ { "source": "{{ container_config_directory }}/prometheus.yml", diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index f35b6f76f4..07c68061b6 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -598,6 +598,9 @@ #enable_prometheus_elasticsearch_exporter: "{{ enable_prometheus | bool and enable_elasticsearch | bool }}" #enable_prometheus_blackbox_exporter: "{{ enable_prometheus | bool }}" +# List of extra parameters passed to prometheus. You can add as many to the list. +#prometheus_cmdline_extras: + ######### # Freezer ######### diff --git a/releasenotes/notes/prometheus-cmdline-extras-2e680c8697c1a308.yaml b/releasenotes/notes/prometheus-cmdline-extras-2e680c8697c1a308.yaml new file mode 100644 index 0000000000..51819d8121 --- /dev/null +++ b/releasenotes/notes/prometheus-cmdline-extras-2e680c8697c1a308.yaml @@ -0,0 +1,3 @@ +--- +features: + - Adds support for passing extra options to Prometheus.