Module: Pantomath

Defined in:
lib/pantomath.rb,
lib/pantomath/version.rb,
lib/pantomath/configuration.rb,
lib/pantomath/injector/sidekiq.rb,
lib/pantomath/injector/httparty.rb,
lib/pantomath/injector/net_http.rb,
lib/pantomath/instrumentation/grape/tracer.rb,
lib/pantomath/instrumentation/grape/adapter.rb,
lib/pantomath/instrumentation/sidekiq/tracer.rb,
lib/pantomath/instrumentation/abstract_tracer.rb,
lib/pantomath/instrumentation/httparty/tracer.rb,
lib/pantomath/instrumentation/net_http/tracer.rb,
lib/pantomath/instrumentation/sidekiq/adapter.rb,
lib/pantomath/instrumentation/httparty/adapter.rb,
lib/pantomath/instrumentation/net_http/adapter.rb,
lib/pantomath/instrumentation/action_controller/tracer.rb,
lib/pantomath/instrumentation/action_controller/adapter.rb

Defined Under Namespace

Modules: Injector, Instrumentation Classes: Configuration

Constant Summary collapse

VERSION =
"0.4.3"

Class Method Summary collapse

Class Method Details

.active_scopeObject



25
26
27
# File 'lib/pantomath.rb', line 25

def self.active_scope
  tracer.scope_manager.active
end

.active_spanObject



29
30
31
# File 'lib/pantomath.rb', line 29

def self.active_span
  tracer.active_span
end

.configurationObject



9
10
11
# File 'lib/pantomath.rb', line 9

def self.configuration
  @configuration ||= Configuration.new
end

.configure(&block) ⇒ Object



13
14
15
# File 'lib/pantomath.rb', line 13

def self.configure(&block)
  block.call(configuration)
end

.extract(format, carrier) ⇒ Object



33
34
35
# File 'lib/pantomath.rb', line 33

def self.extract(format, carrier)
  tracer.extract(format, carrier)
end

.inject(format, carrier) ⇒ Object



37
38
39
40
41
# File 'lib/pantomath.rb', line 37

def self.inject(format, carrier)
  return unless active_span

  tracer.inject(active_span.context, format, carrier)
end

.tracerObject



17
18
19
20
21
22
23
# File 'lib/pantomath.rb', line 17

def self.tracer
  @tracer ||= Jaeger::Client.build(
    host: configuration.agent_host,
    port: configuration.agent_port,
    service_name: configuration.service_name
  )
end