From ed7d5163cef7777b46cd70dbee59be7b5521c92c Mon Sep 17 00:00:00 2001 From: Marco Costa Date: Thu, 30 Nov 2023 14:19:11 -0800 Subject: [PATCH] Remove deprecated B3 configuration style --- lib/datadog/tracing/configuration/ext.rb | 5 --- lib/datadog/tracing/configuration/settings.rb | 43 ------------------- sig/datadog/tracing/configuration/ext.rbs | 3 -- .../tracing/configuration/settings_spec.rb | 26 ----------- 4 files changed, 77 deletions(-) diff --git a/lib/datadog/tracing/configuration/ext.rb b/lib/datadog/tracing/configuration/ext.rb index 3ff0b40c60f..05ee5c698ee 100644 --- a/lib/datadog/tracing/configuration/ext.rb +++ b/lib/datadog/tracing/configuration/ext.rb @@ -35,12 +35,7 @@ module Distributed PROPAGATION_STYLE_DATADOG = 'Datadog' PROPAGATION_STYLE_B3_MULTI_HEADER = 'b3multi' - # @deprecated Use `b3multi` instead. - PROPAGATION_STYLE_B3 = 'B3' - PROPAGATION_STYLE_B3_SINGLE_HEADER = 'b3' - # @deprecated Use `b3` instead. - PROPAGATION_STYLE_B3_SINGLE_HEADER_OLD = 'B3 single header' # W3C Trace Context PROPAGATION_STYLE_TRACE_CONTEXT = 'tracecontext' diff --git a/lib/datadog/tracing/configuration/settings.rb b/lib/datadog/tracing/configuration/settings.rb index 01e09c75f80..f745a812027 100644 --- a/lib/datadog/tracing/configuration/settings.rb +++ b/lib/datadog/tracing/configuration/settings.rb @@ -9,7 +9,6 @@ module Configuration # @public_api # rubocop:disable Metrics/AbcSize # rubocop:disable Metrics/BlockLength - # rubocop:disable Metrics/CyclomaticComplexity # rubocop:disable Metrics/MethodLength # rubocop:disable Layout/LineLength module Settings @@ -64,20 +63,6 @@ def self.extended(base) Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_TRACE_CONTEXT, ] ) - o.after_set do |styles| - # Modernize B3 options - # DEV-2.0: Can be removed with the removal of deprecated B3 constants. - styles.map! do |style| - case style - when Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3 - Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_MULTI_HEADER - when Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER_OLD - Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER - else - style - end - end - end end # The data propagation styles the tracer will use to inject distributed tracing propagation @@ -96,20 +81,6 @@ def self.extended(base) Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_DATADOG, Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_TRACE_CONTEXT, ] - o.after_set do |styles| - # Modernize B3 options - # DEV-2.0: Can be removed with the removal of deprecated B3 constants. - styles.map! do |style| - case style - when Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3 - Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_MULTI_HEADER - when Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER_OLD - Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER - else - style - end - end - end end # An ordered list of what data propagation styles the tracer will use to extract distributed tracing propagation @@ -127,19 +98,6 @@ def self.extended(base) o.after_set do |styles| next if styles.empty? - # Modernize B3 options - # DEV-2.0: Can be removed with the removal of deprecated B3 constants. - styles.map! do |style| - case style - when Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3 - Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_MULTI_HEADER - when Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER_OLD - Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER - else - style - end - end - set_option(:propagation_extract_style, styles) set_option(:propagation_inject_style, styles) end @@ -491,7 +449,6 @@ def self.extended(base) end # rubocop:enable Metrics/AbcSize # rubocop:enable Metrics/BlockLength - # rubocop:enable Metrics/CyclomaticComplexity # rubocop:enable Metrics/MethodLength # rubocop:enable Layout/LineLength end diff --git a/sig/datadog/tracing/configuration/ext.rbs b/sig/datadog/tracing/configuration/ext.rbs index d718e4d85df..512e87217e0 100644 --- a/sig/datadog/tracing/configuration/ext.rbs +++ b/sig/datadog/tracing/configuration/ext.rbs @@ -21,10 +21,7 @@ module Datadog PROPAGATION_STYLE_DATADOG: "Datadog" PROPAGATION_STYLE_B3_MULTI_HEADER: "b3multi" - PROPAGATION_STYLE_B3: "B3" - PROPAGATION_STYLE_B3_SINGLE_HEADER: "b3" - PROPAGATION_STYLE_B3_SINGLE_HEADER_OLD: "B3 single header" PROPAGATION_STYLE_TRACE_CONTEXT: "tracecontext" ENV_PROPAGATION_STYLE: "DD_TRACE_PROPAGATION_STYLE" diff --git a/spec/datadog/tracing/configuration/settings_spec.rb b/spec/datadog/tracing/configuration/settings_spec.rb index bf36c4cb76d..7c42b87dc1b 100644 --- a/spec/datadog/tracing/configuration/settings_spec.rb +++ b/spec/datadog/tracing/configuration/settings_spec.rb @@ -93,19 +93,6 @@ ) end end - - context 'is set to deprecated style names' do - let(:var_value) { 'B3,B3 single header' } - - it 'translates to new names' do - is_expected.to eq( - [ - Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_MULTI_HEADER, - Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER - ] - ) - end - end end context 'with deprecated DD_PROPAGATION_STYLE_EXTRACT' do @@ -159,19 +146,6 @@ ) end end - - context 'is set to deprecated style names' do - let(:var_value) { 'B3,B3 single header' } - - it 'translates to new names' do - is_expected.to eq( - [ - Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_MULTI_HEADER, - Datadog::Tracing::Configuration::Ext::Distributed::PROPAGATION_STYLE_B3_SINGLE_HEADER - ] - ) - end - end end context 'with deprecated DD_PROPAGATION_STYLE_INJECT' do