Skip to content

Commit

Permalink
include in already existing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZStriker19 committed Feb 12, 2025
1 parent f7292b3 commit 1fdf926
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
4 changes: 2 additions & 2 deletions spec/datadog/core/telemetry/event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def contain_configuration(*array)
['profiling.enabled', false],
['runtime_metrics.enabled', false],
['tracing.analytics.enabled', true],
['tracing.propagation_style_extract', '["datadog", "tracecontext"]'],
['tracing.propagation_style_inject', '["datadog", "tracecontext"]'],
['tracing.propagation_style_extract', '["datadog", "tracecontext", "baggage"]'],
['tracing.propagation_style_inject', '["datadog", "tracecontext", "baggage"]'],
['tracing.enabled', true],
['tracing.log_injection', true],
['tracing.partial_flush.enabled', false],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
)
end

let(:propagation_style_inject) { ['datadog', 'tracecontext'] }
let(:propagation_style_extract) { ['datadog', 'tracecontext'] }
let(:propagation_style_inject) { ['datadog', 'tracecontext', 'baggage'] }
let(:propagation_style_extract) { ['datadog', 'tracecontext', 'baggage'] }
let(:propagation_extract_first) { false }

it_behaves_like 'Distributed tracing propagator' do
Expand Down Expand Up @@ -82,4 +82,11 @@
let(:datadog) { propagation }
end
end

context 'for Baggage' do
it_behaves_like 'Baggage distributed format' do
before { Datadog.configure { |c| c.tracing.propagation_style = ['baggage'] } }
let(:datadog) { propagation }
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
)
end

let(:propagation_style_inject) { ['datadog', 'tracecontext'] }
let(:propagation_style_extract) { ['datadog', 'tracecontext'] }
let(:propagation_style_inject) { ['datadog', 'tracecontext', 'baggage'] }
let(:propagation_style_extract) { ['datadog', 'tracecontext', 'baggage'] }
let(:propagation_extract_first) { false }

let(:prepare_key) { RackSupport.method(:header_to_rack) }
Expand Down Expand Up @@ -67,4 +67,11 @@
let(:datadog) { propagation }
end
end

context 'for Baggage' do
it_behaves_like 'Baggage distributed format' do
before { Datadog.configure { |c| c.tracing.propagation_style = ['baggage'] } }
let(:datadog) { propagation }
end
end
end
5 changes: 3 additions & 2 deletions spec/datadog/tracing/distributed/propagation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@
{
'datadog' => Datadog::Tracing::Distributed::Datadog.new(fetcher: fetcher_class),
'tracecontext' => Datadog::Tracing::Distributed::TraceContext.new(fetcher: fetcher_class),
'baggage' => Datadog::Tracing::Distributed::Baggage.new(fetcher: fetcher_class),
}
end
let(:fetcher_class) { Datadog::Tracing::Distributed::Fetcher }

let(:propagation_style_inject) { ['datadog', 'tracecontext'] }
let(:propagation_style_extract) { ['datadog', 'tracecontext'] }
let(:propagation_style_inject) { ['datadog', 'tracecontext', 'baggage'] }
let(:propagation_style_extract) { ['datadog', 'tracecontext', 'baggage'] }
let(:propagation_extract_first) { false }

let(:prepare_key) { defined?(super) ? super() : proc { |key| key } }
Expand Down

0 comments on commit 1fdf926

Please sign in to comment.