Skip to content

Commit a2c07e0

Browse files
committed
fix up prom address in slack alert links
1 parent ccd3014 commit a2c07e0

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

ansible/roles/alertmanager/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ Swap: 0B 0B 0B
134134

135135
/invite @YOUR_BOT_NAME
136136

137+
TODO: note that `prometheus_web_external_url` might need overriding too.
137138

138139
## Alert Rules
139140

environments/common/inventory/group_vars/all/alertmanager.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ alertmanager_slack_receiver: # defined here as needs prometheus address
1010
authorization:
1111
credentials: "{{ alertmanager_slack_integration.app_creds | default('none') }}"
1212
text: "{{ '{{' }} .GroupLabels.alertname {{ '}}' }} : {{ '{{' }} .CommonAnnotations.description {{ '}}' }}"
13-
title_link: "http://{{ prometheus_address }}:9090/alertmanager/#/alerts?receiver=slack-receiver"
13+
title_link: "{{ prometheus_web_external_url }}/alerts?receiver=slack-receiver"
1414
send_resolved: true

environments/common/inventory/group_vars/all/prometheus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# for variable definitions
55

66
prometheus_version: 2.27.0 # default from ansible/roles/cloudalchemy.prometheus/defaults/main.yml
7-
prometheus_web_external_url: "http://{{ prometheus_address }}:9090"
7+
prometheus_web_external_url: "http://{{ hostvars[groups['prometheus'].0].ansible_host }}:9090/" # default to host IP address
88
prometheus_storage_retention: "31d"
99
prometheus_storage_retention_size: "100GB"
1010
prometheus_db_dir: "{{ appliances_state_dir | default('/var/lib') }}/prometheus"

0 commit comments

Comments
 (0)