Project

General

Profile

Actions

Bug #55595

closed

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

Added by Volker Theile almost 2 years ago. Updated almost 2 years 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

Actions #1

Updated by Volker Theile almost 2 years ago

  • Description updated (diff)
Actions #2

Updated by Volker Theile almost 2 years ago

  • Description updated (diff)
Actions #3

Updated by Volker Theile almost 2 years ago

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

Updated by Volker Theile almost 2 years ago

  • Description updated (diff)
Actions #5

Updated by Volker Theile almost 2 years ago

  • Status changed from Fix Under Review to Pending Backport
Actions #6

Updated by Volker Theile almost 2 years ago

  • Status changed from Pending Backport to Resolved
Actions #7

Updated by Volker Theile almost 2 years ago

  • Status changed from Resolved to Pending Backport
Actions #8

Updated by Volker Theile almost 2 years ago

  • Status changed from Pending Backport to Resolved
Actions #10

Updated by Volker Theile almost 2 years ago

  • Status changed from Resolved to Pending Backport
Actions #12

Updated by Volker Theile almost 2 years ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF