Defined Type: profile::prometheus::mysqld_exporter_instance

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

Overview

Parameters:

  • socket (Any) (defaults to: "/run/mysqld/mysqld.${title}.sock")
  • port (Any) (defaults to: 13306)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'modules/profile/manifests/prometheus/mysqld_exporter_instance.pp', line 1

define profile::prometheus::mysqld_exporter_instance (
    $socket = "/run/mysqld/mysqld.${title}.sock",
    $port = 13306,
    ) {

    prometheus::mysqld_exporter::instance { $title:
        client_socket  => $socket,
        listen_address => ":${port}",
    }

    $prometheus_nodes = hiera('prometheus_nodes')
    $prometheus_ferm_nodes = join($prometheus_nodes, ' ')

    ferm::service { "prometheus-mysqld-exporter@${title}":
        proto  => 'tcp',
        port   => $port,
        srange => "@resolve((${prometheus_ferm_nodes}))",
    }
}