Class: Instana::SpanFiltering::FilterRule
- Inherits:
-
Object
- Object
- Instana::SpanFiltering::FilterRule
- 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
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#suppression ⇒ Object
Returns the value of attribute suppression.
Instance Method Summary collapse
-
#initialize(name, suppression, conditions) ⇒ FilterRule
constructor
A new instance of FilterRule.
-
#matches?(span) ⇒ Boolean
Check if a span matches this rule.
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
#conditions ⇒ Object
Returns the value of attribute conditions.
15 16 17 |
# File 'lib/instana/span_filtering/filter_rule.rb', line 15 def conditions @conditions end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/instana/span_filtering/filter_rule.rb', line 14 def name @name end |
#suppression ⇒ Object
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 |