Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jterapin committed Aug 5, 2024
1 parent 61b0c3b commit 3f6107a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
18 changes: 9 additions & 9 deletions hearth/lib/hearth/telemetry/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def initialize(tracer_provider: nil, context_manager: nil)
class TracerProviderBase
# Returns a Tracer instance.
#
# @param [optional String] name Tracer name
# @param [String] name Tracer name
# @return [Tracer]
def tracer(name = nil)
raise NotImplementedError
Expand All @@ -43,9 +43,9 @@ class TracerBase
# lifecycle of the Span and its parent manually.
#
# @param [String] name Span name
# @param [optional object] with_parent Parent Context
# @param [optional Hash] attributes Attributes to attach to the span
# @param [optional Hearth::Telemetry::SpanKind] kind Type of Span
# @param [Object] with_parent Parent Context
# @param [Hash] attributes Attributes to attach to the span
# @param [Hearth::Telemetry::SpanKind] kind Type of Span
# @return [Span]
def start_span(name, with_parent: nil, attributes: nil, kind: nil)
raise NotImplementedError
Expand All @@ -58,8 +58,8 @@ def start_span(name, with_parent: nil, attributes: nil, kind: nil)
# provided block, it will be recorded on the span and re-raised.
#
# @param [String] name Span name
# @param [optional Hash] attributes Attributes to attach to the span
# @param [optional Hearth::Telemetry::SpanKind] kind Type of Span
# @param [Hash] attributes Attributes to attach to the span
# @param [Hearth::Telemetry::SpanKind] kind Type of Span
# @return [Span]
def in_span(name, attributes: nil, kind: nil)
raise NotImplementedError
Expand Down Expand Up @@ -96,7 +96,7 @@ def add_attributes(attributes)
# Add event to a Span.
#
# @param [String] name Name of the event.
# @param [optional Hash{String => String, Numeric, Boolean, Array<String,
# @param [Hash{String => String, Numeric, Boolean, Array<String,
# Numeric, Boolean>}] attributes Values must be non-nil and (array of)
# string, boolean or numeric type. Array values must not contain nil
# elements and all elements must be of the same basic type (string,
Expand All @@ -117,7 +117,7 @@ def status=(status)

# Finishes the Span.
#
# @param [optional Time] end_timestamp End timestamp for the span.
# @param [Time] end_timestamp End timestamp for the span.
# @return [self] returns itself
def finish(end_timestamp: nil)
raise NotImplementedError
Expand All @@ -127,7 +127,7 @@ def finish(end_timestamp: nil)
# exceptions can be recorded on a span.
#
# @param [Exception] exception The exception to be recorded
# @param [optional Hash{String => String, Numeric, Boolean, Array<String,
# @param [Hash{String => String, Numeric, Boolean, Array<String,
# Numeric, Boolean>}] attributes One or more key:value pairs, where the
# keys must be strings and the values may be (array of) string, boolean
# or numeric type.
Expand Down
16 changes: 8 additions & 8 deletions hearth/lib/hearth/telemetry/otel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def initialize(tracer)
# lifecycle of the Span and its parent manually.
#
# @param [String] name Span name
# @param [optional object] with_parent Parent Context
# @param [optional Hash] attributes Attributes to attach to the span
# @param [optional Hearth::Telemetry::SpanKind] kind Type of Span
# @param [Object] with_parent Parent Context
# @param [Hash] attributes Attributes to attach to the span
# @param [Hearth::Telemetry::SpanKind] kind Type of Span
# @return [Span]
def start_span(name, with_parent: nil, attributes: nil, kind: nil)
span = @tracer.start_span(
Expand All @@ -95,8 +95,8 @@ def start_span(name, with_parent: nil, attributes: nil, kind: nil)
# provided block, it will be recorded on the span and re-raised.
#
# @param [String] name Span name
# @param [optional Hash] attributes Attributes to attach to the span
# @param [optional Hearth::Telemetry::SpanKind] kind Type of Span
# @param [Hash] attributes Attributes to attach to the span
# @param [Hearth::Telemetry::SpanKind] kind Type of Span
# @return [Span]
def in_span(name, attributes: nil, kind: nil, &block)
@tracer.in_span(name, attributes: attributes, kind: kind) do |span|
Expand Down Expand Up @@ -141,7 +141,7 @@ def add_attributes(attributes)
# Add event to a Span.
#
# @param [String] name Name of the event.
# @param [optional Hash{String => String, Numeric, Boolean, Array<String,
# @param [Hash{String => String, Numeric, Boolean, Array<String,
# Numeric, Boolean>}] attributes Values must be non-nil and (array of)
# string, boolean or numeric type. Array values must not contain nil
# elements and all elements must be of the same basic type (string,
Expand All @@ -162,7 +162,7 @@ def status=(status)

# Finishes the Span.
#
# @param [optional Time] end_timestamp End timestamp for the span.
# @param [Time] end_timestamp End timestamp for the span.
# @return [self] returns itself
def finish(end_timestamp: nil)
@span.finish(end_timestamp: end_timestamp)
Expand All @@ -172,7 +172,7 @@ def finish(end_timestamp: nil)
# exceptions can be recorded on a span.
#
# @param [Exception] exception The exception to be recorded
# @param [optional Hash{String => String, Numeric, Boolean, Array<String,
# @param [Hash{String => String, Numeric, Boolean, Array<String,
# Numeric, Boolean>}] attributes One or more key:value pairs, where the
# keys must be strings and the values may be (array of) string, boolean
# or numeric type.
Expand Down

0 comments on commit 3f6107a

Please sign in to comment.