mirror of
https://github.com/prometheus/statsd_exporter.git
synced 2024-12-01 11:41:01 +00:00
commit
a373aee28e
1 changed files with 3 additions and 3 deletions
6
main.go
6
main.go
|
@ -30,9 +30,9 @@ func serveHTTP() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func udpAddrFromString(addr string) *net.UDPAddr {
|
func udpAddrFromString(addr string) *net.UDPAddr {
|
||||||
host, portStr, err := net.SplitHostPort(*statsdListenAddress)
|
host, portStr, err := net.SplitHostPort(addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Bad StatsD listening address", *statsdListenAddress)
|
log.Fatal("Bad StatsD listening address", addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if host == "" {
|
if host == "" {
|
||||||
|
@ -45,7 +45,7 @@ func udpAddrFromString(addr string) *net.UDPAddr {
|
||||||
|
|
||||||
port, err := strconv.Atoi(portStr)
|
port, err := strconv.Atoi(portStr)
|
||||||
if err != nil || port < 0 || port > 65535 {
|
if err != nil || port < 0 || port > 65535 {
|
||||||
log.Fatal("Bad port %s: %s", portStr, err)
|
log.Fatalf("Bad port %s: %s", portStr, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &net.UDPAddr{
|
return &net.UDPAddr{
|
||||||
|
|
Loading…
Reference in a new issue