Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus: Properly split the port off IPv6 addresses #36594

Merged
merged 1 commit into from Sep 2, 2020

Commits on Aug 13, 2020

  1. prometheus: Properly split the port off IPv6 addresses

    The Prometheus module when splitting the port nubmer for public and
    client networks/ips doesn't take IPv6 addresses into account.
    
    This patch fixes this by using `rsplit(':', 1)` rather then `split(':')`
    which leads to bugs like:
    
      curl --silent http://localhost:9283/metrics | grep ceph_mon_metadata{
      ceph_mon_metadata{ceph_daemon="mon.mon2",hostname="mon2.example.net",public_addr="[2001",rank="0",ceph_version="ceph version 15.2.4 (7447c15) octopus (stable)"} 1.0
    
    Note the public_addr above being split at the first ':' of an IPv6
    address.
    
    Signed-off-by: Matthew Oliver <moliver@suse.com>
    Fixes: https://tracker.ceph.com/issues/46846
    Matthew Oliver committed Aug 13, 2020
    Configuration menu
    Copy the full SHA
    985cce0 View commit details
    Browse the repository at this point in the history