Puppet Class: webperf::navtiming

Defined in:
modules/webperf/manifests/navtiming.pp

Overview

Class: webperf::navtiming

Captures NavigationTiming events from Kafka and send them to StatsD / Graphite. See meta.wikimedia.org/wiki/Schema:NavigationTiming & www.mediawiki.org/wiki/Extension:NavigationTiming

Parameters

kafka_brokers

String of comma separated Kafka bootstrap brokers.

statsd_host

Write stats to this StatsD instance. Default: '127.0.0.1'.

statsd_port

Write stats to this StatsD instance. Default: 8125.

Parameters:

  • kafka_brokers (String)
  • statsd_host (Variant[Stdlib::Ipv4, Stdlib::Fqdn]) (defaults to: '127.0.0.1')
  • statsd_port (Stdlib::Port) (defaults to: 8125)


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'modules/webperf/manifests/navtiming.pp', line 18

class webperf::navtiming(
    String $kafka_brokers,
    Variant[Stdlib::Ipv4, Stdlib::Fqdn] $statsd_host = '127.0.0.1',
    Stdlib::Port $statsd_port = 8125,
) {
    include ::webperf

    require_package('python-kafka')
    require_package('python-yaml')

    scap::target { 'performance/navtiming':
        service_name => 'navtiming',
        deploy_user  => 'deploy-service',
    }

    file { '/srv/webperf/navtiming.py':
        ensure => absent
    }

    file { '/lib/systemd/system/navtiming.service':
        # uses $statsd_host, $statsd_port, $kafka_brokers
        content => template('webperf/navtiming.systemd.erb'),
        notify  => Service['navtiming'],
    }

    service { 'navtiming':
        ensure   => running,
        provider => systemd,
    }

    base::service_auto_restart { 'navtiming': }
}