Доработана конфигурация взаимодействия со statsd

This commit is contained in:
ErickSkrauch 2017-03-25 15:55:57 +03:00
parent 201a257d69
commit 6a881a62e3

View File

@ -63,11 +63,12 @@ func main() {
// statsd // statsd
var statsdString = os.Getenv("STATSD_ADDR") var statsdString = os.Getenv("STATSD_ADDR")
if (statsdString != "") { if (statsdString != "") {
log.Println("Connecting to statsd")
hostname, _ := os.Hostname() hostname, _ := os.Hostname()
statsdReceiver, err := statsd.NewReceiver(statsd.Config{ statsdReceiver, err := statsd.NewReceiver(statsd.Config{
Address: statsdString, Address: statsdString,
Prefix: "ely.skinsystem." + hostname + ".", Prefix: "ely.skinsystem." + hostname + ".app.",
FlushEvery: 2, FlushEvery: 1,
}) })
if (err != nil) { if (err != nil) {
log.Fatal("statsd connection error") log.Fatal("statsd connection error")