class ElasticAPM::Span

def initialize(

rubocop:disable Metrics/ParameterLists, Metrics/MethodLength
def initialize(
  name:,
  transaction_id:,
  trace_context:,
  type: nil,
  subtype: nil,
  action: nil,
  context: nil,
  stacktrace_builder: nil
)
  @name = name
  if subtype.nil? && type&.include?('.')
    @type, @subtype, @action = type.split('.')
  else
    @type = type || DEFAULT_TYPE
    @subtype = subtype
    @action = action
  end
  @transaction_id = transaction_id
  @trace_context = trace_context
  @context = context || Span::Context.new
  @stacktrace_builder = stacktrace_builder
end