Bug #54502
closedmgr/cephadm: alertmanager generate_config doesn't consider FQDN
0%
Description
The Prometheus alertmanager contains a dashboard webhook_config entry for every mgr instance (active and inactive) as part of the config. Unfortunately the 'generate_config' function (which is responsible for creating the config) does only consider the FQDN of the active mgr. For the inactive ones, it takes the information from the inventory. The inventory might contain the short host-name only, e.g.:
- name: ceph-dashboard
webhook_configs:
- send_resolved: true
http_config: {}
url: https://node1.pacific.test:8443//api/prometheus_receiver
max_alerts: 0
- send_resolved: true
http_config: {}
url: https://node2:8443/api/prometheus_receiver
max_alerts: 0
- send_resolved: true
http_config: {}
url: https://node3:8443/api/prometheus_receiver
max_alerts: 0
This might lead to issues with configured certificates that apply to FQDN only.
It would be better to check if it's possible to get the FQDN for the inactive instances as well. If yes, take it. If not, fall back to the short host-name.