Module: Oboe::API::LayerInit

Defined in:
lib/oboe/api/layerinit.rb

Instance Method Summary collapse

Instance Method Details

#force_traceObject



19
20
21
22
23
24
25
# File 'lib/oboe/api/layerinit.rb', line 19

def force_trace
  saved_mode = Oboe::Config[:tracing_mode]
  Oboe::Config[:tracing_mode] = 'always'
  yield
ensure
  Oboe::Config[:tracing_mode] = saved_mode
end

#report_init(layer) ⇒ Object

Internal: Report that instrumentation for the given layer has been installed, as well as the version of instrumentation and version of layer.



8
9
10
11
12
13
14
15
16
17
# File 'lib/oboe/api/layerinit.rb', line 8

def report_init(layer)
  platform_info                  = { '__Init' => 1 }
  platform_info['RubyVersion']   = RUBY_VERSION
  platform_info['RailsVersion']  = ::Rails.version if defined?(Rails)
  platform_info['OboeVersion']   = Gem.loaded_specs['oboe'].try(:version).to_s

  force_trace do
    start_trace(layer, nil, platform_info) { }
  end
end