Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions api/lib/opentelemetry/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def with_current(ctx)

# @param [String] key The lookup key
# @param [Object] value The object stored under key
# @param [Callable] Block to execute in a new context
# @yield [context, value] Yields the newly created context and value to
# the block
def with_value(key, value)
Expand All @@ -93,10 +92,8 @@ def with_value(key, value)
# Execute a block in a new context where its values are merged with the
# incoming values. Restores the previous context after the block executes.

# @param [String] key The lookup key
# @param [Hash] values Will be merged with values of the current context
# and returned in a new context
# @param [Callable] Block to execute in a new context
# @yield [context, values] Yields the newly created context and values
# to the block
def with_values(values)
Expand All @@ -119,6 +116,9 @@ def clear
Fiber.current.opentelemetry_context = []
end

# Returns an empty context.
#
# @return [Context]
def empty
new(EMPTY_ENTRIES)
end
Expand Down Expand Up @@ -160,7 +160,6 @@ def set_value(key, value)
#
# @param [Hash] values The values to be merged with the current context's
# entries.
# @param [Object] value Object to be stored under key
# @return [Context]
def set_values(values) # rubocop:disable Naming/AccessorMethodName
Context.new(@entries.merge(values))
Expand Down
5 changes: 3 additions & 2 deletions api/lib/opentelemetry/trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,9 @@ def current_span(context = nil)
# Returns a context containing the span, 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
# the returned context
# @param [Span] span The span to store in the returned context.
# @param [Context] parent_context The optional context to use as the parent
# for the returned context.
def context_with_span(span, parent_context: Context.current)
parent_context.set_value(CURRENT_SPAN_KEY, span)
end
Expand Down
2 changes: 1 addition & 1 deletion api/lib/opentelemetry/trace/span.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def add_attributes(attributes)
# documents} certain "standard attributes" that have prescribed semantic
# meanings.
#
# @param [OpenTelemetry::Trace::Link] the link object to add on the {Span}.
# @param [OpenTelemetry::Trace::Link] link The link object to add on the {Span}.
#
# @return [self] returns itself
def add_link(link)
Expand Down
Loading