lib/elastic_apm.rb
# rubocop:disable Metrics/MethodLength
# Start a new span
#
# @param name [String] A description of the span, eq `SELECT FROM "users"`
# @param type [String] The kind of span, eq `db.mysql2.query`
# @param context [Span::Context] Context information about the span
# @yield [Span] Optional block encapsulating span
# @return [Span] Unless block given
# @deprecated See `with_span` or `start_span`
disable Metrics/MethodLength
Start a new span
disable Metrics / MethodLength Start a new span
def span(name, type = nil, context: nil, include_stacktrace: true, &block)
      return (block_given? ? yield : nil) unless agent
      if block_given?
        with_span(
          name,
          type,
          context:
          context,
          include_stacktrace: include_stacktrace,
          &block
        )
      else
        start_span(
          name,
          type,
          context: context,
          include_stacktrace: include_stacktrace
        )
      end
    end
def span ( name , type = nil , context : nil , include_stacktrace : true , & block ) return ( block_given? ? yield : nil ) unless agent if block_given? with_span ( name , type , context : context , include_stacktrace : include_stacktrace , & block ) else start_span ( name , type , context : context , include_stacktrace : include_stacktrace ) end end
rubocop:disable Metrics/MethodLength
Start a new span
rubocop : disable Metrics / MethodLength Start a new span
Unless block given
Unless block given
Span
name
A description of the span, eq `SELECT FROM "users"`
A description of the span eq ` SELECT FROM " users " `
type
The kind of span, eq `db.mysql2.query`
The kind of span eq ` db . mysql2 . query `
context
Context information about the span
Context information about the span
include_stacktrace
block
]
Optional block encapsulating span
Optional block encapsulating span
deprecated
See `with_span` or `start_span`
See ` with_span ` or ` start_span `