lib/opentelemetry/trace/span.rb in opentelemetry-api-1.2.5 vs lib/opentelemetry/trace/span.rb in opentelemetry-api-1.3.0
- old
+ new
@@ -76,9 +76,31 @@
# @return [self] returns itself
def add_attributes(attributes)
self
end
+ # Add a link to a {Span}.
+ #
+ # Adding links at span creation using the `links` option is preferred
+ # to calling add_link later, because head sampling decisions can only
+ # consider information present during span creation.
+ #
+ # Example:
+ #
+ # span.add_link(OpenTelemetry::Trace::Link.new(span_to_link_from.context))
+ #
+ # Note that the OpenTelemetry project
+ # {https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/data-semantic-conventions.md
+ # documents} certain "standard attributes" that have prescribed semantic
+ # meanings.
+ #
+ # @param [OpenTelemetry::Trace::Link] the link object to add on the {Span}.
+ #
+ # @return [self] returns itself
+ def add_link(link)
+ self
+ end
+
# Add an event to a {Span}.
#
# Example:
#
# span.add_event('event', attributes: {'eager' => true})