diff --git a/api/lib/opentelemetry/trace/event.rb b/api/lib/opentelemetry/trace/event.rb index bc2bacab3..d7b50dd29 100644 --- a/api/lib/opentelemetry/trace/event.rb +++ b/api/lib/opentelemetry/trace/event.rb @@ -19,7 +19,7 @@ class Event # Returns the frozen attributes for this event # - # @return [Hash] + # @return [Hash{String => String, Numeric, Boolean}] attr_reader :attributes # Returns the timestamp for this event @@ -30,8 +30,9 @@ class Event # Returns a new immutable {Event}. # # @param [String] name The name of this event - # @param [optional Hash] attributes A hash of attributes for this - # event. Attributes will be frozen during Event initialization. + # @param [optional Hash{String => String, Numeric, Boolean}] + # attributes A hash of attributes for this event. Attributes will be + # frozen during Event initialization. # @param [optional Time] timestamp The timestamp for this event. # Defaults to Time.now. # @return [Event] diff --git a/api/lib/opentelemetry/trace/link.rb b/api/lib/opentelemetry/trace/link.rb index f6121956e..143d2003a 100644 --- a/api/lib/opentelemetry/trace/link.rb +++ b/api/lib/opentelemetry/trace/link.rb @@ -22,14 +22,15 @@ class Link # Returns the frozen attributes for this link. # - # @return [Hash] + # @return [Hash{String => String, Numeric, Boolean}] attr_reader :attributes # Returns a new immutable {Link}. # # @param [SpanContext] span_context The context of the linked {Span}. - # @param [optional Hash] attributes A hash of attributes for - # this link. Attributes will be frozen during Link initialization. + # @param [optional Hash{String => String, Numeric, Boolean}] attributes A + # hash of attributes for this link. Attributes will be frozen during + # Link initialization. # @return [Link] def initialize(span_context, attributes = nil) @context = span_context diff --git a/api/lib/opentelemetry/trace/span.rb b/api/lib/opentelemetry/trace/span.rb index d5ef59915..716290d3d 100644 --- a/api/lib/opentelemetry/trace/span.rb +++ b/api/lib/opentelemetry/trace/span.rb @@ -77,10 +77,10 @@ def set_attribute(key, value) # # @param [optional String] name Optional name of the event. This is # required if a block is not given. - # @param [optional Hash] attributes One or more key:value - # pairs, where the keys must be strings and the values may be string, - # boolean or numeric type. This argument should only be used when - # passing in a name. + # @param [optional Hash{String => String, Numeric, Boolean}] attributes + # One or more key:value pairs, where the keys must be strings and the + # values may be string, boolean or numeric type. This argument should + # only be used when passing in a name. # @param [optional Time] timestamp Optional timestamp for the event. # This argument should only be used when passing in a name. # diff --git a/sdk/lib/opentelemetry/sdk/trace/samplers/result.rb b/sdk/lib/opentelemetry/sdk/trace/samplers/result.rb index 349048b22..bc52105a3 100644 --- a/sdk/lib/opentelemetry/sdk/trace/samplers/result.rb +++ b/sdk/lib/opentelemetry/sdk/trace/samplers/result.rb @@ -19,7 +19,7 @@ class Result # Returns a frozen hash of attributes to be attached span. # - # @return [Hash] + # @return [Hash{String => String, Numeric, Boolean}] attr_reader :attributes # Returns a new sampling result with the specified decision and @@ -27,8 +27,9 @@ class Result # # @param [Symbol] decision Whether or not a span should be sampled # and/or record events. - # @param [optional Hash] attributes A frozen or freezable hash - # containing attributes to be attached to the span. + # @param [optional Hash{String => String, Numeric, Boolean}] + # attributes A frozen or freezable hash containing attributes to be + # attached to the span. def initialize(decision:, attributes: nil) @decision = decision @attributes = attributes.freeze || EMPTY_HASH diff --git a/sdk/lib/opentelemetry/sdk/trace/span.rb b/sdk/lib/opentelemetry/sdk/trace/span.rb index 12dc3b8ff..b87f387dc 100644 --- a/sdk/lib/opentelemetry/sdk/trace/span.rb +++ b/sdk/lib/opentelemetry/sdk/trace/span.rb @@ -24,7 +24,7 @@ class Span < OpenTelemetry::Trace::Span # use of SpanProcesses and should not be considered part of the public # interface for instrumentation. # - # @return [Hash] may be nil. + # @return [Hash{String => String, Numeric, Boolean}] may be nil. def attributes # Don't bother synchronizing. Access by SpanProcessors is expected to # be serialized. @@ -96,10 +96,10 @@ def set_attribute(key, value) # # @param [optional String] name Optional name of the event. This is # required if a block is not given. - # @param [optional Hash] attributes One or more key:value - # pairs, where the keys must be strings and the values may be string, - # boolean or numeric type. This argument should only be used when - # passing in a name. + # @param [optional Hash{String => String, Numeric, Boolean}] attributes + # One or more key:value pairs, where the keys must be strings and the + # values may be string, boolean or numeric type. This argument should + # only be used when passing in a name. # @param [optional Time] timestamp Optional timestamp for the event. # This argument should only be used when passing in a name. #