# (Optional) Batch size of samples to send to notification agent.
# Defaults to $::os_service_default
#
+# [*tenant_name_discovery*]
+# (optional) Identify user and project names from polled metrics.
+# Defaults to $::os_service_default.
+#
class ceilometer::agent::polling (
$manage_service = true,
$enabled = true,
$polling_meters = $::ceilometer::params::polling_meters,
$polling_config = undef,
$batch_size = $::os_service_default,
+ $tenant_name_discovery = $::os_service_default,
) inherits ceilometer {
include ceilometer::deps
if $central_namespace {
$central_namespace_name = 'central'
+ ceilometer_config {
+ # set `tenant_name_discovery` parameter only on the nodes
+ # where central namespace is enabled
+ 'DEFAULT/tenant_name_discovery': value => $tenant_name_discovery;
+ }
} else {
$central_namespace_name = undef
+ ceilometer_config {
+ 'DEFAULT/tenant_name_discovery': ensure => absent;
+ }
}
if $compute_namespace {
--- /dev/null
+---
+features:
+ - |
+ Add new parameter ``tenant_name_discovery``, whether to
+ idenitfy user and project names from polled samples.
+ This paramater is to be configured only when ceilometer
+ central namespace is enabled.
)}
it {
+ should contain_ceilometer_config('DEFAULT/tenant_name_discovery').with_value('<SERVICE DEFAULT>')
should contain_ceilometer_config('compute/instance_discovery_method').with_value('<SERVICE DEFAULT>')
should contain_ceilometer_config('compute/resource_update_interval').with_value('<SERVICE DEFAULT>')
should contain_ceilometer_config('compute/resource_cache_expiry').with_value('<SERVICE DEFAULT>')
}
end
+ context 'with central parameters set' do
+ before do
+ params.merge!(
+ :tenant_name_discovery => false
+ )
+ end
+
+ it {
+ should contain_ceilometer_config('DEFAULT/tenant_name_discovery').with_value(false)
+ }
+ end
+
context 'with compute namespace disabled' do
before do
params.merge!(
}
end
+ context 'with central namespace disabled' do
+ before do
+ params.merge!(
+ :central_namespace => false,
+ )
+ end
+
+ it {
+ should contain_ceilometer_config('DEFAULT/polling_namespaces').with_value('compute,ipmi')
+ should contain_ceilometer_config('DEFAULT/tenant_name_discovery').with_ensure('absent')
+ }
+ end
+
context 'with central and ipmi polling namespaces disabled' do
before do
params.merge!(