Defined Type: prometheus::jmx_exporter_config

Defined in:
modules/prometheus/manifests/jmx_exporter_config.pp

Overview

Parameters

dest

Path to jmx exporter config file to render.

class_name

Class name to search. All nodes with this class declared will be searched for jmx_exporter_instance titles that match $instance_selector.

site

The site to use.

instance_selector

Regex to select jmx_exporter_instances by title. Default: .*

labels

Hash of labels to attach to every host. 'cluster' will be added automatically as well.

Parameters:

  • dest (String)
  • class_name (String)
  • site (String)
  • instance_selector (String) (defaults to: '.*')
  • labels (Hash) (defaults to: {})


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'modules/prometheus/manifests/jmx_exporter_config.pp', line 24

define prometheus::jmx_exporter_config(
    String $dest,
    String $class_name,
    String $site,
    String $instance_selector = '.*',
    Hash   $labels            = {},
) {

    $resources = query_resources(
                  "Class[\"${class_name}\"]",
                  "Prometheus::Jmx_exporter_instance[~\"${instance_selector}\"]",
                  true)
    $site_clusters = get_clusters({'site' => $site})

    file { $dest:
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0444',
        content => template('prometheus/jmx_exporter_config.erb'),
    }
}