]> review.fuel-infra Code Review - puppet-modules/puppet-ceilometer.git/commitdiff
Add new parameter `tenant_name_discovery` stable/xena 19.5.0
authorYadnesh Kulkarni <ykulkarn@redhat.com>
Fri, 9 Sep 2022 15:18:40 +0000 (15:18 +0000)
committerTakashi Kajinami <tkajinam@redhat.com>
Fri, 21 Apr 2023 01:08:30 +0000 (01:08 +0000)
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

Conflicts:
manifests/agent/polling.pp

Depends-On: https://review.opendev.org/880505
Signed-off-by: Yadnesh Kulkarni <ykulkarn@redhat.com>
Change-Id: I045c7cd7a86d0f7f97a9078cbfc74353dcff0eb8
(cherry picked from commit b00000fb86e2882c11fb399d9adf410812a895bd)
(cherry picked from commit 9d54bcd658b659758db3c79887e42222368c9f44)

manifests/agent/polling.pp
releasenotes/notes/add_tenant_name_discovery-4671aec3daae9622.yaml [new file with mode: 0644]
spec/classes/ceilometer_agent_polling_spec.rb

index 8e3e4c11497a074be53fc3464529b315f056e4df..b6bdd1873ca626b0262f465f28994ae8a95d1dd5 100644 (file)
 #   (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.
+#
 # DEPRECATED PARAMETERS
 #
 # [*coordination_url*]
@@ -88,6 +92,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,
   # DEPRECATED PARAMETERS
   $coordination_url          = undef,
 ) inherits ceilometer {
@@ -102,8 +107,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 (file)
index 0000000..5c879ee
--- /dev/null
@@ -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.
index 32d450d7b4be88ac8a558648c1c6ec3397fdac8c..e14bb47a9413e7a7c288d39af6c9d505465553b7 100644 (file)
@@ -30,6 +30,7 @@ describe 'ceilometer::agent::polling' do
       )}
 
       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>')
@@ -82,6 +83,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!(
@@ -97,6 +110,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!(