Use string for InfluxDB timeout duration config.
This commit is contained in:
parent
6ad37267e4
commit
b717dc0742
2
agent.go
2
agent.go
|
@ -70,7 +70,7 @@ func (agent *Agent) Connect() error {
|
||||||
Username: config.Username,
|
Username: config.Username,
|
||||||
Password: config.Password,
|
Password: config.Password,
|
||||||
UserAgent: config.UserAgent,
|
UserAgent: config.UserAgent,
|
||||||
Timeout: config.Timeout * time.Second,
|
Timeout: config.Timeout.Duration,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -34,7 +34,7 @@ type Config struct {
|
||||||
Password string
|
Password string
|
||||||
Database string
|
Database string
|
||||||
UserAgent string
|
UserAgent string
|
||||||
Timeout time.Duration
|
Timeout Duration
|
||||||
Tags map[string]string
|
Tags map[string]string
|
||||||
|
|
||||||
agent *ast.Table
|
agent *ast.Table
|
||||||
|
@ -244,9 +244,10 @@ url = "http://localhost:8086" # required.
|
||||||
# The target database for metrics. This database must already exist
|
# The target database for metrics. This database must already exist
|
||||||
database = "telegraf" # required.
|
database = "telegraf" # required.
|
||||||
|
|
||||||
# Timeout in seconds (for the connection with InfluxDB).
|
# Connection timeout (for the connection with InfluxDB), formatted as a string.
|
||||||
|
# Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
||||||
# If not provided, will default to 0 (no timeout)
|
# If not provided, will default to 0 (no timeout)
|
||||||
# timeout = 5
|
# timeout = "5s"
|
||||||
|
|
||||||
# username = "telegraf"
|
# username = "telegraf"
|
||||||
# password = "metricsmetricsmetricsmetrics"
|
# password = "metricsmetricsmetricsmetrics"
|
||||||
|
|
Loading…
Reference in New Issue