Sha256: bf7a1d644fb29ef1185c8bc4fff1e9596b49ed2c1f46659db7118d19f66c9a40

Contents?: true

Size: 1.25 KB

Versions: 16

Compression:

Stored size: 1.25 KB

Contents

# frozen_string_literal: true

# Copyright The OpenTelemetry Authors
#
# SPDX-License-Identifier: Apache-2.0

module OpenTelemetry
  module Internal
    # @api private
    #
    # {ProxyTracer} is an implementation of {OpenTelemetry::Trace::Tracer}. It is returned from
    # the ProxyTracerProvider until a delegate tracer provider is installed. After the delegate
    # tracer provider is installed, the ProxyTracer will delegate to the corresponding "real"
    # tracer.
    class ProxyTracer < Trace::Tracer
      attr_writer :delegate

      # Returns a new {ProxyTracer} instance.
      #
      # @return [ProxyTracer]
      def initialize
        @delegate = nil
      end

      def start_root_span(name, attributes: nil, links: nil, start_timestamp: nil, kind: nil)
        return @delegate.start_root_span(name, attributes: attributes, links: links, start_timestamp: start_timestamp, kind: kind) unless @delegate.nil?

        super
      end

      def start_span(name, with_parent: nil, attributes: nil, links: nil, start_timestamp: nil, kind: nil)
        return @delegate.start_span(name, with_parent: with_parent, attributes: attributes, links: links, start_timestamp: start_timestamp, kind: kind) unless @delegate.nil?

        super
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
opentelemetry-api-1.4.0 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.3.0 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.2.5 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.2.4 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.2.3 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.2.2 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.2.1 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.2.0 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.1.0 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.0.2 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.0.1 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.0.0 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.0.0.rc3 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.0.0.rc2 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-1.0.0.rc1 lib/opentelemetry/internal/proxy_tracer.rb
opentelemetry-api-0.17.0 lib/opentelemetry/internal/proxy_tracer.rb