Skip to content

Commit

Permalink
Merge pull request #176 from DataDog/jaime/preprelease_alt
Browse files Browse the repository at this point in the history
Pre-Release 1.7.0 PR
  • Loading branch information
truthbk committed Apr 13, 2016
2 parents 1e679ce + f5464fe commit ab928a6
Show file tree
Hide file tree
Showing 65 changed files with 2,395 additions and 122 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
Changes
=======

# 1.7.0 / 2016-04-12

### Notes

* [FEATURE] Added manifest for PGBouncer. See [#175][]. (Thanks [@mcasper][]).
* [FEATURE] Added manifest for Consul. See [#174][]. (Thanks [@flyinprogrammer][]).
* [FEATURE] Added mesos master and slave manifests for individual management. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]).
* [FEATURE] Added option to extract the hostname from puppet hostname strings with a regex capture group. See [#173][]. (Thanks [@LeoCavaille][]).
* [FEATURE] Added support on multiple ports per host on Redis integration. See [#169][]. (Thanks [@fzwart][]).
* [FEATURE] Added support for `disable_ssl_validation` on Apache integration. See[#171. (Thanks [@BIAndrews][]).
* [FEATURE] Added support for SSL, additional metrics and database connection in Mongo integration. See [#164][]. (Thanks [@bflad][]).
* [FEATURE] Added support for multiple instance in HTTP check. See [#155][]. (Thanks [@bfla][]d].
* [FEATURE] Added support for multiple new datadog.conf directives. See [#79][]. (Thanks [@obowersa][]).
* [FEATURE] Decouple yum repo from agent package. See [#168][]. (Thanks [@b2jrock][]).

* [IMPROVEMENT] Moved GPG key to its own parameter. See [#158][]. (Thanks [@davidgibbons][]).

* [BUFIX] Updated docker to use more current `docker_daemon`. See [#174][]. (Thanks [@flyinprogrammer][] and [@jangie][]).

* [DEPRECATE] Deprecated old docker manifest. See [#174][]. (Thanks [@flyinprogrammer][]).
* [DEPRECATE] Deprecated `new_tag_names` in `docker_daemon` manifest. See [#174][]. (Thanks [@flyinprogrammer][]).
* [DEPRECATE] Deprecated `use_mount` option in base manifest. See [#174][]. (Thanks [@flyinprogrammer][]).

* [CI] Improved spec and docs. See [#79][]. (Thanks [@obowersa][]).
* [CI] Added multiple tests for integration classes. See [#145][]. (Thanks [@kitchen][]).

# 1.6.0 / 2016-01-20

Expand Down Expand Up @@ -107,14 +132,37 @@ Changes
# 1.0.1

<!--- The following link definition list is generated by PimpMyChangelog --->
[#79]: https://github.com/DataDog/puppet-datadog-agent/issues/79
[#139]: https://github.com/DataDog/puppet-datadog-agent/issues/139
[#145]: https://github.com/DataDog/puppet-datadog-agent/issues/145
[#149]: https://github.com/DataDog/puppet-datadog-agent/issues/149
[#150]: https://github.com/DataDog/puppet-datadog-agent/issues/150
[#154]: https://github.com/DataDog/puppet-datadog-agent/issues/154
[#155]: https://github.com/DataDog/puppet-datadog-agent/issues/155
[#156]: https://github.com/DataDog/puppet-datadog-agent/issues/156
[#158]: https://github.com/DataDog/puppet-datadog-agent/issues/158
[#161]: https://github.com/DataDog/puppet-datadog-agent/issues/161
[#164]: https://github.com/DataDog/puppet-datadog-agent/issues/164
[#168]: https://github.com/DataDog/puppet-datadog-agent/issues/168
[#169]: https://github.com/DataDog/puppet-datadog-agent/issues/169
[#171]: https://github.com/DataDog/puppet-datadog-agent/issues/171
[#173]: https://github.com/DataDog/puppet-datadog-agent/issues/173
[#174]: https://github.com/DataDog/puppet-datadog-agent/issues/174
[#175]: https://github.com/DataDog/puppet-datadog-agent/issues/175
[@BIAndrews]: https://github.com/BIAndrews
[@LeoCavaille]: https://github.com/LeoCavaille
[@MartinDelta]: https://github.com/MartinDelta
[@b2jrock]: https://github.com/b2jrock
[@bfla]: https://github.com/bfla
[@bflad]: https://github.com/bflad
[@davidgibbons]: https://github.com/davidgibbons
[@flyinprogrammer]: https://github.com/flyinprogrammer
[@fzwart]: https://github.com/fzwart
[@grubernaut]: https://github.com/grubernaut
[@jangie]: https://github.com/jangie
[@kitchen]: https://github.com/kitchen
[@mcasper]: https://github.com/mcasper
[@mrunkel-ut]: https://github.com/mrunkel-ut
[@obowersa]: https://github.com/obowersa
[@rtyler]: https://github.com/rtyler
[@tuxinaut]: https://github.com/tuxinaut
14 changes: 14 additions & 0 deletions lib/puppet/reports/datadog_reports.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
config = YAML.load_file(configfile)
API_KEY = config[:datadog_api_key]

# if need be initialize the regex
HOSTNAME_EXTRACTION_REGEX = config[:hostname_extraction_regex]
begin
HOSTNAME_EXTRACTION_REGEX = Regexp.new HOSTNAME_EXTRACTION_REGEX unless HOSTNAME_EXTRACTION_REGEX.nil?
rescue
raise(Puppet::ParseError, "Invalid hostname_extraction_regex #{HOSTNAME_EXTRACTION_REGEX}")
end

desc <<-DESC
Send notification of metrics to Datadog
DESC
Expand All @@ -38,6 +46,12 @@ def pluralize(number, noun)
def process
@summary = self.summary
@msg_host = self.host
unless HOSTNAME_EXTRACTION_REGEX.nil?
m = @msg_host.match(HOSTNAME_EXTRACTION_REGEX)
unless m[:hostname].nil?
@msg_host = m[:hostname]
end
end

event_title = ''
alert_type = ''
Expand Down
160 changes: 149 additions & 11 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# The host of the Datadog intake server to send agent data to.
# Defaults to https://app.datadoghq.com.
# $host:
# Your hostname to see in Datadog. Defaults with Datadog hostname detection.
# $api_key:
# Your DataDog API Key. Please replace with your key value.
# $collect_ec2_tags
Expand All @@ -34,12 +33,14 @@
# $log_level
# Set value of 'log_level' variable. Default is 'info' as in dd-agent.
# Valid values here are: critical, debug, error, fatal, info, warn and warning.
# $hostname_extraction_regex
# Completely optional.
# Instead of reporting the puppet nodename, use this regex to extract the named
# 'hostname' captured group to report the run in Datadog.
# ex.: '^(?<hostname>.*\.datadoghq\.com)(\.i-\w{8}\..*)?$'
# $log_to_syslog
# Set value of 'log_to_syslog' variable. Default is true -> yes as in dd-agent.
# Valid values here are: true or false.
# $use_mount
# Allow overriding default of tracking disks by device path instead of mountpoint
# Valid values here are: true or false.
# $dogstatsd_port
# Set value of the 'dogstatsd_port' variable. Defaultis 8125.
# $statsd_forward_host
Expand All @@ -48,6 +49,9 @@
# $statsd_forward_port
# Set the value of the statsd_forward_port varable. Used to forward all
# statsd metrics to another host.
# $manage_repo
# Boolean to indicate whether this module should attempt to manage
# the package repo. Default true.
# $proxy_host
# Set value of 'proxy_host' variable. Default is blank.
# $proxy_port
Expand All @@ -68,6 +72,90 @@
# Skip SSL validation.
# $use_curl_http_client
# Uses the curl HTTP client for the forwarder
# $collect_ec2_tas
# Presents custom EC2 tags as agent tags to datadog
# Boolean. Default: False
# $collect_instance_metadata
# Enables the agent to try and gather instance metadata on EC2/GCE
# Boolean. Default: true
# $recent_point_threshold
# Sets the threshold for accepting points.
# String. Default: empty (30 second intervals)
# $listen_port
# Change the port that the agent listens on
# String. Default: empty (port 17123 in dd-agent)
# $additional_checksd
# Additional directory to look for datadog checks in
# String. Default: empty
# $bind_host
# The loopback address the forwarder and Dogstatsd will bind.
# String. Default: empty
# $use_pup
# Enables the local pup dashboard
# Boolean. Default: false
# $pup_port
# Specifies the port to be used by pup. Must have use_pup set
# String. Default: empty
# $pup_interface
# Specifies which interface pup will use. Must have use_pup set
# String. Default: empty
# $pup_url
# Specifies the URL used to access pup. Must have use_pup set
# String. Default: empty
# $use_dogstatsd
# Enables the dogstatsd server
# Boolean. Default: false
# $dogstatsd_port
# Specifies the port to be used by dogstatsd. Must have use_dogstatsd set
# String. Default: empty
# $dogstatsd_target
# Change the target to be used by dogstatsd. Must have use_dogstatsd set
# set
# String. Default: empty
# $dogstatsd_interval
# Change the dogstatsd flush period. Must have use_dogstatsd set
# String. Default: empty ( 10 second interval)
# $dogstatsd_normalize
# Enables 1 second nomralization. Must have use_dogstatsd set
# Boolean. Default: true
# $statsd_forward_host
# Enables forwarding of statsd packetsto host. Must have use_dogstatsd set
# String. Default: empty
# $statsd_forward_port
# Specifis port for $statsd_forward_host. Must have use_dogstatsd set
# String. Default: empty
# $device_blacklist_re
# Specifies pattern for device blacklisting.
# String. Default: empty
# $ganglia_host
# Specifies host where gmetad is running
# String. Default: empty
# $ganglia_port
# Specifies port for $ganglia_host
# String. Default: empty
# $dogstreams
# Specifies port for list of logstreams/modules to be used.
# String. Default: empty
# $custom_emitters
# Specifies a comma seperated list of non standard emitters to be used
# String. Default: empty
# $custom_emitters
# Specifies a comma seperated list of non standard emitters to be used
# String. Default: empty
# $collector_log_file
# Specifies the log file location for the collector system
# String. Default: empty
# $forwarder_log_file
# Specifies the log file location for the forwarder system
# String. Default: empty
# $dogstatsd
# Specifies the log file location for the dogstatsd system
# String. Default: empty
# $pup_log_file
# Specifies the log file location for the pup system
# String. Default: empty
#
#
# Actions:
#
# Requires:
Expand Down Expand Up @@ -103,10 +191,11 @@
$log_to_syslog = true,
$service_ensure = 'running',
$service_enable = true,
$use_mount = false,
$manage_repo = true,
$hostname_extraction_regex = nil,
$dogstatsd_port = 8125,
$statsd_forward_host = '',
$statsd_forward_port = 8125,
$statsd_forward_port = '',
$statsd_histogram_percentiles = '0.95',
$proxy_host = '',
$proxy_port = '',
Expand All @@ -118,7 +207,27 @@
$ganglia_port = 8651,
$skip_ssl_validation = false,
$skip_apt_key_trusting = false,
$use_curl_http_client = false
$use_curl_http_client = false,
$recent_point_threshold = '',
$listen_port = '',
$additional_checksd = '',
$bind_host = '',
$use_pup = false,
$pup_port = '',
$pup_interface = '',
$pup_url = '',
$use_dogstatsd = false,
$dogstatsd_target = '',
$dogstatsd_interval = '',
$dogstatsd_normalize = true,
$device_blacklist_re = '',
$custom_emitters = '',
$collector_log_file = '',
$forwarder_log_file = '',
$dogstatsd_log_file = '',
$pup_log_file = '',
$syslog_host = '',
$syslog_port = '',
) inherits datadog_agent::params {

validate_string($dd_url)
Expand All @@ -132,9 +241,11 @@
validate_string($puppetmaster_user)
validate_bool($non_local_traffic)
validate_bool($log_to_syslog)
validate_bool($manage_repo)
validate_string($log_level)
validate_integer($dogstatsd_port)
validate_string($statsd_histogram_percentiles)
validate_string($statsd_forward_port)
validate_string($proxy_host)
validate_string($proxy_port)
validate_string($proxy_user)
Expand All @@ -146,6 +257,29 @@
validate_bool($skip_ssl_validation)
validate_bool($skip_apt_key_trusting)
validate_bool($use_curl_http_client)
validate_bool($collect_ec2_tags)
validate_bool($collect_instance_metadata)
validate_string($recent_point_threshold)
validate_string($listen_port)
validate_string($additional_checksd)
validate_string($bind_host)
validate_bool($use_pup)
validate_string($pup_port)
validate_string($pup_interface)
validate_string($pup_url)
validate_bool($use_dogstatsd)
validate_string($dogstatsd_target)
validate_string($dogstatsd_interval)
validate_bool($dogstatsd_normalize)
validate_string($statsd_forward_host)
validate_string($device_blacklist_re)
validate_string($custom_emitters)
validate_string($collector_log_file)
validate_string($forwarder_log_file)
validate_string($dogstatsd_log_file)
validate_string($pup_log_file)
validate_string($syslog_host)
validate_string($syslog_port)

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

case $::operatingsystem {
'Ubuntu','Debian' : { include datadog_agent::ubuntu }
'RedHat','CentOS','Fedora','Amazon','Scientific' : { include datadog_agent::redhat }
'RedHat','CentOS','Fedora','Amazon','Scientific' : {
class { 'datadog_agent::redhat':
manage_repo => $manage_repo,
}
}
default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${::operatingsystem}") }
}

Expand Down Expand Up @@ -201,9 +339,9 @@

if $puppet_run_reports {
class { 'datadog_agent::reports':
api_key => $api_key,
puppetmaster_user => $puppetmaster_user,
api_key => $api_key,
puppetmaster_user => $puppetmaster_user,
hostname_extraction_regex => $hostname_extraction_regex,
}
}

}
11 changes: 7 additions & 4 deletions manifests/integrations/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@
# }
#
class datadog_agent::integrations::apache (
$url = 'http://localhost/server-status?auto',
$username = undef,
$password = undef,
$tags = []
$url = 'http://localhost/server-status?auto',
$username = undef,
$password = undef,
$tags = [],
$disable_ssl_validation = false
) inherits datadog_agent::params {
include datadog_agent

validate_string($url)
validate_array($tags)
validate_bool($disable_ssl_validation)

file { "${datadog_agent::params::conf_dir}/apache.yaml":
ensure => file,
Expand Down
28 changes: 28 additions & 0 deletions manifests/integrations/consul.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Class: datadog_agent::integrations::consul
#
# This class will install the necessary configuration for the consul integration
#
# Parameters:
# $url:
# The URL for consul
#
# Sample Usage:
#
# class { 'datadog_agent::integrations::consul' :
# url => "http://localhost:8500"
# }
#
class datadog_agent::integrations::consul(
$url = 'http://localhost:8500'
) inherits datadog_agent::params {

file { "${datadog_agent::params::conf_dir}/consul.yaml":
ensure => file,
owner => $datadog_agent::params::dd_user,
group => $datadog_agent::params::dd_group,
mode => '0644',
content => template('datadog_agent/agent-conf.d/consul.yaml.erb'),
require => Package[$datadog_agent::params::package_name],
notify => Service[$datadog_agent::params::service_name]
}
}
Loading

0 comments on commit ab928a6

Please sign in to comment.