Project

General

Profile

Bug #55595

cephadm: prometheus: The generatorURL in alerts is only using hostname

Added by Volker Theile 7 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Tags:
Backport:
pacific, quincy
Regression:
No
Severity:
3 - minor
Reviewed:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

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

History

#1 Updated by Volker Theile 7 months ago

  • Description updated (diff)

#2 Updated by Volker Theile 7 months ago

  • Description updated (diff)

#3 Updated by Volker Theile 7 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 46218

#4 Updated by Volker Theile 7 months ago

  • Description updated (diff)

#5 Updated by Volker Theile 7 months ago

  • Status changed from Fix Under Review to Pending Backport

#6 Updated by Volker Theile 7 months ago

  • Status changed from Pending Backport to Resolved

#7 Updated by Volker Theile 7 months ago

  • Status changed from Resolved to Pending Backport

#8 Updated by Volker Theile 7 months ago

  • Status changed from Pending Backport to Resolved

#10 Updated by Volker Theile 7 months ago

  • Status changed from Resolved to Pending Backport

#12 Updated by Volker Theile 6 months ago

  • Status changed from Pending Backport to Resolved

Also available in: Atom PDF