diff --git a/lib/traces/backend/datadog/interface.rb b/lib/traces/backend/datadog/interface.rb index f6e5d95..8b065bb 100644 --- a/lib/traces/backend/datadog/interface.rb +++ b/lib/traces/backend/datadog/interface.rb @@ -20,11 +20,17 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -require 'ddtrace' +require 'datadog/tracing' require 'traces/context' require_relative 'version' +# We introduce some compatibility interfaces for getting and setting tags: +module Datadog::Tracing::Metadata::Tagging + alias []= set_tag + alias [] get_tag +end + module Traces module Backend module Datadog diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0c93054..3fdcff9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -20,12 +20,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -require 'datadog/tracing' +require 'ddtrace' -Datadog.configure do |config| - # To enable debug mode - # config.diagnostics.debug = true -end +# Datadog.configure do |config| +# # To enable debug mode +# config.diagnostics.debug = true +# end require "bundler/setup" require "traces/backend/datadog" diff --git a/spec/traces/backend/datadog_spec.rb b/spec/traces/backend/datadog_spec.rb index 52a29c1..83654f7 100644 --- a/spec/traces/backend/datadog_spec.rb +++ b/spec/traces/backend/datadog_spec.rb @@ -66,6 +66,14 @@ def my_span_and_context it {is_expected.to be == "my_span"} end + + describe '#[]=' do + before {span["my_key"] = "tag_value"} + + subject(:value) {span["my_key"]} + + it {is_expected.to be == "tag_value"} + end end describe Datadog::Tracing::TraceOperation do