diff --git a/ansible/roles/prometheus/defaults/main.yml b/ansible/roles/prometheus/defaults/main.yml index d1ad085299..ec0c127975 100644 --- a/ansible/roles/prometheus/defaults/main.yml +++ b/ansible/roles/prometheus/defaults/main.yml @@ -113,21 +113,13 @@ prometheus_mysql_exporter_database_user: "{% if use_preconfigured_databases | bo # For a list of modules see the alertmanager config. prometheus_blackbox_exporter_endpoints: [] -#################### -# Compatibility -#################### - -# Whether to keep using Prometheus server v1 (due to no data-preserving migration path to v2) -# NOTE(piotrp): Deprecated in Wallaby and will be removed in Xena -prometheus_use_v1: no - #################### # Docker #################### prometheus_install_type: "{{ kolla_install_type }}" prometheus_tag: "{{ openstack_tag }}" -prometheus_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ prometheus_install_type }}-{% if not prometheus_use_v1 | bool %}prometheus-v2-server{% else %}prometheus-server{% endif %}" +prometheus_server_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ prometheus_install_type }}-prometheus-v2-server" prometheus_server_tag: "{{ prometheus_tag }}" prometheus_server_image_full: "{{ prometheus_server_image }}:{{ prometheus_server_tag }}" @@ -183,7 +175,7 @@ prometheus_server_default_volumes: - "{{ node_config_directory }}/prometheus-server/:{{ container_config_directory }}/:ro" - "/etc/localtime:/etc/localtime:ro" - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}" - - "{{ 'prometheus_v2' if not prometheus_use_v1 | bool else 'prometheus' }}:/var/lib/prometheus" + - "prometheus_v2:/var/lib/prometheus" - "kolla_logs:/var/log/kolla/" prometheus_haproxy_exporter_default_volumes: - "{{ node_config_directory }}/prometheus-haproxy-exporter/:{{ container_config_directory }}/:ro" diff --git a/ansible/roles/prometheus/templates/prometheus-server.json.j2 b/ansible/roles/prometheus/templates/prometheus-server.json.j2 index 3391f70e86..d57469ff2c 100644 --- a/ansible/roles/prometheus/templates/prometheus-server.json.j2 +++ b/ansible/roles/prometheus/templates/prometheus-server.json.j2 @@ -1,9 +1,5 @@ { -{% if not prometheus_use_v1 | bool %} "command": "/opt/prometheus/prometheus --config.file /etc/prometheus/prometheus.yml --web.listen-address {{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_port }} --web.external-url={{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ prometheus_port }} --storage.tsdb.path /var/lib/prometheus{% if prometheus_cmdline_extras %} {{ prometheus_cmdline_extras }}{% endif %}", -{% else %} - "command": "/opt/prometheus/prometheus -config.file /etc/prometheus/prometheus.yml -web.listen-address {{ api_interface_address | put_address_in_context('url') }}:{{ prometheus_port }} -web.external-url={{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ prometheus_port }} -log.format logger:stdout -storage.local.path /var/lib/prometheus{% if prometheus_cmdline_extras %} {{ prometheus_cmdline_extras }}{% endif %}", -{% endif %} "config_files": [ { "source": "{{ container_config_directory }}/prometheus.yml", diff --git a/doc/source/reference/logging-and-monitoring/prometheus-guide.rst b/doc/source/reference/logging-and-monitoring/prometheus-guide.rst index e38701e8b3..aa15b52014 100644 --- a/doc/source/reference/logging-and-monitoring/prometheus-guide.rst +++ b/doc/source/reference/logging-and-monitoring/prometheus-guide.rst @@ -20,25 +20,11 @@ and change the following: enable_prometheus: "yes" -This will, by default, deploy Prometheus version 2.x. Since Prometheus 1.x data -is not compatible with Prometheus 2.x and no automatic data migration is -provided, any previous Prometheus 1.x deployment will be replaced and all its -stored metrics will become inacessible (but still available in the old data -volume: ``prometheus``; the new data volume defaults to ``prometheus_v2``). -If you rely on Prometheus only as e.g. a source of alert notifications (in pair -with Alertmanager), it might not be worth migrating old metrics and they could -be discarded. Otherwise, it's either possible to use -`remote storage `_ -or scrape Kolla's Prometheus ``/federate`` endpoint with an external system. -However, if you want to stay on 1.x series, set the following variable: - -.. code-block:: yaml - - prometheus_use_v1: yes - -.. warning:: - Support for Prometheus 1.x is deprecated and will be removed in next - Kolla Ansible release (Xena). +Note: This will deploy Prometheus version 2.x. Any potentially existing +Prometheus 1.x instances deployed by previous Kolla Ansible releases will +conflict with current version and should be manually stopped and/or removed. +If you would like to stay with version 1.x, set the ``enable_prometheus`` +variable to ``no``. In order to remove leftover volume containing Prometheus 1.x data, execute: diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 158643bd58..688a1b51e4 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -710,9 +710,6 @@ # - host1:port1 # - host2:port2 -# Whether to keep using Prometheus server v1 (due to no data-preserving migration path to v2) -#prometheus_use_v1: no - ######### # Freezer ######### diff --git a/releasenotes/notes/remove-prometheus-v1-8fa9c74c3dda568e.yaml b/releasenotes/notes/remove-prometheus-v1-8fa9c74c3dda568e.yaml new file mode 100644 index 0000000000..9b04dba85f --- /dev/null +++ b/releasenotes/notes/remove-prometheus-v1-8fa9c74c3dda568e.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + Removes support for Prometheus v1 deployment. Any previously deployed + Prometheus v1 instances will create a conflict during an upgrade thus + should be either manually stopped/removed or Prometheus v2 deployment + should be disabled by setting ``enable_prometheus`` to ``no``.