Add DogStatsD metrics output. (#2883)

Fixes #2490
This commit is contained in:
Jeff Mitchell
2017-06-16 23:51:46 -04:00
committed by GitHub
parent f6155ea8c5
commit f5de93f1bf
7 changed files with 179 additions and 2 deletions

View File

@@ -196,6 +196,15 @@ type Telemetry struct {
// (e.g. a specific geo location or datacenter, dc:sfo)
// Default: none
CirconusBrokerSelectTag string `hcl:"circonus_broker_select_tag"`
// Dogstats:
// DogStatsdAddr is the address of a dogstatsd instance. If provided,
// metrics will be sent to that instance
DogStatsDAddr string `hcl:"dogstatsd_addr"`
// DogStatsdTags are the global tags that should be sent with each packet to dogstatsd
// It is a list of strings, where each string looks like "my_tag_name:my_tag_value"
DogStatsDTags []string `hcl:"dogstatsd_tags"`
}
func (s *Telemetry) GoString() string {
@@ -734,6 +743,8 @@ func parseTelemetry(result *Config, list *ast.ObjectList) error {
"circonus_broker_id",
"circonus_broker_select_tag",
"disable_hostname",
"dogstatsd_addr",
"dogstatsd_tags",
"statsd_address",
"statsite_address",
}

View File

@@ -58,6 +58,8 @@ func TestLoadConfigFile(t *testing.T) {
StatsdAddr: "bar",
StatsiteAddr: "foo",
DisableHostname: false,
DogStatsDAddr: "127.0.0.1:7254",
DogStatsDTags: []string{"tag_1:val_1", "tag_2:val_2"},
},
DisableCache: true,

View File

@@ -28,6 +28,8 @@ ha_backend "consul" {
telemetry {
statsd_address = "bar"
statsite_address = "foo"
dogstatsd_addr = "127.0.0.1:7254"
dogstatsd_tags = ["tag_1:val_1", "tag_2:val_2"]
}
max_lease_ttl = "10h"