Class: Datadog::Tracing::Sampling::ProcMatcher
- Defined in:
- lib/datadog/tracing/sampling/matcher.rb
Overview
A Matcher that allows for arbitrary trace 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?(trace) ⇒ Boolean
Constructor Details
#initialize {|name, service| ... } ⇒ ProcMatcher
Returns a new instance of ProcMatcher.
77 78 79 80 |
# File 'lib/datadog/tracing/sampling/matcher.rb', line 77 def initialize(&block) super() @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
73 74 75 |
# File 'lib/datadog/tracing/sampling/matcher.rb', line 73 def block @block end |
Instance Method Details
#match?(trace) ⇒ Boolean
82 83 84 |
# File 'lib/datadog/tracing/sampling/matcher.rb', line 82 def match?(trace) block.call(trace.name, trace.service) end |