Skip to content

Commit

Permalink
Fix constant reference in ConsistentProbabilityTraceState (#1450)
Browse files Browse the repository at this point in the history
* fix constant reference in cps sampler

* try rubocop false (fingers crossed)

* Revert "try rubocop false (fingers crossed)"

This reverts commit 700650f.
  • Loading branch information
plantfansam committed May 23, 2023
1 parent 24c8032 commit 1ad4a21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions api/test/opentelemetry/trace/tracestate_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,10 @@
_(OpenTelemetry::Trace::Tracestate.from_hash('a' => 'b')).wont_be :empty?
end
end

describe '::DEFAULT' do
it 'returns empty tracestate' do
_(OpenTelemetry::Trace::Tracestate::DEFAULT.to_h).must_be :empty?
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def update_tracestate(tracestate, p, r, rest) # rubocop:disable Naming/Uncommuni

def new_tracestate(p: nil, r: nil) # rubocop:disable Naming/UncommunicativeMethodParamName
if p.nil? && r.nil?
OpenTelemetry::Trace::Tracestate.DEFAULT
OpenTelemetry::Trace::Tracestate::DEFAULT
elsif p.nil?
OpenTelemetry::Trace::Tracestate.from_hash('ot' => "r:#{r}")
elsif r.nil?
Expand Down

0 comments on commit 1ad4a21

Please sign in to comment.