class ElasticAPM::Span
def initialize(
def initialize( name:, transaction:, trace_context:, parent:, type: nil, subtype: nil, action: nil, context: nil, stacktrace_builder: nil, sync: nil, exit_span: false ) @name = name if subtype.nil? && type&.include?('.') @type, @subtype, @action = type.split('.') else @type = type || DEFAULT_TYPE @subtype = subtype @action = action end @transaction = transaction @parent = parent @trace_context = trace_context || parent.trace_context.child @sample_rate = transaction.sample_rate @context = context || Span::Context.new(sync: sync) @stacktrace_builder = stacktrace_builder @exit_span = exit_span end