Skip to content

Commit 48bb674

Browse files
author
Jarret Lavallee
committed
(GH-74) Return null when a mbean is missing
Prior to this commit, when an mbean was missing and error would be logged. This commit changes the default for additional metrics to return a null when the mbean returns a 404.
1 parent b058216 commit 48bb674

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

files/pe_metrics.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ def retrieve_additional_metrics(host, port, use_ssl, metrics_type, metrics)
133133
metric_data = metrics_output[index]
134134
if metric_data['status'] == 200
135135
metrics_array << { 'name' => metric_name, 'data' => metric_data['value'] }
136+
elsif metric_data['status'] == 404
137+
metrics_array << { 'name' => metric_name, 'data' => nil}
136138
else
137139
metric_mbean = metrics[index]['mbean']
138140
$error_array << "HTTP Error #{metric_data['status']} for #{metric_mbean}"

0 commit comments

Comments
 (0)