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) }