lib/opentelemetry/sdk/trace/samplers/parent_based.rb in opentelemetry-sdk-0.11.1 vs lib/opentelemetry/sdk/trace/samplers/parent_based.rb in opentelemetry-sdk-0.12.0

- old
+ new

@@ -24,10 +24,18 @@ @remote_parent_not_sampled = remote_parent_not_sampled @local_parent_sampled = local_parent_sampled @local_parent_not_sampled = local_parent_not_sampled end + def ==(other) + @root == other.root && + @remote_parent_sampled == other.remote_parent_sampled && + @remote_parent_not_sampled == other.remote_parent_not_sampled && + @local_parent_sampled == other.local_parent_sampled && + @local_parent_not_sampled == other.local_parent_not_sampled + end + # @api private # # See {Samplers}. def description "ParentBased{root=#{@root.description}, remote_parent_sampled=#{@remote_parent_sampled.description}, remote_parent_not_sampled=#{@remote_parent_not_sampled.description}, local_parent_sampled=#{@local_parent_sampled.description}, local_parent_not_sampled=#{@local_parent_not_sampled.description}}" @@ -45,9 +53,13 @@ else parent_span_context.trace_flags.sampled? ? @local_parent_sampled : @local_parent_not_sampled end delegate.should_sample?(trace_id: trace_id, parent_context: parent_context, links: links, name: name, kind: kind, attributes: attributes) end + + protected + + attr_reader :root, :remote_parent_sampled, :remote_parent_not_sampled, :local_parent_sampled, :local_parent_not_sampled end end end end end