Enable statsd for jenkins-log-client

Change-Id: I4395ce2151fc666cae1d9ea76b43bc3663e98ac8
This commit is contained in:
James E. Blair 2014-02-21 10:53:38 -08:00
parent 522f4a2ded
commit 032ab0d470
4 changed files with 19 additions and 1 deletions

View File

@ -226,7 +226,8 @@ node 'graphite.openstack.org' {
graphite_admin_user => hiera('graphite_admin_user'),
graphite_admin_email => hiera('graphite_admin_email'),
graphite_admin_password => hiera('graphite_admin_password'),
statsd_hosts => ['nodepool.openstack.org',
statsd_hosts => ['logstash.openstack.org',
'nodepool.openstack.org',
'zuul.openstack.org'],
}
}

View File

@ -17,6 +17,7 @@
#
class log_processor::client (
$config_file,
$statsd_host = '',
) {
file { '/etc/logstash/jenkins-log-client.yaml':
@ -37,9 +38,18 @@ class log_processor::client (
require => [
File['/usr/local/bin/log-gearman-client.py'],
File['/etc/logstash/jenkins-log-client.yaml'],
File['/etc/default/jenkins-log-client'],
],
}
file { '/etc/default/jenkins-log-client':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
content => template('log_processor/jenkins-log-client.default.erb'),
}
service { 'jenkins-log-client':
enable => true,
hasrestart => true,

View File

@ -0,0 +1,5 @@
<% if scope.lookupvar("log_processor::client::statsd_host") != "" %>
export STATSD_HOST=<%= scope.lookupvar("log_processor::client::statsd_host") %>
export STATSD_PORT=8125
export STATSD_PREFIX="logstash.geard"
<% end %>

View File

@ -18,6 +18,7 @@ class openstack_project::logstash (
$elasticsearch_nodes = [],
$gearman_workers = [],
$discover_nodes = ['elasticsearch.openstack.org:9200'],
$statsd_host = 'graphite.openstack.org',
$sysadmins = []
) {
$iptables_es_rule = regsubst ($elasticsearch_nodes, '^(.*)$', '-m state --state NEW -m tcp -p tcp --dport 9200:9400 -s \1 -j ACCEPT')
@ -40,5 +41,6 @@ class openstack_project::logstash (
class { 'log_processor::client':
config_file => 'puppet:///modules/openstack_project/logstash/jenkins-log-client.yaml',
statsd_host => $statsd_host,
}
}