module Bigcommerce::Lightstep

Lightstep module

Constants

VERSION

Public Class Methods

start(component_name: nil, transport_factory: nil) click to toggle source

Start the global tracer and configure LightStep

@param [String] component_name @param [::Bigcommerce::Lightstep::TransportFactory] transport_factory

# File lib/bigcommerce/lightstep.rb, line 51
def self.start(component_name: nil, transport_factory: nil)
  component_name ||= ::Bigcommerce::Lightstep.component_name
  transport_factory ||= ::Bigcommerce::Lightstep::TransportFactory.new
  ::LightStep.logger = logger
  tags = {}
  tags['service.version'] = ::Bigcommerce::Lightstep.release unless ::Bigcommerce::Lightstep.release.empty?
  ::LightStep.configure(
    component_name: component_name,
    transport: transport_factory.build,
    tags: tags
  )
  ::LightStep.instance.max_span_records = ::Bigcommerce::Lightstep.max_buffered_spans
  ::LightStep.instance.max_log_records = ::Bigcommerce::Lightstep.max_log_records
  ::LightStep.instance.report_period_seconds = ::Bigcommerce::Lightstep.max_reporting_interval_seconds

  return unless ::Bigcommerce::Lightstep.enabled

  ::Bigcommerce::Lightstep::Redis::Wrapper.patch
  ::Bigcommerce::Lightstep::ActiveRecord::Adapter.patch
end