Use datacenter option spelling in consul input (#5320)
This commit is contained in:
parent
39eff3d62b
commit
f739ce2a35
|
@ -1703,8 +1703,8 @@
|
||||||
# # username = ""
|
# # username = ""
|
||||||
# # password = ""
|
# # password = ""
|
||||||
#
|
#
|
||||||
# ## Data centre to query the health checks from
|
# ## Data center to query the health checks from
|
||||||
# # datacentre = ""
|
# # datacenter = ""
|
||||||
#
|
#
|
||||||
# ## Optional TLS Config
|
# ## Optional TLS Config
|
||||||
# # tls_ca = "/etc/telegraf/ca.pem"
|
# # tls_ca = "/etc/telegraf/ca.pem"
|
||||||
|
|
|
@ -24,8 +24,8 @@ report those stats already using StatsD protocol if needed.
|
||||||
# username = ""
|
# username = ""
|
||||||
# password = ""
|
# password = ""
|
||||||
|
|
||||||
## Data centre to query the health checks from
|
## Data center to query the health checks from
|
||||||
# datacentre = ""
|
# datacenter = ""
|
||||||
|
|
||||||
## Optional TLS Config
|
## Optional TLS Config
|
||||||
# tls_ca = "/etc/telegraf/ca.pem"
|
# tls_ca = "/etc/telegraf/ca.pem"
|
||||||
|
|
|
@ -17,6 +17,7 @@ type Consul struct {
|
||||||
Username string
|
Username string
|
||||||
Password string
|
Password string
|
||||||
Datacentre string
|
Datacentre string
|
||||||
|
Datacenter string
|
||||||
tls.ClientConfig
|
tls.ClientConfig
|
||||||
TagDelimiter string
|
TagDelimiter string
|
||||||
|
|
||||||
|
@ -38,8 +39,8 @@ var sampleConfig = `
|
||||||
# username = ""
|
# username = ""
|
||||||
# password = ""
|
# password = ""
|
||||||
|
|
||||||
## Data centre to query the health checks from
|
## Data center to query the health checks from
|
||||||
# datacentre = ""
|
# datacenter = ""
|
||||||
|
|
||||||
## Optional TLS Config
|
## Optional TLS Config
|
||||||
# tls_ca = "/etc/telegraf/ca.pem"
|
# tls_ca = "/etc/telegraf/ca.pem"
|
||||||
|
@ -77,6 +78,10 @@ func (c *Consul) createAPIClient() (*api.Client, error) {
|
||||||
config.Datacenter = c.Datacentre
|
config.Datacenter = c.Datacentre
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.Datacenter != "" {
|
||||||
|
config.Datacenter = c.Datacenter
|
||||||
|
}
|
||||||
|
|
||||||
if c.Token != "" {
|
if c.Token != "" {
|
||||||
config.Token = c.Token
|
config.Token = c.Token
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue