lib/opentelemetry/instrumentation/mysql2.rb in opentelemetry-instrumentation-mysql2-0.25.0 vs lib/opentelemetry/instrumentation/mysql2.rb in opentelemetry-instrumentation-mysql2-0.26.0
- old
+ new
@@ -18,21 +18,21 @@
private_constant :CURRENT_ATTRIBUTES_KEY
# Returns the attributes hash representing the Mysql2 context found
# in the optional context or the current context if none is provided.
#
- # @param [optional Context] context The context to lookup the current
+ # @param context [optional Context] The context to lookup the current
# attributes hash. Defaults to Context.current
def attributes(context = nil)
context ||= Context.current
context.value(CURRENT_ATTRIBUTES_KEY) || {}
end
- # Returns a context containing the merged attributes hash, derived from the
- # optional parent context, or the current context if one was not provided.
- #
- # @param [optional Context] context The context to use as the parent for
+ # @param attributes_hash [Hash] The attributes to add to the context
+ # @param parent_context [optional Context] The context to use as the parent for
# the returned context
+ # @return A context containing the merged attributes hash, derived from the
+ # optional parent context, or the current context if one was not provided.
def context_with_attributes(attributes_hash, parent_context: Context.current)
attributes_hash = attributes(parent_context).merge(attributes_hash)
parent_context.set_value(CURRENT_ATTRIBUTES_KEY, attributes_hash)
end