aboutsummaryrefslogtreecommitdiff
path: root/weed/stats/metrics.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/stats/metrics.go')
-rw-r--r--weed/stats/metrics.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/stats/metrics.go b/weed/stats/metrics.go
index 48d964418..1e1681f9a 100644
--- a/weed/stats/metrics.go
+++ b/weed/stats/metrics.go
@@ -3,8 +3,10 @@ package stats
import (
"fmt"
"log"
+ "net"
"net/http"
"os"
+ "strconv"
"strings"
"time"
@@ -180,5 +182,5 @@ func SourceName(port uint32) string {
if err != nil {
return "unknown"
}
- return fmt.Sprintf("%s:%d", hostname, port)
+ return net.JoinHostPort(hostname, strconv.Itoa(int(port)))
}