Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1907285

Summary: [RFE] Want to set "PluginInstanceFormat" parameter for collectd virt plugin through puppet.
Product: Red Hat OpenStack Reporter: youngcheol <yocha>
Component: puppet-collectdAssignee: Martin Magr <mmagr>
Status: CLOSED DUPLICATE QA Contact: Leonid Natapov <lnatapov>
Severity: low Docs Contact:
Priority: unspecified    
Version: 16.1 (Train)CC: jbadiapa, jjoyce, jschluet, lars, mmagr, mrunge, rmccabe, slinaber, tvignaud
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-14 08:46:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description youngcheol 2020-12-14 06:09:10 UTC
Description of problem:

- Want to set "PluginInstanceFormat" parameter for collectd virt plugin through puppet.



Version-Release number of selected component (if applicable):
 -RHOSP16.1

[root@controller-0 plugin]# rpm -qa |grep puppet-collectd
puppet-collectd-12.0.1-1.20200821073807.4686e16.el8ost.noarch


Actual results:

# cat /etc/puppet/modules/collectd/manifests/plugin/virt.pp 
# https://collectd.org/wiki/index.php/Plugin:virt
class collectd::plugin::virt (
  String $connection,
  $ensure                                      = 'present',
  $manage_package                              = undef,
  Optional[Pattern[/^\d+$/]] $refresh_interval = undef,
  Optional[String] $domain                     = undef,
  Optional[String] $block_device               = undef,
  Optional[String]$interface_device            = undef,
  Optional[Boolean] $ignore_selected           = undef,
  Optional[String] $hostname_format            = undef,
  Optional[String] $interface_format           = undef,
  Optional[String] $extra_stats                = undef,
  $interval                                    = undef,
) {

  include collectd

  $_manage_package = pick($manage_package, $collectd::manage_package)

  if $facts['os']['family'] == 'RedHat' {
    if $_manage_package {
      package { 'collectd-virt':
        ensure => $ensure,
      }
    }
  }

  if versioncmp("${collectd::collectd_version_real}", '5.5') >= 0 { # lint:ignore:only_variable_string
    $plugin_name = 'virt'
  } else {
    $plugin_name = 'libvirt'
  }

  collectd::plugin { 'virt':
    ensure   => $ensure,
    name     => $plugin_name,
    content  => template('collectd/plugin/virt.conf.erb'),
    interval => $interval,
  }
}


Expected results:
 Adding "Plugin Instance Format" parameter to set it through puppet.

Additional info:


collected data was seen like below when set only 
~~~
HostnameFormat "hostname", "uuid "
~~~~

collectd_virt_virt_cpu_total_total{host="<Compute Node Name>:<UUID>"}


It changed when When set "PluginInstanceFormat" 
~~~
HostnameFormat "hostname"
 PluginInstanceFormat "uuid"
~~~

collectd_virt_virt_cpu_total_total{host="<Compute Node Name>", instance="<UUID>"}

It made to easy see instances in each compute nodes when integrate with Granada and Prometheus.
so The Customer is using added it manually.
But they wanted to set it through puppet to make easier in operating perspective.

Comment 1 Matthias Runge 2020-12-14 08:46:58 UTC
This seems to be a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1878191. Good news is, that some work has already been done here and it seems it is missing builds.

*** This bug has been marked as a duplicate of bug 1878191 ***