Puppet Class: profile::prometheus::mcrouter_exporter

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

Overview

Parameters:

  • mcrouter_port (Integer) (defaults to: hiera('mcrouter::port'))
  • listen_port (Integer) (defaults to: hiera('profile::prometheus::mcrouter_exporter::listen_port', 9151))
  • prometheus_nodes (Any) (defaults to: hiera('prometheus_nodes'))


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

class profile::prometheus::mcrouter_exporter (
    Integer $mcrouter_port = hiera('mcrouter::port'),
    Integer $listen_port = hiera('profile::prometheus::mcrouter_exporter::listen_port', 9151),
    $prometheus_nodes = hiera('prometheus_nodes'),
) {
    prometheus::mcrouter_exporter { 'default':
        arguments => "-mcrouter.address localhost:${mcrouter_port} -web.listen-address :${listen_port} -mcrouter.server_metrics",
    }

    $prometheus_ferm_nodes = join($prometheus_nodes, ' ')
    $ferm_srange = "(@resolve((${prometheus_ferm_nodes})) @resolve((${prometheus_ferm_nodes}), AAAA))"

    ferm::service { 'prometheus-mcrouter-exporter':
        proto  => 'tcp',
        port   => $listen_port,
        srange => $ferm_srange,
    }

    base::service_auto_restart { 'prometheus-mcrouter-exporter': }
}