From f988af72355b503fc88469b0c001f114912c951b Mon Sep 17 00:00:00 2001 From: Goutham Veeramachaneni Date: Wed, 24 Oct 2018 04:16:36 -0400 Subject: [PATCH] Revert #4586 (#4766) This breaks people if they are depending on the contents of __address__ label. Signed-off-by: Goutham Veeramachaneni --- discovery/dns/dns.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discovery/dns/dns.go b/discovery/dns/dns.go index 61dd54b4c..17e7dad0e 100644 --- a/discovery/dns/dns.go +++ b/discovery/dns/dns.go @@ -181,6 +181,9 @@ func (d *Discovery) refresh(ctx context.Context, name string, ch chan<- []*targe target := model.LabelValue("") switch addr := record.(type) { case *dns.SRV: + // Remove the final dot from rooted DNS names to make them look more usual. + addr.Target = strings.TrimRight(addr.Target, ".") + target = hostPort(addr.Target, int(addr.Port)) case *dns.A: target = hostPort(addr.A.String(), d.port)