Module: Instana

Defined in:
lib/instana/base.rb,
lib/instana/util.rb,
lib/instana/agent.rb,
lib/instana/config.rb,
lib/instana/logger.rb,
lib/instana/tracer.rb,
lib/instana/version.rb,
lib/instana/collectors.rb,
lib/instana/thread_local.rb,
lib/instana/tracing/span.rb,
lib/instana/collectors/gc.rb,
lib/instana/tracing/trace.rb,
lib/instana/instrumentation.rb,
lib/instana/frameworks/rails.rb,
lib/instana/collectors/memory.rb,
lib/instana/collectors/thread.rb,
lib/instana/tracing/processor.rb,
lib/instana/instrumentation/rack.rb,
lib/instana/instrumentation/excon.rb,
lib/instana/instrumentation/rest-client.rb

Defined Under Namespace

Modules: Collector, Instrumentation, ThreadLocal, Util Classes: Agent, Config, Processor, Rack, Railtie, Span, Trace, Tracer, XLogger

Constant Summary collapse

VERSION =
"0.13.1"
AUTOLOAD_DIRECTORIES =
[:instrumentation, :frameworks].freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.agentObject

Returns the value of attribute agent.



7
8
9
# File 'lib/instana/base.rb', line 7

def agent
  @agent
end

.collectorsObject

Returns the value of attribute collectors.



8
9
10
# File 'lib/instana/base.rb', line 8

def collectors
  @collectors
end

.configObject

Returns the value of attribute config.



11
12
13
# File 'lib/instana/base.rb', line 11

def config
  @config
end

.loggerObject

Returns the value of attribute logger.



12
13
14
# File 'lib/instana/base.rb', line 12

def logger
  @logger
end

.pidObject

Returns the value of attribute pid.



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

def pid
  @pid
end

.processorObject

Returns the value of attribute processor.



10
11
12
# File 'lib/instana/base.rb', line 10

def processor
  @processor
end

.tracerObject

Returns the value of attribute tracer.



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

def tracer
  @tracer
end

Class Method Details

.pid_change?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/instana/base.rb', line 40

def pid_change?
  @pid != ::Process.pid
end

.setupObject

setup

Setup the Instana language agent to an informal “ready to run” state.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/instana/base.rb', line 21

def setup
  @logger = ::Instana::XLogger.new(STDOUT)
  if ENV.key?('INSTANA_GEM_TEST') || ENV.key?('INSTANA_GEM_DEV')
    @logger.level = Logger::DEBUG
  else
    @logger.level = Logger::WARN
  end
  @logger.unknown "Stan is on the scene.  Starting Instana instrumentation."

  @agent  = ::Instana::Agent.new
  @tracer = ::Instana::Tracer.new
  @processor = ::Instana::Processor.new
  @collectors = []

  # Store the current pid so we can detect a potential fork
  # later on
  @pid = ::Process.pid
end