Class: Datadog::Sampling::SimpleMatcher
- Defined in:
- lib/ddtrace/sampling/matcher.rb
Overview
A \Matcher that supports matching a span by operation name and/or service name.
Constant Summary collapse
- MATCH_ALL =
Returns
true
for case equality (===) with any object Class.new do # DEV: A class that implements `#===` is ~20% faster than # DEV: a `Proc` that always returns `true`. def ===(other) true end end.new
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(name: MATCH_ALL, service: MATCH_ALL) ⇒ SimpleMatcher
constructor
A new instance of SimpleMatcher.
- #match?(span) ⇒ Boolean
Constructor Details
#initialize(name: MATCH_ALL, service: MATCH_ALL) ⇒ SimpleMatcher
Returns a new instance of SimpleMatcher.
32 33 34 35 |
# File 'lib/ddtrace/sampling/matcher.rb', line 32 def initialize(name: MATCH_ALL, service: MATCH_ALL) @name = name @service = service end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
28 29 30 |
# File 'lib/ddtrace/sampling/matcher.rb', line 28 def name @name end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
28 29 30 |
# File 'lib/ddtrace/sampling/matcher.rb', line 28 def service @service end |
Instance Method Details
#match?(span) ⇒ Boolean
37 38 39 |
# File 'lib/ddtrace/sampling/matcher.rb', line 37 def match?(span) name === span.name && service === span.service end |