lib/opentelemetry/sdk/trace/span.rb in opentelemetry-sdk-1.0.2 vs lib/opentelemetry/sdk/trace/span.rb in opentelemetry-sdk-1.0.3
- old
+ new
@@ -349,10 +349,12 @@
def truncate_attribute_values(attrs)
return EMPTY_ATTRIBUTES if attrs.nil?
attribute_length_limit = @span_limits.attribute_length_limit
- attrs.each { |key, value| attrs[key] = OpenTelemetry::Common::Utilities.truncate(value, attribute_length_limit) } if attribute_length_limit
+ return attrs if attribute_length_limit.nil?
+
+ attrs.transform_values! { |value| OpenTelemetry::Common::Utilities.truncate_attribute_value(value, attribute_length_limit) }
attrs
end
def trim_links(links, link_count_limit, link_attribute_count_limit) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
# Fast path (likely) common cases.