diff --git a/lib/datadog/tracing/span_event.rb b/lib/datadog/tracing/span_event.rb index c8a3851c13..ab88919c77 100644 --- a/lib/datadog/tracing/span_event.rb +++ b/lib/datadog/tracing/span_event.rb @@ -1,34 +1,33 @@ -require 'time' - # frozen_string_literal: true +require 'time' + module Datadog - module Tracing - # SpanEvent represents an annotation on a span. - # @public_api - class SpanEvent - # @!attribute [r] name - # @return [Integer] - attr_reader :name - - # @!attribute [r] attributes - # @return [Hash] - attr_reader :attributes - - # @!attribute [r] time_unix_nano - # @return [Integer] - attr_reader :time_unix_nano - - def initialize( - name, - attributes: nil, - time_unix_nano: nil - ) - @name = name - @attributes = attributes&.map{|key, val| [key, val.to_s]}&.to_h || {} - @time_unix_nano = time_unix_nano || Core::Utils::Time.now.to_f * 1e9 - end + module Tracing + # SpanEvent represents an annotation on a span. + # @public_api + class SpanEvent + # @!attribute [r] name + # @return [Integer] + attr_reader :name + + # @!attribute [r] attributes + # @return [Hash] + attr_reader :attributes + + # @!attribute [r] time_unix_nano + # @return [Integer] + attr_reader :time_unix_nano + + def initialize( + name, + attributes: nil, + time_unix_nano: nil + ) + @name = name + @attributes = attributes&.map { |key, val| [key, val.to_s] }&.to_h || {} + @time_unix_nano = time_unix_nano || Core::Utils::Time.now.to_f * 1e9 end end end - \ No newline at end of file +end