Add customization for wsgi process display name

when ceilometer api is deployed in httpd, however
 the process name is like '/usr/sbin/httpd -DFOREGROUND',
it is ambiguous and make monitoring more difficult.
the aodh, gnocchi module are also like that.
so we should set an appropriate name for wsgi process.

Change-Id: I5e8c9be062a88e9ed6442e6cbce6573fba385030
Related-Bug: #1626550
This commit is contained in:
Xing Zhou
2016-12-15 15:18:42 +08:00
parent d91a4c7b36
commit ed9c5cf626
2 changed files with 48 additions and 40 deletions

View File

@@ -99,6 +99,10 @@
# (optional) Name of the WSGI daemon process. # (optional) Name of the WSGI daemon process.
# Defaults to $name # Defaults to $name
# #
# [*wsgi_process_display_name*]
# (optional) Name of the WSGI process display-name.
# Defaults to $name
#
# [*wsgi_process_group*] # [*wsgi_process_group*]
# (optional) Name of the WSGI process group. # (optional) Name of the WSGI process group.
# Defaults to $name # Defaults to $name
@@ -143,34 +147,35 @@
# Defaults to undef. # Defaults to undef.
# #
define openstacklib::wsgi::apache ( define openstacklib::wsgi::apache (
$service_name = $name, $service_name = $name,
$bind_host = undef, $bind_host = undef,
$bind_port = undef, $bind_port = undef,
$group = undef, $group = undef,
$path = '/', $path = '/',
$priority = '10', $priority = '10',
$servername = $::fqdn, $servername = $::fqdn,
$ssl = false, $ssl = false,
$ssl_ca = undef, $ssl_ca = undef,
$ssl_cert = undef, $ssl_cert = undef,
$ssl_certs_dir = undef, $ssl_certs_dir = undef,
$ssl_chain = undef, $ssl_chain = undef,
$ssl_crl = undef, $ssl_crl = undef,
$ssl_crl_path = undef, $ssl_crl_path = undef,
$ssl_key = undef, $ssl_key = undef,
$threads = $::os_workers, $threads = $::os_workers,
$user = undef, $user = undef,
$workers = 1, $workers = 1,
$wsgi_daemon_process = $name, $wsgi_daemon_process = $name,
$wsgi_process_group = $name, $wsgi_process_display_name = $name,
$wsgi_script_dir = undef, $wsgi_process_group = $name,
$wsgi_script_file = undef, $wsgi_script_dir = undef,
$wsgi_script_source = undef, $wsgi_script_file = undef,
$wsgi_application_group = '%{GLOBAL}', $wsgi_script_source = undef,
$wsgi_pass_authorization = undef, $wsgi_application_group = '%{GLOBAL}',
$wsgi_chunked_request = undef, $wsgi_pass_authorization = undef,
$vhost_custom_fragment = undef, $wsgi_chunked_request = undef,
$allow_encoded_slashes = undef, $vhost_custom_fragment = undef,
$allow_encoded_slashes = undef,
) { ) {
include ::apache include ::apache
@@ -202,10 +207,11 @@ define openstacklib::wsgi::apache (
} }
$wsgi_daemon_process_options = { $wsgi_daemon_process_options = {
user => $user, user => $user,
group => $group, group => $group,
processes => $workers, processes => $workers,
threads => $threads, threads => $threads,
display-name => $wsgi_process_display_name,
} }
$wsgi_script_aliases = hash([$path_real,"${wsgi_script_dir}/${wsgi_script_file}"]) $wsgi_script_aliases = hash([$path_real,"${wsgi_script_dir}/${wsgi_script_file}"])

View File

@@ -76,10 +76,11 @@ describe 'openstacklib::wsgi::apache' do
'wsgi_process_group' => 'keystone_wsgi', 'wsgi_process_group' => 'keystone_wsgi',
'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" }, 'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" },
'wsgi_daemon_process_options' => { 'wsgi_daemon_process_options' => {
'user' => 'keystone', 'user' => 'keystone',
'group' => 'keystone', 'group' => 'keystone',
'processes' => 1, 'processes' => 1,
'threads' => global_facts[:os_workers], 'threads' => global_facts[:os_workers],
'display-name' => 'keystone_wsgi',
}, },
'wsgi_application_group' => '%{GLOBAL}', 'wsgi_application_group' => '%{GLOBAL}',
'require' => 'File[keystone_wsgi]', 'require' => 'File[keystone_wsgi]',
@@ -115,10 +116,11 @@ describe 'openstacklib::wsgi::apache' do
'ssl' => 'false', 'ssl' => 'false',
'wsgi_daemon_process' => 'keystone_wsgi', 'wsgi_daemon_process' => 'keystone_wsgi',
'wsgi_daemon_process_options' => { 'wsgi_daemon_process_options' => {
'user' => 'keystone', 'user' => 'keystone',
'group' => 'keystone', 'group' => 'keystone',
'processes' => '37', 'processes' => '37',
'threads' => '8', 'threads' => '8',
'display-name' => 'keystone_wsgi',
}, },
'wsgi_process_group' => 'keystone_wsgi', 'wsgi_process_group' => 'keystone_wsgi',
'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" }, 'wsgi_script_aliases' => { '/' => "/var/www/cgi-bin/keystone/main" },