Merge "Avoid collecting logs and notifications uselessly"
This commit is contained in:
@@ -355,7 +355,7 @@ if hiera('lma::collector::influxdb::server', false) {
|
||||
}
|
||||
}
|
||||
|
||||
if $is_rabbitmq {
|
||||
if $is_rabbitmq and (hiera('lma::collector::elasticsearch::server', false) or hiera('lma::collector::influxdb::server', false)){
|
||||
# OpenStack notifications are always useful for indexation and metrics
|
||||
# collection
|
||||
$messaging_address = get_network_role_property('mgmt/messaging', 'ipaddr')
|
||||
|
||||
@@ -54,214 +54,214 @@ Service<| title == 'metric_collector' |> {
|
||||
provider => 'pacemaker'
|
||||
}
|
||||
|
||||
# Sahara notifications
|
||||
if $sahara['enabled'] {
|
||||
include sahara::params
|
||||
$sahara_api_service = $::sahara::params::api_service_name
|
||||
$sahara_engine_service = $::sahara::params::engine_service_name
|
||||
# OpenStack logs and notifications are useful for deriving metrics, so we enable
|
||||
# them even if Elasticsearch is disabled.
|
||||
if hiera('lma::collector::elasticsearch::server', false) or hiera('lma::collector::influxdb::server', false){
|
||||
# Sahara notifications
|
||||
if $sahara['enabled'] {
|
||||
include sahara::params
|
||||
$sahara_api_service = $::sahara::params::api_service_name
|
||||
$sahara_engine_service = $::sahara::params::engine_service_name
|
||||
|
||||
sahara_config { 'DEFAULT/enable_notifications':
|
||||
value => true,
|
||||
notify => Service[$sahara_api_service, $sahara_engine_service],
|
||||
sahara_config { 'DEFAULT/enable_notifications':
|
||||
value => true,
|
||||
notify => Service[$sahara_api_service, $sahara_engine_service],
|
||||
}
|
||||
sahara_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$sahara_api_service, $sahara_engine_service],
|
||||
}
|
||||
sahara_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$sahara_api_service, $sahara_engine_service],
|
||||
}
|
||||
|
||||
service { [$sahara_api_service, $sahara_engine_service]:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
}
|
||||
sahara_config { 'DEFAULT/notification_topics':
|
||||
|
||||
# Nova notifications
|
||||
include nova::params
|
||||
$nova_api_service = $::nova::params::api_service_name
|
||||
$nova_conductor_service = $::nova::params::conductor_service_name
|
||||
$nova_scheduler_service = $::nova::params::scheduler_service_name
|
||||
|
||||
nova_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$sahara_api_service, $sahara_engine_service],
|
||||
notify => Service[$nova_api_service, $nova_conductor_service, $nova_scheduler_service],
|
||||
}
|
||||
sahara_config { 'DEFAULT/notification_driver':
|
||||
nova_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$sahara_api_service, $sahara_engine_service],
|
||||
notify => Service[$nova_api_service, $nova_conductor_service, $nova_scheduler_service],
|
||||
}
|
||||
nova_config { 'DEFAULT/notify_on_state_change':
|
||||
value => 'vm_and_task_state',
|
||||
notify => Service[$nova_api_service, $nova_conductor_service, $nova_scheduler_service],
|
||||
}
|
||||
|
||||
service { [$sahara_api_service, $sahara_engine_service]:
|
||||
service { [$nova_api_service, $nova_conductor_service, $nova_scheduler_service]:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
}
|
||||
|
||||
# Nova notifications
|
||||
include nova::params
|
||||
$nova_api_service = $::nova::params::api_service_name
|
||||
$nova_conductor_service = $::nova::params::conductor_service_name
|
||||
$nova_scheduler_service = $::nova::params::scheduler_service_name
|
||||
# Cinder notifications
|
||||
include cinder::params
|
||||
$cinder_api_service = $::cinder::params::api_service
|
||||
$cinder_scheduler_service = $::cinder::params::scheduler_service
|
||||
$cinder_volume_service = $::cinder::params::volume_service
|
||||
|
||||
nova_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$nova_api_service, $nova_conductor_service, $nova_scheduler_service],
|
||||
}
|
||||
nova_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$nova_api_service, $nova_conductor_service, $nova_scheduler_service],
|
||||
}
|
||||
nova_config { 'DEFAULT/notify_on_state_change':
|
||||
value => 'vm_and_task_state',
|
||||
notify => Service[$nova_api_service, $nova_conductor_service, $nova_scheduler_service],
|
||||
}
|
||||
|
||||
service { [$nova_api_service, $nova_conductor_service, $nova_scheduler_service]:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Cinder notifications
|
||||
include cinder::params
|
||||
$cinder_api_service = $::cinder::params::api_service
|
||||
$cinder_scheduler_service = $::cinder::params::scheduler_service
|
||||
$cinder_volume_service = $::cinder::params::volume_service
|
||||
|
||||
if $storage_options['volumes_ceph'] {
|
||||
# In this case, cinder-volume runs on controller node
|
||||
$cinder_services = [$cinder_api_service, $cinder_scheduler_service, $cinder_volume_service]
|
||||
} else {
|
||||
$cinder_services = [$cinder_api_service, $cinder_scheduler_service]
|
||||
}
|
||||
|
||||
cinder_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$cinder_services],
|
||||
}
|
||||
cinder_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$cinder_services],
|
||||
}
|
||||
|
||||
service { $cinder_services:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Keystone notifications
|
||||
# Keystone is executed as a WSGI application inside Apache so the Apache
|
||||
# service needs to be restarted if necessary
|
||||
include apache::params
|
||||
include apache::service
|
||||
|
||||
keystone_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Class['apache::service'],
|
||||
}
|
||||
keystone_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Class['apache::service'],
|
||||
}
|
||||
|
||||
# Neutron notifications
|
||||
include neutron::params
|
||||
|
||||
neutron_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$::neutron::params::server_service],
|
||||
}
|
||||
neutron_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$::neutron::params::server_service],
|
||||
}
|
||||
|
||||
service { $::neutron::params::server_service:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Glance notifications
|
||||
include glance::params
|
||||
|
||||
$glance_api_service = $::glance::params::api_service_name
|
||||
$glance_registry_service = $::glance::params::registry_service_name
|
||||
|
||||
# Default value is 'image.localhost' for Glance
|
||||
$glance_publisher_id = "image.${::hostname}"
|
||||
|
||||
glance_api_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$glance_api_service],
|
||||
}
|
||||
glance_api_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$glance_api_service],
|
||||
}
|
||||
glance_api_config { 'DEFAULT/default_publisher_id':
|
||||
value => $glance_publisher_id,
|
||||
notify => Service[$glance_api_service],
|
||||
}
|
||||
glance_registry_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$glance_registry_service],
|
||||
}
|
||||
glance_registry_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$glance_registry_service],
|
||||
}
|
||||
glance_registry_config { 'DEFAULT/default_publisher_id':
|
||||
value => $glance_publisher_id,
|
||||
notify => Service[$glance_registry_service],
|
||||
}
|
||||
|
||||
service { [$glance_api_service, $glance_registry_service]:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Heat notifications
|
||||
include heat::params
|
||||
|
||||
$heat_api_service = $::heat::params::api_service_name
|
||||
$heat_engine_service = $::heat::params::engine_service_name
|
||||
|
||||
heat_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$heat_api_service, $heat_engine_service],
|
||||
}
|
||||
heat_config { 'DEFAULT/notification_driver':
|
||||
value => $driver,
|
||||
notify => Service[$heat_api_service, $heat_engine_service],
|
||||
}
|
||||
|
||||
service { $heat_api_service:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# The heat-engine service is managed by Pacemaker.
|
||||
service { $heat_engine_service:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
provider => 'pacemaker',
|
||||
}
|
||||
|
||||
# OpenStack logs are useful for deriving HTTP metrics, so we enable them even
|
||||
# if Elasticsearch is disabled.
|
||||
lma_collector::logs::openstack { 'nova': }
|
||||
|
||||
# For every virtual network that exists, Neutron spawns one metadata proxy
|
||||
# service that will log to a separate file in the Neutron log directory.
|
||||
# Eventually it may be hundreds of these files and Heka will have trouble
|
||||
# coping with the situation. See bug #1547402 for details.
|
||||
lma_collector::logs::openstack { 'neutron':
|
||||
service_match => '(dhcp-agent|l3-agent|metadata-agent|neutron-netns-cleanup|openvswitch-agent|server)',
|
||||
}
|
||||
lma_collector::logs::openstack { 'cinder': }
|
||||
lma_collector::logs::openstack { 'glance': }
|
||||
lma_collector::logs::openstack { 'heat': }
|
||||
lma_collector::logs::openstack { 'keystone': }
|
||||
class {'lma_collector::logs::keystone_wsgi': }
|
||||
lma_collector::logs::openstack { 'horizon': }
|
||||
|
||||
if $murano['enabled'] {
|
||||
lma_collector::logs::openstack { 'murano': }
|
||||
}
|
||||
|
||||
if $sahara['enabled'] {
|
||||
lma_collector::logs::openstack { 'sahara': }
|
||||
}
|
||||
|
||||
if ! $storage_options['objects_ceph'] {
|
||||
class { 'lma_collector::logs::swift':
|
||||
file_match => 'swift-all\.log\.?(?P<Seq>\d*)$',
|
||||
priority => '["^Seq"]',
|
||||
if $storage_options['volumes_ceph'] {
|
||||
# In this case, cinder-volume runs on controller node
|
||||
$cinder_services = [$cinder_api_service, $cinder_scheduler_service, $cinder_volume_service]
|
||||
} else {
|
||||
$cinder_services = [$cinder_api_service, $cinder_scheduler_service]
|
||||
}
|
||||
|
||||
cinder_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$cinder_services],
|
||||
}
|
||||
cinder_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$cinder_services],
|
||||
}
|
||||
|
||||
service { $cinder_services:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Keystone notifications
|
||||
# Keystone is executed as a WSGI application inside Apache so the Apache
|
||||
# service needs to be restarted if necessary
|
||||
include apache::params
|
||||
include apache::service
|
||||
|
||||
keystone_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Class['apache::service'],
|
||||
}
|
||||
keystone_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Class['apache::service'],
|
||||
}
|
||||
|
||||
# Neutron notifications
|
||||
include neutron::params
|
||||
|
||||
neutron_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$::neutron::params::server_service],
|
||||
}
|
||||
neutron_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$::neutron::params::server_service],
|
||||
}
|
||||
|
||||
service { $::neutron::params::server_service:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Glance notifications
|
||||
include glance::params
|
||||
|
||||
$glance_api_service = $::glance::params::api_service_name
|
||||
$glance_registry_service = $::glance::params::registry_service_name
|
||||
|
||||
# Default value is 'image.localhost' for Glance
|
||||
$glance_publisher_id = "image.${::hostname}"
|
||||
|
||||
glance_api_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$glance_api_service],
|
||||
}
|
||||
glance_api_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$glance_api_service],
|
||||
}
|
||||
glance_api_config { 'DEFAULT/default_publisher_id':
|
||||
value => $glance_publisher_id,
|
||||
notify => Service[$glance_api_service],
|
||||
}
|
||||
glance_registry_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$glance_registry_service],
|
||||
}
|
||||
glance_registry_config { 'DEFAULT/notification_driver':
|
||||
value => 'messaging',
|
||||
notify => Service[$glance_registry_service],
|
||||
}
|
||||
glance_registry_config { 'DEFAULT/default_publisher_id':
|
||||
value => $glance_publisher_id,
|
||||
notify => Service[$glance_registry_service],
|
||||
}
|
||||
|
||||
service { [$glance_api_service, $glance_registry_service]:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# Heat notifications
|
||||
include heat::params
|
||||
|
||||
$heat_api_service = $::heat::params::api_service_name
|
||||
$heat_engine_service = $::heat::params::engine_service_name
|
||||
|
||||
heat_config { 'DEFAULT/notification_topics':
|
||||
value => $notification_topics,
|
||||
notify => Service[$heat_api_service, $heat_engine_service],
|
||||
}
|
||||
heat_config { 'DEFAULT/notification_driver':
|
||||
value => $driver,
|
||||
notify => Service[$heat_api_service, $heat_engine_service],
|
||||
}
|
||||
|
||||
service { $heat_api_service:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
}
|
||||
|
||||
# The heat-engine service is managed by Pacemaker.
|
||||
service { $heat_engine_service:
|
||||
hasstatus => true,
|
||||
hasrestart => true,
|
||||
provider => 'pacemaker',
|
||||
}
|
||||
|
||||
lma_collector::logs::openstack { 'nova': }
|
||||
|
||||
# For every virtual network that exists, Neutron spawns one metadata proxy
|
||||
# service that will log to a separate file in the Neutron log directory.
|
||||
# Eventually it may be hundreds of these files and Heka will have trouble
|
||||
# coping with the situation. See bug #1547402 for details.
|
||||
lma_collector::logs::openstack { 'neutron':
|
||||
service_match => '(dhcp-agent|l3-agent|metadata-agent|neutron-netns-cleanup|openvswitch-agent|server)',
|
||||
}
|
||||
lma_collector::logs::openstack { 'cinder': }
|
||||
lma_collector::logs::openstack { 'glance': }
|
||||
lma_collector::logs::openstack { 'heat': }
|
||||
lma_collector::logs::openstack { 'keystone': }
|
||||
class {'lma_collector::logs::keystone_wsgi': }
|
||||
lma_collector::logs::openstack { 'horizon': }
|
||||
|
||||
if $murano['enabled'] {
|
||||
lma_collector::logs::openstack { 'murano': }
|
||||
}
|
||||
|
||||
if $sahara['enabled'] {
|
||||
lma_collector::logs::openstack { 'sahara': }
|
||||
}
|
||||
|
||||
if ! $storage_options['objects_ceph'] {
|
||||
class { 'lma_collector::logs::swift':
|
||||
file_match => 'swift-all\.log\.?(?P<Seq>\d*)$',
|
||||
priority => '["^Seq"]',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if hiera('lma::collector::elasticsearch::server', false) {
|
||||
class { 'lma_collector::logs::pacemaker': }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user