Merge pull request #60 from brocaar/connection_timeout
Add connection timeout configuration for InfluxDB.
This commit is contained in:
commit
15ef62747a
1
agent.go
1
agent.go
|
@ -70,6 +70,7 @@ func (agent *Agent) Connect() error {
|
|||
Username: config.Username,
|
||||
Password: config.Password,
|
||||
UserAgent: config.UserAgent,
|
||||
Timeout: config.Timeout.Duration,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -34,6 +34,7 @@ type Config struct {
|
|||
Password string
|
||||
Database string
|
||||
UserAgent string
|
||||
Timeout Duration
|
||||
Tags map[string]string
|
||||
|
||||
agent *ast.Table
|
||||
|
@ -243,6 +244,11 @@ url = "http://localhost:8086" # required.
|
|||
# The target database for metrics. This database must already exist
|
||||
database = "telegraf" # required.
|
||||
|
||||
# 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)
|
||||
# timeout = "5s"
|
||||
|
||||
# username = "telegraf"
|
||||
# password = "metricsmetricsmetricsmetrics"
|
||||
|
||||
|
|
Loading…
Reference in New Issue