Merge "Drop prometheus-msteams support"

This commit is contained in:
Zuul 2024-09-02 17:52:10 +00:00 committed by Gerrit Code Review
commit 76685b3596
13 changed files with 7 additions and 133 deletions

View File

@ -570,9 +570,6 @@ prometheus_alertmanager_cluster_port: "9094"
prometheus_alertmanager_public_port: "{{ haproxy_single_external_frontend_public_port if haproxy_single_external_frontend | bool else prometheus_alertmanager_port }}"
prometheus_alertmanager_listen_port: "{{ prometheus_alertmanager_port }}"
# Prometheus MSTeams port
prometheus_msteams_port: "9095"
# Prometheus openstack-exporter ports
prometheus_openstack_exporter_port: "9198"
prometheus_elasticsearch_exporter_port: "9108"
@ -1217,7 +1214,6 @@ enable_prometheus_blackbox_exporter: "{{ enable_prometheus | bool }}"
enable_prometheus_rabbitmq_exporter: "{{ enable_prometheus | bool and enable_rabbitmq | bool }}"
enable_prometheus_libvirt_exporter: "{{ enable_prometheus | bool and enable_nova | bool and nova_compute_virt_type in ['kvm', 'qemu'] }}"
enable_prometheus_etcd_integration: "{{ enable_prometheus | bool and enable_etcd | bool }}"
enable_prometheus_msteams: "no"
prometheus_alertmanager_user: "admin"
prometheus_ceph_exporter_interval: "{{ prometheus_scrape_interval }}"
@ -1232,7 +1228,6 @@ prometheus_ceph_mgr_exporter_endpoints: []
prometheus_openstack_exporter_endpoint_type: "internal"
prometheus_openstack_exporter_compute_api_version: "latest"
prometheus_libvirt_exporter_interval: "60s"
prometheus_msteams_webhook_url:
prometheus_public_endpoint: "{{ prometheus_external_fqdn | kolla_url(public_protocol, prometheus_public_port) }}"
prometheus_internal_endpoint: "{{ prometheus_internal_fqdn | kolla_url(internal_protocol, prometheus_port) }}"

View File

@ -555,9 +555,6 @@ monitoring
[prometheus-libvirt-exporter:children]
compute
[prometheus-msteams:children]
prometheus-alertmanager
[masakari-api:children]
control

View File

@ -574,9 +574,6 @@ monitoring
[prometheus-libvirt-exporter:children]
compute
[prometheus-msteams:children]
prometheus-alertmanager
[masakari-api:children]
control

View File

@ -122,14 +122,6 @@ prometheus_services:
image: "{{ prometheus_libvirt_exporter_image_full }}"
volumes: "{{ prometheus_libvirt_exporter_default_volumes + prometheus_libvirt_exporter_extra_volumes }}"
dimensions: "{{ prometheus_libvirt_exporter_dimensions }}"
prometheus-msteams:
container_name: "prometheus_msteams"
group: "prometheus-msteams"
enabled: "{{ enable_prometheus_msteams | bool }}"
environment: "{{ prometheus_msteams_container_proxy }}"
image: "{{ prometheus_msteams_image_full }}"
volumes: "{{ prometheus_msteams_default_volumes + prometheus_msteams_extra_volumes }}"
dimensions: "{{ prometheus_msteams_dimensions }}"
####################
# Prometheus Server
@ -235,10 +227,6 @@ prometheus_libvirt_exporter_image: "{{ docker_registry ~ '/' if docker_registry
prometheus_libvirt_exporter_tag: "{{ prometheus_tag }}"
prometheus_libvirt_exporter_image_full: "{{ prometheus_libvirt_exporter_image }}:{{ prometheus_libvirt_exporter_tag }}"
prometheus_msteams_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ docker_image_name_prefix }}prometheus-msteams"
prometheus_msteams_tag: "{{ prometheus_tag }}"
prometheus_msteams_image_full: "{{ prometheus_msteams_image }}:{{ prometheus_msteams_tag }}"
prometheus_server_dimensions: "{{ default_container_dimensions }}"
prometheus_mysqld_exporter_dimensions: "{{ default_container_dimensions }}"
prometheus_node_exporter_dimensions: "{{ default_container_dimensions }}"
@ -249,7 +237,6 @@ prometheus_openstack_exporter_dimensions: "{{ default_container_dimensions }}"
prometheus_elasticsearch_exporter_dimensions: "{{ default_container_dimensions }}"
prometheus_blackbox_exporter_dimensions: "{{ default_container_dimensions }}"
prometheus_libvirt_exporter_dimensions: "{{ default_container_dimensions }}"
prometheus_msteams_dimensions: "{{ default_container_dimensions }}"
prometheus_server_default_volumes:
- "{{ node_config_directory }}/prometheus-server/:{{ container_config_directory }}/:ro"
@ -309,11 +296,6 @@ prometheus_libvirt_exporter_default_volumes:
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "/run/libvirt:/run/libvirt:ro"
prometheus_msteams_default_volumes:
- "{{ node_config_directory }}/prometheus-msteams/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family == 'Debian' else '' }}"
- "kolla_logs:/var/log/kolla/"
prometheus_extra_volumes: "{{ default_extra_volumes }}"
prometheus_server_extra_volumes: "{{ prometheus_extra_volumes }}"
@ -326,9 +308,6 @@ prometheus_openstack_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_elasticsearch_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_blackbox_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_libvirt_exporter_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_msteams_extra_volumes: "{{ prometheus_extra_volumes }}"
prometheus_msteams_container_proxy: "{{ container_proxy }}"
prometheus_openstack_exporter_disabled_volume: "{{ '--disable-service.volume' if not enable_cinder | bool else '' }}"
prometheus_openstack_exporter_disabled_dns: "{{ '--disable-service.dns' if not enable_designate | bool else '' }}"

View File

@ -150,19 +150,3 @@
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"
- name: Restart prometheus-msteams container
vars:
service_name: "prometheus-msteams"
service: "{{ prometheus_services[service_name] }}"
become: true
kolla_container:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
environment: "{{ service.environment }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"

View File

@ -234,33 +234,3 @@
base: "{{ node_custom_config }}/prometheus/"
service: "{{ prometheus_services['prometheus-server'] }}"
when: service | service_enabled_and_mapped_to_host
- name: Copying over prometheus msteams config file
vars:
service: "{{ prometheus_services['prometheus-msteams'] }}"
template:
src: "{{ item }}"
dest: "{{ node_config_directory }}/prometheus-msteams/msteams.yml"
become: true
when: service | service_enabled_and_mapped_to_host
with_first_found:
- "{{ node_custom_config }}/prometheus/{{ inventory_hostname }}/prometheus-msteams.yml"
- "{{ node_custom_config }}/prometheus/prometheus-msteams.yml"
- "{{ role_path }}/templates/prometheus-msteams.yml.j2"
notify:
- Restart prometheus-msteams container
- name: Copying over prometheus msteams template file
vars:
service: "{{ prometheus_services['prometheus-msteams'] }}"
copy:
src: "{{ item }}"
dest: "{{ node_config_directory }}/prometheus-msteams/msteams.tmpl"
become: true
when: service | service_enabled_and_mapped_to_host
with_first_found:
- "{{ node_custom_config }}/prometheus/{{ inventory_hostname }}/prometheus-msteams.tmpl"
- "{{ node_custom_config }}/prometheus/prometheus-msteams.tmpl"
- "{{ role_path }}/templates/prometheus-msteams.tmpl"
notify:
- Restart prometheus-msteams container

View File

@ -21,7 +21,6 @@
- prometheus_elasticsearch_exporter
- prometheus_blackbox_exporter
- prometheus_libvirt_exporter
- prometheus_msteams
check_mode: false
register: container_facts
@ -185,17 +184,3 @@
- enable_prometheus_libvirt_exporter | bool
with_items:
- "{{ prometheus_libvirt_exporter_port }}"
- name: Checking free ports for Prometheus msteams
wait_for:
host: "{{ 'api' | kolla_address }}"
port: "{{ item }}"
connect_timeout: 1
timeout: 1
state: stopped
when:
- container_facts['prometheus_msteams'] is not defined
- inventory_hostname in groups['prometheus-msteams']
- enable_prometheus_msteams | bool
with_items:
- "{{ prometheus_msteams_port }}"

View File

@ -6,17 +6,7 @@ route:
group_wait: 10s
group_interval: 5m
repeat_interval: 3h
{% if enable_prometheus_msteams | bool %}
routes:
- receiver: 'prometheus-msteams'
{% endif %}
receivers:
- name: default-receiver
{% if enable_prometheus_msteams | bool %}
- name: 'prometheus-msteams'
webhook_configs:
- send_resolved: true
url: 'http://localhost:{{ prometheus_msteams_port }}/alertmanager'
{% endif %}
templates:
- '/etc/prometheus/*.tmpl'

View File

@ -1,24 +0,0 @@
{
"command": "/opt/prometheus-msteams -http-addr localhost:{{ prometheus_msteams_port }} -config-file /etc/msteams/msteams.yml -template-file /etc/msteams/msteams.tmpl",
"config_files": [
{
"source": "{{ container_config_directory }}/msteams.yml",
"dest": "/etc/msteams/msteams.yml",
"owner": "prometheus",
"perm": "0600"
},
{
"source": "{{ container_config_directory }}/msteams.tmpl",
"dest": "/etc/msteams/msteams.tmpl",
"owner": "prometheus",
"perm": "0600"
}
],
"permissions": [
{
"path": "/var/log/kolla/prometheus",
"owner": "prometheus:kolla",
"recurse": true
}
]
}

View File

@ -1,2 +0,0 @@
connectors:
- alertmanager: "{{ prometheus_msteams_webhook_url }}"

View File

@ -760,7 +760,6 @@ workaround_ansible_issue_8743: yes
#enable_prometheus_blackbox_exporter: "{{ enable_prometheus | bool }}"
#enable_prometheus_libvirt_exporter: "{{ enable_prometheus | bool and enable_nova | bool and nova_compute_virt_type in ['kvm', 'qemu'] }}"
#enable_prometheus_etcd_integration: "{{ enable_prometheus | bool and enable_etcd | bool }}"
#enable_prometheus_msteams: "no"
# The labels to add to any time series or alerts when communicating with external systems (federation, remote storage, Alertmanager).
# prometheus_external_labels:

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
Support for deploying ``prometheus-msteams`` has been dropped as the
project is no longer maintained. Users should migrate to the `native
Prometheus Alertmanager integration with Microsoft Teams
<https://prometheus.io/docs/alerting/latest/configuration/#msteams_config>`__.

View File

@ -625,9 +625,6 @@ monitoring
[prometheus-libvirt-exporter:children]
compute
[prometheus-msteams:children]
prometheus-alertmanager
# NOTE(yoctozepto): In CI we want to test Masakari HA but not of other services,
# to conserve the resources. Hence, we set Masakari groups to use both
# primary and secondary while the parent group (control) uses only primary.