From: Yadnesh Kulkarni Date: Fri, 9 Sep 2022 15:18:40 +0000 (+0000) Subject: Add new parameter `tenant_name_discovery` X-Git-Tag: 21.0.0~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=b00000fb86e2882c11fb399d9adf410812a895bd;p=puppet-modules%2Fpuppet-ceilometer.git Add new parameter `tenant_name_discovery` Enabling this parameter will identify user and project names from the polled metrics [1]. These details are collected by making additional requests to keystone service, depending upon the scale of environment, number of projects/users and the count of metrics polled in every iteration, enabling this could overwhelm the keystone service. [1] Iee5dbf09a1fd3ac571746fc66d2683eb8e6a1b27 Depends-on: https://review.opendev.org/852948 Signed-off-by: Yadnesh Kulkarni Change-Id: I045c7cd7a86d0f7f97a9078cbfc74353dcff0eb8 --- diff --git a/manifests/agent/polling.pp b/manifests/agent/polling.pp index 4008e09..8305c95 100644 --- a/manifests/agent/polling.pp +++ b/manifests/agent/polling.pp @@ -73,6 +73,10 @@ # (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, @@ -89,6 +93,7 @@ class ceilometer::agent::polling ( $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 @@ -96,8 +101,16 @@ class ceilometer::agent::polling ( 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 { diff --git a/releasenotes/notes/add_tenant_name_discovery-4671aec3daae9622.yaml b/releasenotes/notes/add_tenant_name_discovery-4671aec3daae9622.yaml new file mode 100644 index 0000000..5c879ee --- /dev/null +++ b/releasenotes/notes/add_tenant_name_discovery-4671aec3daae9622.yaml @@ -0,0 +1,7 @@ +--- +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. diff --git a/spec/classes/ceilometer_agent_polling_spec.rb b/spec/classes/ceilometer_agent_polling_spec.rb index 873bbe4..e1c5fc1 100644 --- a/spec/classes/ceilometer_agent_polling_spec.rb +++ b/spec/classes/ceilometer_agent_polling_spec.rb @@ -38,6 +38,7 @@ describe 'ceilometer::agent::polling' do )} it { + should contain_ceilometer_config('DEFAULT/tenant_name_discovery').with_value('') should contain_ceilometer_config('compute/instance_discovery_method').with_value('') should contain_ceilometer_config('compute/resource_update_interval').with_value('') should contain_ceilometer_config('compute/resource_cache_expiry').with_value('') @@ -90,6 +91,18 @@ describe 'ceilometer::agent::polling' do } 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!( @@ -105,6 +118,19 @@ describe 'ceilometer::agent::polling' do } 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!(