lib/opentelemetry/sdk/trace/tracer.rb in opentelemetry-sdk-1.1.0 vs lib/opentelemetry/sdk/trace/tracer.rb in opentelemetry-sdk-1.2.0

- old
+ new

@@ -17,29 +17,23 @@ # @param [String] version Instrumentation package version # @param [TracerProvider] tracer_provider TracerProvider that initialized the tracer # # @return [Tracer] def initialize(name, version, tracer_provider) - @instrumentation_library = InstrumentationLibrary.new(name, version) + @instrumentation_scope = InstrumentationScope.new(name, version) @tracer_provider = tracer_provider end def start_root_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil) start_span(name, with_parent: Context.empty, attributes: attributes, links: links, start_timestamp: start_timestamp, kind: kind) end def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil) name ||= 'empty' - + kind ||= :internal with_parent ||= Context.current - parent_span = OpenTelemetry::Trace.current_span(with_parent) - parent_span_context = OpenTelemetry::Trace.current_span(with_parent).context - if parent_span_context.valid? - parent_span_id = parent_span_context.span_id - trace_id = parent_span_context.trace_id - end - @tracer_provider.internal_create_span(name, kind, trace_id, parent_span_id, attributes, links, start_timestamp, with_parent, parent_span, @instrumentation_library) + @tracer_provider.internal_start_span(name, kind, attributes, links, start_timestamp, with_parent, @instrumentation_scope) end end end end end