Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
204ebf6b
Commit
204ebf6b
authored
8 years ago
by
Cameron Sparr
Browse files
Options
Downloads
Patches
Plain Diff
influxdb output: write consistency parameter
closes #1249
parent
52d5b192
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
etc/telegraf.conf
+5
-2
5 additions, 2 deletions
etc/telegraf.conf
plugins/outputs/influxdb/influxdb.go
+20
-15
20 additions, 15 deletions
plugins/outputs/influxdb/influxdb.go
with
26 additions
and
17 deletions
CHANGELOG.md
+
1
−
0
View file @
204ebf6b
...
@@ -18,6 +18,7 @@ to "stdout".
...
@@ -18,6 +18,7 @@ to "stdout".
-
[
#1233
](
https://github.com/influxdata/telegraf/pull/1233
)
: Updated golint gopsutil dependency.
-
[
#1233
](
https://github.com/influxdata/telegraf/pull/1233
)
: Updated golint gopsutil dependency.
-
[
#1238
](
https://github.com/influxdata/telegraf/pull/1238
)
: chrony input plugin. Thanks @zbindenren!
-
[
#1238
](
https://github.com/influxdata/telegraf/pull/1238
)
: chrony input plugin. Thanks @zbindenren!
-
[
#479
](
https://github.com/influxdata/telegraf/issues/479
)
: per-plugin execution time added to debug output.
-
[
#479
](
https://github.com/influxdata/telegraf/issues/479
)
: per-plugin execution time added to debug output.
-
[
#1249
](
https://github.com/influxdata/telegraf/issues/1249
)
: influxdb output: added write_consistency argument.
### Bugfixes
### Bugfixes
...
...
This diff is collapsed.
Click to expand it.
etc/telegraf.conf
+
5
−
2
View file @
204ebf6b
...
@@ -75,12 +75,15 @@
...
@@ -75,12 +75,15 @@
urls
= [
"http://localhost:8086"
]
# required
urls
= [
"http://localhost:8086"
]
# required
## The target database for metrics (telegraf will create it if not exists).
## The target database for metrics (telegraf will create it if not exists).
database
=
"telegraf"
# required
database
=
"telegraf"
# required
## Retention policy to write to.
retention_policy
=
"default"
## Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h".
## Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h".
## note: using "s" precision greatly improves InfluxDB compression.
## note: using "s" precision greatly improves InfluxDB compression.
precision
=
"s"
precision
=
"s"
## Retention policy to write to.
retention_policy
=
"default"
## Write consistency (clusters only), can be: "any", "one", "quorom", "all"
write_consistency
=
"any"
## Write timeout (for the InfluxDB client), formatted as a string.
## Write timeout (for the InfluxDB client), formatted as a string.
## If not provided, will default to 5s. 0s means no timeout (not recommended).
## If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout
=
"5s"
timeout
=
"5s"
...
...
This diff is collapsed.
Click to expand it.
plugins/outputs/influxdb/influxdb.go
+
20
−
15
View file @
204ebf6b
...
@@ -18,16 +18,17 @@ import (
...
@@ -18,16 +18,17 @@ import (
type
InfluxDB
struct
{
type
InfluxDB
struct
{
// URL is only for backwards compatability
// URL is only for backwards compatability
URL
string
URL
string
URLs
[]
string
`toml:"urls"`
URLs
[]
string
`toml:"urls"`
Username
string
Username
string
Password
string
Password
string
Database
string
Database
string
UserAgent
string
UserAgent
string
Precision
string
Precision
string
RetentionPolicy
string
RetentionPolicy
string
Timeout
internal
.
Duration
WriteConsistency
string
UDPPayload
int
`toml:"udp_payload"`
Timeout
internal
.
Duration
UDPPayload
int
`toml:"udp_payload"`
// Path to CA file
// Path to CA file
SSLCA
string
`toml:"ssl_ca"`
SSLCA
string
`toml:"ssl_ca"`
...
@@ -49,12 +50,15 @@ var sampleConfig = `
...
@@ -49,12 +50,15 @@ var sampleConfig = `
urls = ["http://localhost:8086"] # required
urls = ["http://localhost:8086"] # required
## The target database for metrics (telegraf will create it if not exists).
## The target database for metrics (telegraf will create it if not exists).
database = "telegraf" # required
database = "telegraf" # required
## Retention policy to write to.
retention_policy = "default"
## Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h".
## Precision of writes, valid values are "ns", "us" (or "µs"), "ms", "s", "m", "h".
## note: using "s" precision greatly improves InfluxDB compression.
## note: using "s" precision greatly improves InfluxDB compression.
precision = "s"
precision = "s"
## Retention policy to write to.
retention_policy = "default"
## Write consistency (clusters only), can be: "any", "one", "quorom", "all"
write_consistency = "any"
## Write timeout (for the InfluxDB client), formatted as a string.
## Write timeout (for the InfluxDB client), formatted as a string.
## If not provided, will default to 5s. 0s means no timeout (not recommended).
## If not provided, will default to 5s. 0s means no timeout (not recommended).
timeout = "5s"
timeout = "5s"
...
@@ -179,9 +183,10 @@ func (i *InfluxDB) Write(metrics []telegraf.Metric) error {
...
@@ -179,9 +183,10 @@ func (i *InfluxDB) Write(metrics []telegraf.Metric) error {
}
}
}
}
bp
,
err
:=
client
.
NewBatchPoints
(
client
.
BatchPointsConfig
{
bp
,
err
:=
client
.
NewBatchPoints
(
client
.
BatchPointsConfig
{
Database
:
i
.
Database
,
Database
:
i
.
Database
,
Precision
:
i
.
Precision
,
Precision
:
i
.
Precision
,
RetentionPolicy
:
i
.
RetentionPolicy
,
RetentionPolicy
:
i
.
RetentionPolicy
,
WriteConsistency
:
i
.
WriteConsistency
,
})
})
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment