Propagate statsd to config

This commit is contained in:
9seconds
2018-07-13 11:05:43 +03:00
parent 18e46241f8
commit c64f97082c
4 changed files with 79 additions and 3 deletions
+25 -1
View File
@@ -61,7 +61,7 @@ var (
Envar("MTG_IPV6_PORT").
Uint16()
statsIP = app.Flag("stats-ip", "Which IP bind stats server to").
statsIP = app.Flag("stats-ip", "Which IP bind stats server to.").
Short('t').
Envar("MTG_STATS_IP").
Default("127.0.0.1").
@@ -72,6 +72,28 @@ var (
Default("3129").
Uint16()
statsdIP = app.Flag("statsd-ip", "Which IP should we use for working with statsd.").
Envar("MTG_STATSD_IP").
String()
statsdPort = app.Flag("statsd-port", "Which port should we use for working with statsd.").
Envar("MTG_STATSD_PORT").
Default("8125").
Uint16()
statsdNetwork = app.Flag("statsd-network", "Which network is used to work with statsd. Only 'tcp' and 'udp' are supported.").
Envar("MTG_STATSD_NETWORK").
Default("udp").
String()
statsdPrefix = app.Flag("statsd-prefix", "Which bucket prefix should we use for sending stats to statsd.").
Envar("MTG_STATSD_PREFIX").
Default("mtg").
String()
statsdTagsFormat = app.Flag("statsd-tags-format", "Which tag format should we use to send stats metrics. Valid options are 'datadog' and 'influxdb'.").
Envar("MTG_STATSD_TAGS_FORMAT").
String()
statsdTags = app.Flag("statsd-tags", "Tags to use for working with statsd (specified as 'key=value').").
Envar("MTG_STATSD_TAGS").
StringMap()
secret = app.Arg("secret", "Secret of this proxy.").Required().String()
adtag = app.Arg("adtag", "ADTag of the proxy.").String()
)
@@ -96,6 +118,8 @@ func main() {
*publicIPv6, *publicIPv6Port,
*statsIP, *statsPort,
*secret, *adtag,
*statsdIP, *statsdPort, *statsdNetwork, *statsdPrefix,
*statsdTagsFormat, *statsdTags,
)
if err != nil {
usage(err.Error())