Class: Labkit::Tracing::OpenTracingFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/labkit/tracing/open_tracing_factory.rb

Constant Summary collapse

OPENTRACING_SCHEME =
"opentracing"

Class Method Summary collapse

Class Method Details

.create_tracer(service_name, connection_string) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/labkit/tracing/open_tracing_factory.rb', line 8

def self.create_tracer(service_name, connection_string)
  return unless connection_string.present?

  opentracing_details = parse_connection_string(connection_string)
  driver_name = opentracing_details[:driver_name]

  case driver_name
  when "jaeger"
    JaegerFactory.create_tracer(service_name, opentracing_details[:options])
  else
    raise "Unknown driver: #{driver_name}"
  end
end