Puppet Class: profile::prometheus::statsd_exporter

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

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • mappings (Array[Hash]) (defaults to: lookup('profile::prometheus::statsd_exporter::mappings'))
  • enable_relay (Boolean) (defaults to: lookup('profile::prometheus::statsd_exporter::enable_relay', { 'default_value' => true }))
  • relay_address (String) (defaults to: lookup('statsd'))


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'modules/profile/manifests/prometheus/statsd_exporter.pp', line 2

class profile::prometheus::statsd_exporter (
    Array[Hash] $mappings      = lookup('profile::prometheus::statsd_exporter::mappings'),
    Boolean     $enable_relay  = lookup('profile::prometheus::statsd_exporter::enable_relay', { 'default_value' => true }),
    String      $relay_address = lookup('statsd'),
){

    if $enable_relay {
        $relay_addr = $relay_address
    } else {
        $relay_addr = ''
    }

    class { '::prometheus::statsd_exporter':
        mappings      => $mappings,
        relay_address => $relay_addr,
    }

    # Don't spam conntrack with localhost statsd clients
    ferm::client { 'statsd-exporter-client':
        proto   => 'udp',
        notrack => true,
        port    => '9125',
        drange  => '127.0.0.1',
    }
}