lib/one_apm/configuration.rb in oneapm_rpm-1.2.5 vs lib/one_apm/configuration.rb in oneapm_rpm-1.2.6.rc1
- old
+ new
@@ -254,10 +254,20 @@
false
end
end
end
+ def to_notified_hash
+ @notified_hash = {}
+ to_collector_hash.each{|k, v| @notified_hash[k]= v.to_s}
+ return @notified_hash unless OneApm::Manager.config[:'notified.enable']
+ @notified_hash.select do |k, v|
+ default = DEFAULTS[k]
+ OneApm::Manager.config[:"#{k}.notified"] || (default && default.fetch(:notified, false))
+ end
+ end
+
def app_names
case OneApm::Manager.config[:app_name]
when Array then OneApm::Manager.config[:app_name]
when String then OneApm::Manager.config[:app_name].split(';')
else []
@@ -357,11 +367,15 @@
def remove_duplicates(pairs)
grouped_by_type = pairs.group_by(&:first)
grouped_by_type.values.map(&:last)
end
+ #parse hash of labels
+ #delete key eql 'labels.xxx.notified'
def parse_labels_from_dictionary
- make_label_hash(OneApm::Manager.config[:labels])
+ labels = OneApm::Manager.config[:labels]
+ labels.delete_if{|k, v| k.include?(".notified")}
+ make_label_hash(labels)
end
# Generally only useful during initial construction and tests
def reset_to_defaults
@high_security_source = nil