Puppet Class: cdh::hive::jmxtrans::server

Defined in:
modules/cdh/manifests/hive/jmxtrans/server.pp

Overview

Class cdh::hive::jmxtrans::server

Sets up a jmxtrans instance for the Hive Server running on the current host. Note: This requires the jmxtrans puppet module found at github.com/wikimedia/puppet-jmxtrans.

Parameters

$jmx_port - DataNode JMX port. Default: 9981 $ganglia - Ganglia host:port $graphite - Graphite host:port $statsd - statsd host:port $outfile - outfile to which Kafka stats will be written. $objects - objects parameter to pass to jmxtrans::metrics. Only use

this if you need to override the default ones that this
class provides.

Parameters:

  • jmx_port (Any) (defaults to: 9978)
  • ganglia (Any) (defaults to: undef)
  • graphite (Any) (defaults to: undef)
  • statsd (Any) (defaults to: undef)
  • outfile (Any) (defaults to: undef)
  • objects (Any) (defaults to: undef)


17
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'modules/cdh/manifests/hive/jmxtrans/server.pp', line 17

class cdh::hive::jmxtrans::server(
    $jmx_port       = 9978,
    $ganglia        = undef,
    $graphite       = undef,
    $statsd         = undef,
    $outfile        = undef,
    $objects        = undef,
) {
    $jmx = "${::fqdn}:${jmx_port}"
    $group_name = 'Hive.Server'

    # query for metrics from Hadoop DataNode's JVM
    jmxtrans::metrics::jvm { 'hadoop-hive-server':
        jmx          => $jmx,
        group_prefix => "${group_name}.",
        outfile      => $outfile,
        ganglia      => $ganglia,
        graphite     => $graphite,
        statsd       => $statsd,
    }


    $server_objects = $objects ? {
        # if $objects was not set, then use this as the
        # default set of JMX MBean objects to query.
        undef   => [
            {
                'name' =>          'Hive:name=JvmMetrics,service=Server',
                'resultAlias'   => "${group_name}.JvmMetrics",
                'attrs'         => {
                    'GcCount'                                   => { 'slope' => 'positive' },
                    'GcCountPS MarkSweep'                       => { 'slope' => 'positive' },
                    'GcCountPS Scavenge'                        => { 'slope' => 'positive' },
                    'GcTimeMillis'                              => { 'slope' => 'both' },
                    'GcTimeMillisPS MarkSweep'                  => { 'slope' => 'both' },
                    'GcTimeMillisPS Scavenge'                   => { 'slope' => 'both' },
                    'LogError'                                  => { 'slope' => 'positive' },
                    'LogFatal'                                  => { 'slope' => 'positive' },
                    'LogInfo'                                   => { 'slope' => 'both' },
                    'LogWarn'                                   => { 'slope' => 'positive' },
                    'MemHeapCommittedM'                         => { 'slope' => 'both' },
                    'MemHeapUsedM'                              => { 'slope' => 'both' },
                    'MemNonHeapCommittedM'                      => { 'slope' => 'both' },
                    'MemNonHeapUsedM'                           => { 'slope' => 'both' },
                    'ThreadsBlocked'                            => { 'slope' => 'both' },
                    'ThreadsNew'                                => { 'slope' => 'both' },
                    'ThreadsRunnable'                           => { 'slope' => 'both' },
                    'ThreadsTerminated'                         => { 'slope' => 'both' },
                    'ThreadsTimedWaiting'                       => { 'slope' => 'both' },
                    'ThreadsWaiting'                            => { 'slope' => 'both' },
                },
            },
        ],
        # else use $objects
        default => $objects,
    }

    # query for jmx metrics
    jmxtrans::metrics { "hadoop-hive-server-${::hostname}-${jmx_port}":
        jmx                  => $jmx,
        outfile              => $outfile,
        ganglia              => $ganglia,
        ganglia_group_name   => $group_name,
        graphite             => $graphite,
        graphite_root_prefix => $group_name,
        statsd               => $statsd,
        statsd_root_prefix   => $group_name,
        objects              => $server_objects,
    }
}