Method: NewRelic::Agent::AttributeFilter#apply

Defined in:
lib/new_relic/agent/attribute_filter.rb

#apply(attribute_name, default_destinations) ⇒ Object

[View source]

192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/new_relic/agent/attribute_filter.rb', line 192

def apply(attribute_name, default_destinations)
  return DST_NONE if @enabled_destinations == DST_NONE

  destinations = default_destinations
  attribute_name = attribute_name.to_s

  @rules.each do |rule|
    if rule.match?(attribute_name)
      if rule.is_include
        destinations |= rule.destinations
      else
        destinations &= rule.destinations
      end
    end
  end

  destinations & @enabled_destinations
end