Class: Instana::SpanFiltering::FilterRule

Inherits:
Object
  • Object
show all
Defined in:
lib/instana/span_filtering/filter_rule.rb

Overview

Represents a filtering rule for spans

A rule consists of:

  • name: A human-readable identifier for the rule

  • suppression: Whether child spans should be suppressed (only for exclude rules)

  • conditions: A list of conditions that must all be satisfied (AND logic)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, suppression, conditions) ⇒ FilterRule



17
18
19
20
21
# File 'lib/instana/span_filtering/filter_rule.rb', line 17

def initialize(name, suppression, conditions)
  @name = name
  @suppression = suppression
  @conditions = conditions
end

Instance Attribute Details

#conditionsObject

Returns the value of attribute conditions.



15
16
17
# File 'lib/instana/span_filtering/filter_rule.rb', line 15

def conditions
  @conditions
end

#nameObject (readonly)

Returns the value of attribute name.



14
15
16
# File 'lib/instana/span_filtering/filter_rule.rb', line 14

def name
  @name
end

#suppressionObject

Returns the value of attribute suppression.



15
16
17
# File 'lib/instana/span_filtering/filter_rule.rb', line 15

def suppression
  @suppression
end

Instance Method Details

#matches?(span) ⇒ Boolean

Check if a span matches this rule



26
27
28
# File 'lib/instana/span_filtering/filter_rule.rb', line 26

def matches?(span)
  @conditions.all? { |condition| condition.matches?(span) }
end