Skip to content

Commit

Permalink
make package work with newer puppetlabs-apt, add support for metric b…
Browse files Browse the repository at this point in the history
…atch size, and update buffer limit default to current telegraf default (#63)

* make it work with newer puppetlabs-apt

* add support for metric batch size

* telegraf uses 10000 as default for metric_buffer_limit so puppet should probably do that as well
  • Loading branch information
htj authored and yankcrime committed Jun 26, 2017
1 parent dc06552 commit 34b7086
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
# [*round_interval*]
# Boolean. Rounds collection interval to 'interval'
#
# [*metric_batch_size*]
# Integer. Telegraf will limit each output batch to this size.
#
# [*metric_buffer_limit*]
# Integer. Cache metric_buffer_limit metrics for each output, and flush this
# buffer on a successful write.
Expand Down Expand Up @@ -98,6 +101,7 @@
$omit_hostname = $telegraf::params::omit_hostname,
$interval = $telegraf::params::interval,
$round_interval = $telegraf::params::round_interval,
$metric_batch_size = $telegraf::params::metric_batch_size,
$metric_buffer_limit = $telegraf::params::metric_buffer_limit,
$flush_buffer_when_full = $telegraf::params::flush_buffer_when_full,
$collection_jitter = $telegraf::params::collection_jitter,
Expand Down Expand Up @@ -134,6 +138,7 @@
validate_bool($omit_hostname)
validate_string($interval)
validate_bool($round_interval)
validate_integer($metric_batch_size)
validate_integer($metric_buffer_limit)
validate_bool($flush_buffer_when_full)
validate_string($collection_jitter)
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
$omit_hostname = false
$interval = '10s'
$round_interval = true
$metric_buffer_limit = '1000'
$metric_batch_size = '1000'
$metric_buffer_limit = '10000'
$flush_buffer_when_full = true
$collection_jitter = '0s'
$flush_interval = '10s'
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
],
"dependencies": [
{ "name": "puppetlabs-stdlib", "version_requirement": ">=4.10.0 < 5.0.0" },
{ "name": "puppetlabs-apt", "version_requirement": ">= 2.0.0 < 3.0.0" }
{ "name": "puppetlabs-apt", "version_requirement": ">= 2.0.0 < 5.0.0" }
],
"requirements": [
{ "name": "puppet", "version_requirement": "> = 3.0.0 < 5.0.0" }
Expand Down
1 change: 1 addition & 0 deletions templates/telegraf.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
omit_hostname = <%= @omit_hostname %>
interval = "<%= @interval %>"
round_interval = <%= @round_interval %>
metric_batch_size = <%= @metric_batch_size %>
metric_buffer_limit = <%= @metric_buffer_limit %>
flush_buffer_when_full = <%= @flush_buffer_when_full %>
collection_jitter = "<%= @collection_jitter %>"
Expand Down

0 comments on commit 34b7086

Please sign in to comment.