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.
49 50 51 |
# File 'lib/ddtrace/sampling/matcher.rb', line 49 def initialize(&block) @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
45 46 47 |
# File 'lib/ddtrace/sampling/matcher.rb', line 45 def block @block end |
Instance Method Details
#match?(span) ⇒ Boolean
53 54 55 |
# File 'lib/ddtrace/sampling/matcher.rb', line 53 def match?(span) block.call(span.name, span.service) end |