Add statsd configuration to zuul.

And allow zuul to send to statsd.

Change-Id: Ie9f78268a673523c4ea4025bdbbe40d8d3819398
Reviewed-on: https://review.openstack.org/18658
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Approved: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
James E. Blair 2012-12-26 10:48:15 -08:00 committed by Jenkins
parent cfd1276ebc
commit 8250da7911
4 changed files with 23 additions and 3 deletions

View File

@ -103,7 +103,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 => ['jenkins.openstack.org'],
statsd_hosts => ['jenkins.openstack.org',
'zuul.openstack.org'],
}
}
@ -197,6 +198,7 @@ node 'zuul.openstack.org' {
zuul_ssh_private_key => hiera('jenkins_ssh_private_key_contents'),
url_pattern => 'http://logs.openstack.org/{change.number}/{change.patchset}/{pipeline.name}/{job.name}/{build.number}',
sysadmins => hiera('sysadmins'),
statsd_host => 'graphite.openstack.org',
}
}

View File

@ -10,7 +10,8 @@ class openstack_project::zuul(
$gerrit_user = '',
$zuul_ssh_private_key = '',
$url_pattern = '',
$sysadmins = []
$sysadmins = [],
$statsd_host = ''
) {
$rules = [ "-m state --state NEW -m tcp -p tcp --dport 8001 -s ${jenkins_host} -j ACCEPT" ]

View File

@ -12,7 +12,8 @@ class zuul (
$url_pattern = '',
$status_url = "https://${::fqdn}/",
$git_source_repo = 'https://github.com/openstack-infra/zuul.git',
$push_change_refs = false
$push_change_refs = false,
$statsd_host = ''
) {
include apache
@ -46,6 +47,12 @@ class zuul (
}
}
package { 'statsd':
ensure => latest, # okay to use latest for pip
provider => pip,
require => Class[pip],
}
user { 'zuul':
ensure => present,
home => '/home/zuul',
@ -103,6 +110,12 @@ class zuul (
],
}
file { '/etc/default/zuul':
ensure => present,
mode => '0444',
content => template('zuul/zuul.default.erb'),
}
file { '/var/log/zuul':
ensure => directory,
owner => 'zuul',

View File

@ -0,0 +1,4 @@
<% if scope.lookupvar("zuul::statsd_host") != "" %>
export STATSD_HOST=<%= scope.lookupvar("zuul::statsd_host") %>
export STATSD_PORT=8125
<% end %>