Puppet Class: profile::prometheus::php_fpm_exporter

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

Overview

Class profile::prometheus::php_fpm_exporter

Installs and configures the prometheus php-fpm exporter.

Parameters:

  • fcgi_port (Optional[Stdlib::Port::User]) (defaults to: lookup('profile::php_fpm::fcgi_port', {'default_value' => undef}))
  • fcgi_pool (String) (defaults to: lookup('profile::mediawiki::fcgi_pool', {'default_value' => 'www'}))
  • prometheus_nodes (Array[Stdlib::Host]) (defaults to: lookup('prometheus_nodes'))


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

class profile::prometheus::php_fpm_exporter (
    Optional[Stdlib::Port::User] $fcgi_port        = lookup('profile::php_fpm::fcgi_port', {'default_value' => undef}),
    String                       $fcgi_pool        = lookup('profile::mediawiki::fcgi_pool', {'default_value' => 'www'}),
    Array[Stdlib::Host]          $prometheus_nodes = lookup('prometheus_nodes'),
){

    if $fcgi_port == undef {
        $fcgi_endpoint = "unix:///run/php/fpm-${fcgi_pool}.sock"
    }
    else {
        $fcgi_endpoint = "tcp://127.0.0.1:${fcgi_port}"
    }
    class { 'prometheus::php_fpm_exporter':
        port          => 9180,
        fcgi_endpoint => $fcgi_endpoint
    }
    $prometheus_ferm_nodes = join($prometheus_nodes, ' ')
    $ferm_srange = "(@resolve((${prometheus_ferm_nodes})) @resolve((${prometheus_ferm_nodes}), AAAA))"

    ferm::service { 'prometheus-php-fpm-exporter':
        proto  => 'tcp',
        port   => '9180',
        srange => $ferm_srange,
    }
}