Skip to content

Commit

Permalink
rename dogStatsdHostPort to dogStatsdAddr
Browse files Browse the repository at this point in the history
  • Loading branch information
koid committed Jun 22, 2018
1 parent 6ad4cfd commit de27cad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
TAG_KEY:
FLUENT_HOST: fluentd
FLUENT_PORT: 24224
DOGSTATSD_HOST_PORT: dogstatsd:8125
DOGSTATSD_ADDR: dogstatsd:8125
depends_on:
- fluentd
- dogstatsd
Expand Down
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var (
fluentHost = "localhost"
fluentPort = 24224

dogStatsdHostPort string
dogStatsdTags []string
dogStatsdAddr string
dogStatsdTags []string

clientName string
)
Expand All @@ -54,7 +54,7 @@ func init() {
fluentPort, _ = strconv.Atoi(os.Getenv("FLUENT_PORT"))
}

dogStatsdHostPort = os.Getenv("DOGSTATSD_HOST_PORT")
dogStatsdAddr = os.Getenv("DOGSTATSD_ADDR")
dogStatsdTags = strings.Split(os.Getenv("DOGSTATSD_TAGS"), ",")

hostname, err := os.Hostname()
Expand Down Expand Up @@ -89,7 +89,7 @@ func initDogStatsd() *dogstatsd.Statsd {
fmt.Sprintf("app:%s", checkpointTablePrefix),
fmt.Sprintf("client:%s", clientName),
}...)
_s, err := dogstatsd.New(dogStatsdHostPort, dogStatsdTags)
_s, err := dogstatsd.New(dogStatsdAddr, dogStatsdTags)
if err != nil {
log.Fatalf("dogstatsd.New returned error: %v", err)
}
Expand All @@ -115,7 +115,7 @@ func main() {
defer l.Close()

// statsd
if len(dogStatsdHostPort) > 0 {
if len(dogStatsdAddr) > 0 {
stats = initDogStatsd()
}

Expand Down

0 comments on commit de27cad

Please sign in to comment.