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.
57 58 59 60 |
# File 'lib/datadog/tracing/sampling/matcher.rb', line 57 def initialize(&block) super() @block = block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
53 54 55 |
# File 'lib/datadog/tracing/sampling/matcher.rb', line 53 def block @block end |
Instance Method Details
#match?(trace) ⇒ Boolean
62 63 64 |
# File 'lib/datadog/tracing/sampling/matcher.rb', line 62 def match?(trace) block.call(trace.name, trace.service) end |