Method: Jaeger::Client::Tracer#start_span

Defined in:
lib/jaeger/client/tracer.rb

#start_span(operation_name, child_of: nil, references: nil, start_time: Time.now, tags: {}, ignore_active_scope: false) ⇒ Span

Starts a new span.

This is similar to #start_active_span, but the returned Span will not be registered via the ScopeManager.

Parameters:

  • operation_name (String)

    The operation name for the Span

  • child_of (SpanContext, Span) (defaults to: nil)

    SpanContext that acts as a parent to the newly-started Span. If a Span instance is provided, its context is automatically substituted. See [Reference] for more information.

    If specified, the ‘references` parameter must be omitted.

  • references (Array<Reference>) (defaults to: nil)

    An array of reference objects that identify one or more parent SpanContexts.

  • start_time (Time) (defaults to: Time.now)

    When the Span started, if not now

  • tags (Hash) (defaults to: {})

    Tags to assign to the Span at start time

  • ignore_active_scope (Boolean) (defaults to: false)

    whether to create an implicit References#CHILD_OF reference to the ScopeManager#active.

Returns:

  • (Span)

    The newly-started Span



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/jaeger/client/tracer.rb', line 46

def start_span(operation_name,
               child_of: nil,
               references: nil,
               start_time: Time.now,
               tags: {},
               ignore_active_scope: false,
               **)
  context = prepare_span_context(
    child_of: child_of,
    references: references,
    ignore_active_scope: ignore_active_scope
  )
  Span.new(
    context,
    operation_name,
    @reporter,
    start_time: start_time,
    references: references,
    tags: tags.merge(
      :'sampler.type' => @sampler.type,
      :'sampler.param' => @sampler.param
    )
  )
end