From fea18bc14bd177f9580e8992efa184e47185c1b5 Mon Sep 17 00:00:00 2001 From: Michael Baird Date: Wed, 19 Apr 2017 17:21:08 -0500 Subject: [PATCH] specify the StatsD host string --- datadog/datadog.go | 7 +++++-- datadog/datadog_test.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/datadog/datadog.go b/datadog/datadog.go index ff5e728b5..27ef58644 100644 --- a/datadog/datadog.go +++ b/datadog/datadog.go @@ -10,6 +10,9 @@ import ( "github.com/pilosa/pilosa" ) +// StatsD protocal wrapper using the DataDog library that added Tags to the StatsD protocal +// statsD defailt host is "127.0.0.1:8125" + const ( // Rate represents a metric rate of 1/sec. Rate = 1 @@ -30,8 +33,8 @@ type StatsClient struct { } // NewStatsClient returns a new instance of StatsClient. -func NewStatsClient() (*StatsClient, error) { - c, err := statsd.NewBuffered("127.0.0.1:8125", BufferLen) +func NewStatsClient(host string) (*StatsClient, error) { + c, err := statsd.NewBuffered(host, BufferLen) if err != nil { return nil, err } diff --git a/datadog/datadog_test.go b/datadog/datadog_test.go index 00c4bf69a..b5a8bf5ee 100644 --- a/datadog/datadog_test.go +++ b/datadog/datadog_test.go @@ -9,7 +9,7 @@ import ( func TestStatsClient_WithTags(t *testing.T) { // Create a new client. - c, err := datadog.NewStatsClient() + c, err := datadog.NewStatsClient("localhost:19444") if err != nil { t.Fatal(err) }