Defined Type: profile::prometheus::elasticsearch_exporter

Defined in:
modules/profile/manifests/prometheus/elasticsearch_exporter.pp

Overview

Define: profile::prometheus::elasticsearch_exporter

Configures a prometheus elasticsearch exporter and sets up appropriate firewall rules for collection from the exporter.

Parameters

prometheus_nodes

List of Prometheus master nodes.

prometheus_port

Port used by the exporter for the listen socket

elasticsearch_port

Port to monitor elasticsearch on

Parameters:

  • prometheus_nodes (Array[String])
  • prometheus_port (Stdlib::Port)
  • elasticsearch_port (Stdlib::Port)


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'modules/profile/manifests/prometheus/elasticsearch_exporter.pp', line 15

define profile::prometheus::elasticsearch_exporter(
    Array[String] $prometheus_nodes,
    Stdlib::Port $prometheus_port,
    Stdlib::Port $elasticsearch_port,
) {
    $prometheus_nodes_ferm = join($prometheus_nodes, ' ')

    prometheus::elasticsearch_exporter { "localhost:${elasticsearch_port}":
        elasticsearch_port => $elasticsearch_port,
        prometheus_port    => $prometheus_port,
    }

    ferm::service { "prometheus_elasticsearch_exporter_${prometheus_port}":
        proto  => 'tcp',
        port   => $prometheus_port,
        srange => "(@resolve((${prometheus_nodes_ferm})) @resolve((${prometheus_nodes_ferm}), AAAA))",
    }

}