Skip to content

Commit ab928a6

Browse files
committed
Merge pull request #176 from DataDog/jaime/preprelease_alt
Pre-Release 1.7.0 PR
2 parents 1e679ce + f5464fe commit ab928a6

File tree

65 files changed

+2395
-122
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2395
-122
lines changed

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,31 @@
11
Changes
22
=======
33

4+
# 1.7.0 / 2016-04-12
5+
6+
### Notes
7+
8+
* [FEATURE] Added manifest for PGBouncer. See [#175][]. (Thanks [@mcasper][]).
9+
* [FEATURE] Added manifest for Consul. See [#174][]. (Thanks [@flyinprogrammer][]).
10+
* [FEATURE] Added mesos master and slave manifests for individual management. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]).
11+
* [FEATURE] Added option to extract the hostname from puppet hostname strings with a regex capture group. See [#173][]. (Thanks [@LeoCavaille][]).
12+
* [FEATURE] Added support on multiple ports per host on Redis integration. See [#169][]. (Thanks [@fzwart][]).
13+
* [FEATURE] Added support for `disable_ssl_validation` on Apache integration. See[#171. (Thanks [@BIAndrews][]).
14+
* [FEATURE] Added support for SSL, additional metrics and database connection in Mongo integration. See [#164][]. (Thanks [@bflad][]).
15+
* [FEATURE] Added support for multiple instance in HTTP check. See [#155][]. (Thanks [@bfla][]d].
16+
* [FEATURE] Added support for multiple new datadog.conf directives. See [#79][]. (Thanks [@obowersa][]).
17+
* [FEATURE] Decouple yum repo from agent package. See [#168][]. (Thanks [@b2jrock][]).
18+
19+
* [IMPROVEMENT] Moved GPG key to its own parameter. See [#158][]. (Thanks [@davidgibbons][]).
20+
21+
* [BUFIX] Updated docker to use more current `docker_daemon`. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]).
22+
23+
* [DEPRECATE] Deprecated old docker manifest. See [#174][]. (Thanks [@flyinprogrammer][]).
24+
* [DEPRECATE] Deprecated `new_tag_names` in `docker_daemon` manifest. See [#174][]. (Thanks [@flyinprogrammer][]).
25+
* [DEPRECATE] Deprecated `use_mount` option in base manifest. See [#174][]. (Thanks [@flyinprogrammer][]).
26+
27+
* [CI] Improved spec and docs. See [#79][]. (Thanks [@obowersa][]).
28+
* [CI] Added multiple tests for integration classes. See [#145][]. (Thanks [@kitchen][]).
429

530
# 1.6.0 / 2016-01-20
631

@@ -107,14 +132,37 @@ Changes
107132
# 1.0.1
108133

109134
<!--- The following link definition list is generated by PimpMyChangelog --->
135+
[#79]: https://github.com/DataDog/puppet-datadog-agent/issues/79
110136
[#139]: https://github.com/DataDog/puppet-datadog-agent/issues/139
137+
[#145]: https://github.com/DataDog/puppet-datadog-agent/issues/145
111138
[#149]: https://github.com/DataDog/puppet-datadog-agent/issues/149
112139
[#150]: https://github.com/DataDog/puppet-datadog-agent/issues/150
113140
[#154]: https://github.com/DataDog/puppet-datadog-agent/issues/154
141+
[#155]: https://github.com/DataDog/puppet-datadog-agent/issues/155
114142
[#156]: https://github.com/DataDog/puppet-datadog-agent/issues/156
143+
[#158]: https://github.com/DataDog/puppet-datadog-agent/issues/158
115144
[#161]: https://github.com/DataDog/puppet-datadog-agent/issues/161
145+
[#164]: https://github.com/DataDog/puppet-datadog-agent/issues/164
146+
[#168]: https://github.com/DataDog/puppet-datadog-agent/issues/168
147+
[#169]: https://github.com/DataDog/puppet-datadog-agent/issues/169
148+
[#171]: https://github.com/DataDog/puppet-datadog-agent/issues/171
149+
[#173]: https://github.com/DataDog/puppet-datadog-agent/issues/173
150+
[#174]: https://github.com/DataDog/puppet-datadog-agent/issues/174
151+
[#175]: https://github.com/DataDog/puppet-datadog-agent/issues/175
152+
[@BIAndrews]: https://github.com/BIAndrews
153+
[@LeoCavaille]: https://github.com/LeoCavaille
116154
[@MartinDelta]: https://github.com/MartinDelta
155+
[@b2jrock]: https://github.com/b2jrock
156+
[@bfla]: https://github.com/bfla
157+
[@bflad]: https://github.com/bflad
158+
[@davidgibbons]: https://github.com/davidgibbons
159+
[@flyinprogrammer]: https://github.com/flyinprogrammer
160+
[@fzwart]: https://github.com/fzwart
117161
[@grubernaut]: https://github.com/grubernaut
162+
[@jangie]: https://github.com/jangie
163+
[@kitchen]: https://github.com/kitchen
164+
[@mcasper]: https://github.com/mcasper
118165
[@mrunkel-ut]: https://github.com/mrunkel-ut
166+
[@obowersa]: https://github.com/obowersa
119167
[@rtyler]: https://github.com/rtyler
120168
[@tuxinaut]: https://github.com/tuxinaut

lib/puppet/reports/datadog_reports.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
config = YAML.load_file(configfile)
1515
API_KEY = config[:datadog_api_key]
1616

17+
# if need be initialize the regex
18+
HOSTNAME_EXTRACTION_REGEX = config[:hostname_extraction_regex]
19+
begin
20+
HOSTNAME_EXTRACTION_REGEX = Regexp.new HOSTNAME_EXTRACTION_REGEX unless HOSTNAME_EXTRACTION_REGEX.nil?
21+
rescue
22+
raise(Puppet::ParseError, "Invalid hostname_extraction_regex #{HOSTNAME_EXTRACTION_REGEX}")
23+
end
24+
1725
desc <<-DESC
1826
Send notification of metrics to Datadog
1927
DESC
@@ -38,6 +46,12 @@ def pluralize(number, noun)
3846
def process
3947
@summary = self.summary
4048
@msg_host = self.host
49+
unless HOSTNAME_EXTRACTION_REGEX.nil?
50+
m = @msg_host.match(HOSTNAME_EXTRACTION_REGEX)
51+
unless m[:hostname].nil?
52+
@msg_host = m[:hostname]
53+
end
54+
end
4155

4256
event_title = ''
4357
alert_type = ''

manifests/init.pp

Lines changed: 149 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
# The host of the Datadog intake server to send agent data to.
88
# Defaults to https://app.datadoghq.com.
99
# $host:
10-
# Your hostname to see in Datadog. Defaults with Datadog hostname detection.
1110
# $api_key:
1211
# Your DataDog API Key. Please replace with your key value.
1312
# $collect_ec2_tags
@@ -34,12 +33,14 @@
3433
# $log_level
3534
# Set value of 'log_level' variable. Default is 'info' as in dd-agent.
3635
# Valid values here are: critical, debug, error, fatal, info, warn and warning.
36+
# $hostname_extraction_regex
37+
# Completely optional.
38+
# Instead of reporting the puppet nodename, use this regex to extract the named
39+
# 'hostname' captured group to report the run in Datadog.
40+
# ex.: '^(?<hostname>.*\.datadoghq\.com)(\.i-\w{8}\..*)?$'
3741
# $log_to_syslog
3842
# Set value of 'log_to_syslog' variable. Default is true -> yes as in dd-agent.
3943
# Valid values here are: true or false.
40-
# $use_mount
41-
# Allow overriding default of tracking disks by device path instead of mountpoint
42-
# Valid values here are: true or false.
4344
# $dogstatsd_port
4445
# Set value of the 'dogstatsd_port' variable. Defaultis 8125.
4546
# $statsd_forward_host
@@ -48,6 +49,9 @@
4849
# $statsd_forward_port
4950
# Set the value of the statsd_forward_port varable. Used to forward all
5051
# statsd metrics to another host.
52+
# $manage_repo
53+
# Boolean to indicate whether this module should attempt to manage
54+
# the package repo. Default true.
5155
# $proxy_host
5256
# Set value of 'proxy_host' variable. Default is blank.
5357
# $proxy_port
@@ -68,6 +72,90 @@
6872
# Skip SSL validation.
6973
# $use_curl_http_client
7074
# Uses the curl HTTP client for the forwarder
75+
# $collect_ec2_tas
76+
# Presents custom EC2 tags as agent tags to datadog
77+
# Boolean. Default: False
78+
# $collect_instance_metadata
79+
# Enables the agent to try and gather instance metadata on EC2/GCE
80+
# Boolean. Default: true
81+
# $recent_point_threshold
82+
# Sets the threshold for accepting points.
83+
# String. Default: empty (30 second intervals)
84+
# $listen_port
85+
# Change the port that the agent listens on
86+
# String. Default: empty (port 17123 in dd-agent)
87+
# $additional_checksd
88+
# Additional directory to look for datadog checks in
89+
# String. Default: empty
90+
# $bind_host
91+
# The loopback address the forwarder and Dogstatsd will bind.
92+
# String. Default: empty
93+
# $use_pup
94+
# Enables the local pup dashboard
95+
# Boolean. Default: false
96+
# $pup_port
97+
# Specifies the port to be used by pup. Must have use_pup set
98+
# String. Default: empty
99+
# $pup_interface
100+
# Specifies which interface pup will use. Must have use_pup set
101+
# String. Default: empty
102+
# $pup_url
103+
# Specifies the URL used to access pup. Must have use_pup set
104+
# String. Default: empty
105+
# $use_dogstatsd
106+
# Enables the dogstatsd server
107+
# Boolean. Default: false
108+
# $dogstatsd_port
109+
# Specifies the port to be used by dogstatsd. Must have use_dogstatsd set
110+
# String. Default: empty
111+
# $dogstatsd_target
112+
# Change the target to be used by dogstatsd. Must have use_dogstatsd set
113+
# set
114+
# String. Default: empty
115+
# $dogstatsd_interval
116+
# Change the dogstatsd flush period. Must have use_dogstatsd set
117+
# String. Default: empty ( 10 second interval)
118+
# $dogstatsd_normalize
119+
# Enables 1 second nomralization. Must have use_dogstatsd set
120+
# Boolean. Default: true
121+
# $statsd_forward_host
122+
# Enables forwarding of statsd packetsto host. Must have use_dogstatsd set
123+
# String. Default: empty
124+
# $statsd_forward_port
125+
# Specifis port for $statsd_forward_host. Must have use_dogstatsd set
126+
# String. Default: empty
127+
# $device_blacklist_re
128+
# Specifies pattern for device blacklisting.
129+
# String. Default: empty
130+
# $ganglia_host
131+
# Specifies host where gmetad is running
132+
# String. Default: empty
133+
# $ganglia_port
134+
# Specifies port for $ganglia_host
135+
# String. Default: empty
136+
# $dogstreams
137+
# Specifies port for list of logstreams/modules to be used.
138+
# String. Default: empty
139+
# $custom_emitters
140+
# Specifies a comma seperated list of non standard emitters to be used
141+
# String. Default: empty
142+
# $custom_emitters
143+
# Specifies a comma seperated list of non standard emitters to be used
144+
# String. Default: empty
145+
# $collector_log_file
146+
# Specifies the log file location for the collector system
147+
# String. Default: empty
148+
# $forwarder_log_file
149+
# Specifies the log file location for the forwarder system
150+
# String. Default: empty
151+
# $dogstatsd
152+
# Specifies the log file location for the dogstatsd system
153+
# String. Default: empty
154+
# $pup_log_file
155+
# Specifies the log file location for the pup system
156+
# String. Default: empty
157+
#
158+
#
71159
# Actions:
72160
#
73161
# Requires:
@@ -103,10 +191,11 @@
103191
$log_to_syslog = true,
104192
$service_ensure = 'running',
105193
$service_enable = true,
106-
$use_mount = false,
194+
$manage_repo = true,
195+
$hostname_extraction_regex = nil,
107196
$dogstatsd_port = 8125,
108197
$statsd_forward_host = '',
109-
$statsd_forward_port = 8125,
198+
$statsd_forward_port = '',
110199
$statsd_histogram_percentiles = '0.95',
111200
$proxy_host = '',
112201
$proxy_port = '',
@@ -118,7 +207,27 @@
118207
$ganglia_port = 8651,
119208
$skip_ssl_validation = false,
120209
$skip_apt_key_trusting = false,
121-
$use_curl_http_client = false
210+
$use_curl_http_client = false,
211+
$recent_point_threshold = '',
212+
$listen_port = '',
213+
$additional_checksd = '',
214+
$bind_host = '',
215+
$use_pup = false,
216+
$pup_port = '',
217+
$pup_interface = '',
218+
$pup_url = '',
219+
$use_dogstatsd = false,
220+
$dogstatsd_target = '',
221+
$dogstatsd_interval = '',
222+
$dogstatsd_normalize = true,
223+
$device_blacklist_re = '',
224+
$custom_emitters = '',
225+
$collector_log_file = '',
226+
$forwarder_log_file = '',
227+
$dogstatsd_log_file = '',
228+
$pup_log_file = '',
229+
$syslog_host = '',
230+
$syslog_port = '',
122231
) inherits datadog_agent::params {
123232

124233
validate_string($dd_url)
@@ -132,9 +241,11 @@
132241
validate_string($puppetmaster_user)
133242
validate_bool($non_local_traffic)
134243
validate_bool($log_to_syslog)
244+
validate_bool($manage_repo)
135245
validate_string($log_level)
136246
validate_integer($dogstatsd_port)
137247
validate_string($statsd_histogram_percentiles)
248+
validate_string($statsd_forward_port)
138249
validate_string($proxy_host)
139250
validate_string($proxy_port)
140251
validate_string($proxy_user)
@@ -146,6 +257,29 @@
146257
validate_bool($skip_ssl_validation)
147258
validate_bool($skip_apt_key_trusting)
148259
validate_bool($use_curl_http_client)
260+
validate_bool($collect_ec2_tags)
261+
validate_bool($collect_instance_metadata)
262+
validate_string($recent_point_threshold)
263+
validate_string($listen_port)
264+
validate_string($additional_checksd)
265+
validate_string($bind_host)
266+
validate_bool($use_pup)
267+
validate_string($pup_port)
268+
validate_string($pup_interface)
269+
validate_string($pup_url)
270+
validate_bool($use_dogstatsd)
271+
validate_string($dogstatsd_target)
272+
validate_string($dogstatsd_interval)
273+
validate_bool($dogstatsd_normalize)
274+
validate_string($statsd_forward_host)
275+
validate_string($device_blacklist_re)
276+
validate_string($custom_emitters)
277+
validate_string($collector_log_file)
278+
validate_string($forwarder_log_file)
279+
validate_string($dogstatsd_log_file)
280+
validate_string($pup_log_file)
281+
validate_string($syslog_host)
282+
validate_string($syslog_port)
149283

150284
if $hiera_tags {
151285
$local_tags = hiera_array('datadog_agent::tags')
@@ -167,7 +301,11 @@
167301

168302
case $::operatingsystem {
169303
'Ubuntu','Debian' : { include datadog_agent::ubuntu }
170-
'RedHat','CentOS','Fedora','Amazon','Scientific' : { include datadog_agent::redhat }
304+
'RedHat','CentOS','Fedora','Amazon','Scientific' : {
305+
class { 'datadog_agent::redhat':
306+
manage_repo => $manage_repo,
307+
}
308+
}
171309
default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${::operatingsystem}") }
172310
}
173311

@@ -201,9 +339,9 @@
201339

202340
if $puppet_run_reports {
203341
class { 'datadog_agent::reports':
204-
api_key => $api_key,
205-
puppetmaster_user => $puppetmaster_user,
342+
api_key => $api_key,
343+
puppetmaster_user => $puppetmaster_user,
344+
hostname_extraction_regex => $hostname_extraction_regex,
206345
}
207346
}
208-
209347
}

manifests/integrations/apache.pp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,17 @@
2727
# }
2828
#
2929
class datadog_agent::integrations::apache (
30-
$url = 'http://localhost/server-status?auto',
31-
$username = undef,
32-
$password = undef,
33-
$tags = []
30+
$url = 'http://localhost/server-status?auto',
31+
$username = undef,
32+
$password = undef,
33+
$tags = [],
34+
$disable_ssl_validation = false
3435
) inherits datadog_agent::params {
36+
include datadog_agent
3537

3638
validate_string($url)
3739
validate_array($tags)
40+
validate_bool($disable_ssl_validation)
3841

3942
file { "${datadog_agent::params::conf_dir}/apache.yaml":
4043
ensure => file,

manifests/integrations/consul.pp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Class: datadog_agent::integrations::consul
2+
#
3+
# This class will install the necessary configuration for the consul integration
4+
#
5+
# Parameters:
6+
# $url:
7+
# The URL for consul
8+
#
9+
# Sample Usage:
10+
#
11+
# class { 'datadog_agent::integrations::consul' :
12+
# url => "http://localhost:8500"
13+
# }
14+
#
15+
class datadog_agent::integrations::consul(
16+
$url = 'http://localhost:8500'
17+
) inherits datadog_agent::params {
18+
19+
file { "${datadog_agent::params::conf_dir}/consul.yaml":
20+
ensure => file,
21+
owner => $datadog_agent::params::dd_user,
22+
group => $datadog_agent::params::dd_group,
23+
mode => '0644',
24+
content => template('datadog_agent/agent-conf.d/consul.yaml.erb'),
25+
require => Package[$datadog_agent::params::package_name],
26+
notify => Service[$datadog_agent::params::service_name]
27+
}
28+
}

0 commit comments

Comments
 (0)