Module: Oboe

Includes:
Oboe_metal
Defined in:
lib/heroku_metal.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.reporterObject

Returns the value of attribute reporter.



51
52
53
# File 'lib/heroku_metal.rb', line 51

def reporter
  @reporter
end

Class Method Details

.always?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/heroku_metal.rb', line 53

def always?
  Oboe::Config[:tracing_mode].to_s == "always"
end

.disconnect!Object

Disconnect/Reconnect wrappers used for forking webservers such as Unicorn or Passenger



84
85
86
# File 'lib/heroku_metal.rb', line 84

def disconnect!
  ::Oboe::Context.disconnect(::Oboe.reporter)
end

.never?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/heroku_metal.rb', line 57

def never?
  Oboe::Config[:tracing_mode].to_s == "never"
end

.passthrough?Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/heroku_metal.rb', line 61

def passthrough?
  ["always", "through"].include?(Oboe::Config[:tracing_mode])
end

.reconnect!Object



88
89
90
# File 'lib/heroku_metal.rb', line 88

def reconnect!
  ::Oboe::Context.reconnect(::Oboe.reporter)
end

.sample?(opts = {}) ⇒ Boolean

Returns:

  • (Boolean)


65
66
67
68
69
70
71
# File 'lib/heroku_metal.rb', line 65

def sample?(opts = {})
  # Assure defaults since SWIG enforces Strings
  opts[:layer]      ||= ''
  opts[:xtrace]     ||= ''
  opts['TV-Meta']   ||= ''
  Oboe::Context.sampleRequest(opts[:layer], opts[:xtrace], opts['TV-Meta'])
end

.through?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/heroku_metal.rb', line 73

def through?
  Oboe::Config[:tracing_mode] == "through"
end

.tracing?Boolean

Returns:

  • (Boolean)


77
78
79
# File 'lib/heroku_metal.rb', line 77

def tracing?
  Oboe::Context.isValid and not Oboe.never?
end