Bug #55595
Updated by Volker Theile almost 2 years ago
Prometheus is currently using only the hostname in the 'generatorURL' of an alert which causes issues when clicking on the URL in the Ceph Dashboard or somewhere else, because in most cases the hostname of the node that is running the Prometheus container is not resolvable.
Example: http://ses-admin:9095/graph?g0.expr=predict_linear%28node_filesystem_free_bytes%5B2d%5D%2C+3600+%2A+24+%2A+5%29+%2A+on%28instance%29+group_left%28nodename%29+node_uname_info+%3C+0&g0.tab=1
The base of the generatorURL is build here: https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main.go#L1222
To fix that the command line argument '--web.external-url' must be appended in the systemd unit file of the Prometheus container, e.g. '--web.external-url http://foo.bar:9095' whereas a FQDN hostname is used.
After that Prometheus will generate alerts with a 'generatorURL' property that contains an URL that should be resolvable.
References:
- https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main.go#L237
- https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main.go#L249
- https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main.go#L427
- https://github.com/prometheus/prometheus/blob/main/cmd/prometheus/main.go#L1267