Class: Datadog::Sampling::ProcMatcher
- Defined in:
- lib/ddtrace/sampling/matcher.rb
Overview
A Matcher that allows for arbitrary span matching based on the return value of a provided block.
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
Instance Method Summary collapse
-
#initialize {|name, service| ... } ⇒ ProcMatcher
constructor
A new instance of ProcMatcher.
- #match?(span) ⇒ Boolean
Constructor Details
#initialize {|name, service| ... } ⇒ ProcMatcher
Returns a new instance of ProcMatcher.
48 49 50 |
# File 'lib/ddtrace/sampling/matcher.rb', line 48 def initialize(&block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
44 45 46 |
# File 'lib/ddtrace/sampling/matcher.rb', line 44 def block @block end |
Instance Method Details
#match?(span) ⇒ Boolean
52 53 54 |
# File 'lib/ddtrace/sampling/matcher.rb', line 52 def match?(span) block.call(span.name, span.service) end |