Skip to content

Commit 169759f

Browse files
committed
(PE-28451) renable additional activemq and not-found metrics
Restore additional activemq metrics. Delete PE 2016 conditionals. Restore counters that don't exist until a failure occurs.
1 parent 310749f commit 169759f

File tree

2 files changed

+61
-27
lines changed

2 files changed

+61
-27
lines changed

manifests/service/activemq.pp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,44 @@
1212
Optional[Integer] $metrics_server_port = $puppet_metrics_collector::metrics_server_port,
1313
Optional[String] $metrics_server_db_name = $puppet_metrics_collector::metrics_server_db_name,
1414
) {
15+
$additional_metrics = [
16+
{
17+
'type' => 'read',
18+
'mbean' => 'java.lang:type=Memory',
19+
'attribute' => 'HeapMemoryUsage,NonHeapMemoryUsage'
20+
},
21+
{
22+
'type' => 'read',
23+
'mbean' => 'java.lang:name=*,type=GarbageCollector',
24+
'attribute' => 'CollectionCount'
25+
},
26+
{
27+
'type' => 'read',
28+
'mbean' => 'java.lang:type=Runtime',
29+
'attribute' => 'Uptime'
30+
},
31+
{
32+
'type' => 'read',
33+
'mbean' => 'java.lang:type=OperatingSystem',
34+
'attribute' => 'OpenFileDescriptorCount,MaxFileDescriptorCount'
35+
},
36+
{
37+
'type' => 'read',
38+
'mbean' => 'org.apache.activemq:brokerName=*,type=Broker',
39+
'attribute' => 'MemoryLimit,MemoryPercentUsage,CurrentConnectionsCount'
40+
},
41+
{
42+
'type' => 'read',
43+
'mbean' => 'org.apache.activemq:type=Broker,brokerName=*,destinationType=Queue,destinationName=mcollective.*',
44+
'attribute' => 'AverageBlockedTime,AverageEnqueueTime,AverageMessageSize,ConsumerCount,DequeueCount,DispatchCount,EnqueueCount,ExpiredCount,ForwardCount,InFlightCount,ProducerCount,QueueSize',
45+
},
46+
{
47+
'type' => 'read',
48+
'mbean' => 'org.apache.activemq:type=Broker,brokerName=*,destinationType=Topic,destinationName=mcollective.*.agent',
49+
'attribute' => 'AverageBlockedTime,AverageEnqueueTime,AverageMessageSize,ConsumerCount,DequeueCount,DispatchCount,EnqueueCount,ExpiredCount,ForwardCount,InFlightCount,ProducerCount,QueueSize',
50+
},
51+
]
52+
1553
file { "${puppet_metrics_collector::scripts_dir}/amq_metrics" :
1654
ensure => $metrics_ensure,
1755
mode => '0755',
@@ -27,7 +65,7 @@
2765
metric_script_file => 'amq_metrics',
2866
override_metrics_command => $override_metrics_command,
2967
excludes => $excludes,
30-
additional_metrics => [],
68+
additional_metrics => $additional_metrics,
3169
metrics_server_type => $metrics_server_type,
3270
metrics_server_hostname => $metrics_server_hostname,
3371
metrics_server_port => $metrics_server_port,

manifests/service/puppetdb.pp

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
'name' => 'global_fatal',
2929
'mbean' => 'puppetlabs.puppetdb.mq:name=global.fatal'
3030
},
31-
#{
32-
# 'type' => 'read',
33-
# 'name' => 'global_generate-retry-message-time',
34-
# 'mbean' => 'puppetlabs.puppetdb.mq:name=global.generate-retry-message-time'
35-
#},
31+
{ # This counter doesn't exist until a failure occurs.
32+
'type' => 'read',
33+
'name' => 'global_generate-retry-message-time',
34+
'mbean' => 'puppetlabs.puppetdb.mq:name=global.generate-retry-message-time'
35+
},
3636
{
3737
'type' => 'read',
3838
'name' => 'global_message-persistence-time',
@@ -48,11 +48,11 @@
4848
'name' => 'global_retry-counts',
4949
'mbean' => 'puppetlabs.puppetdb.mq:name=global.retry-counts'
5050
},
51-
#{
52-
# 'type' => 'read',
53-
# 'name' => 'global_retry-persistence-time',
54-
# 'mbean' => 'puppetlabs.puppetdb.mq:name=global.retry-persistence-time'
55-
#},
51+
{ # This counter doesn't exist until a failure occurs.
52+
'type' => 'read',
53+
'name' => 'global_retry-persistence-time',
54+
'mbean' => 'puppetlabs.puppetdb.mq:name=global.retry-persistence-time'
55+
},
5656
{
5757
'type' => 'read',
5858
'name' => 'global_seen',
@@ -178,42 +178,38 @@
178178
}
179179
]
180180

181-
# Retaining for future reference.
182-
$numbers = $::pe_server_version ? {
183-
/^2016\.[45]\./ => {'catalogs' => 9, 'facts' => 5, 'reports' => 8},
184-
default => {'catalogs' => 9, 'facts' => 5, 'reports' => 8},
185-
}
181+
$version = {'catalogs' => 9, 'facts' => 5, 'reports' => 8},
186182

187183
$version_specific_metrics = [
188184
{
189185
'type' => 'read',
190186
'name' => 'mq_replace_catalog_retried',
191-
'mbean' => "puppetlabs.puppetdb.mq:name=replace catalog.${numbers['catalogs']}.retried"
187+
'mbean' => "puppetlabs.puppetdb.mq:name=replace catalog.${version['catalogs']}.retried"
192188
},
193189
{
194190
'type' => 'read',
195191
'name' => 'mq_replace_catalog_retry-counts',
196-
'mbean' => "puppetlabs.puppetdb.mq:name=replace catalog.${numbers['catalogs']}.retry-counts"
192+
'mbean' => "puppetlabs.puppetdb.mq:name=replace catalog.${version['catalogs']}.retry-counts"
197193
},
198194
{
199195
'type' => 'read',
200196
'name' => 'mq_replace_facts_retried',
201-
'mbean' => "puppetlabs.puppetdb.mq:name=replace facts.${numbers['facts']}.retried"
197+
'mbean' => "puppetlabs.puppetdb.mq:name=replace facts.${version['facts']}.retried"
202198
},
203199
{
204200
'type' => 'read',
205201
'name' => 'mq_replace_facts_retry-counts',
206-
'mbean' => "puppetlabs.puppetdb.mq:name=replace facts.${numbers['facts']}.retry-counts"
202+
'mbean' => "puppetlabs.puppetdb.mq:name=replace facts.${version['facts']}.retry-counts"
207203
},
208204
{
209205
'type' => 'read',
210206
'name' => 'mq_store_report_retried',
211-
'mbean' => "puppetlabs.puppetdb.mq:name=store report.${numbers['reports']}.retried"
207+
'mbean' => "puppetlabs.puppetdb.mq:name=store report.${version['reports']}.retried"
212208
},
213209
{
214210
'type' => 'read',
215211
'name' => 'mq_store_reports_retry-counts',
216-
'mbean' => "puppetlabs.puppetdb.mq:name=store report.${numbers['reports']}.retry-counts"
212+
'mbean' => "puppetlabs.puppetdb.mq:name=store report.${version['reports']}.retry-counts"
217213
}
218214
]
219215

@@ -291,11 +287,11 @@
291287
'name' => 'ha_seconds-since-last-successful-sync',
292288
'mbean' => 'puppetlabs.puppetdb.ha:name=seconds-since-last-successful-sync'
293289
},
294-
#{
295-
# 'type' => 'read',
296-
# 'name' => 'ha_failed-request-counter',
297-
# 'mbean' => 'puppetlabs.puppetdb.ha:name=failed-request-counter'
298-
#},
290+
{ # This counter doesn't exist until a failure occurs.
291+
'type' => 'read',
292+
'name' => 'ha_failed-request-counter',
293+
'mbean' => 'puppetlabs.puppetdb.ha:name=failed-request-counter'
294+
},
299295
{
300296
'type' => 'read',
301297
'name' => 'ha_sync-duration',

0 commit comments

Comments
 (0)