oboe 2.6.0.2 → 2.6.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf5cf2103662335b54454808e24505e4c0fe01ac
4
- data.tar.gz: 0e18b3bac19c85fbfba7a34c38c7edb28bb0f53b
3
+ metadata.gz: 5236804c4d8fb3575b96b9adc6166157f3b262aa
4
+ data.tar.gz: c38126e75df9257d61b0c6572a96409795f37f0e
5
5
  SHA512:
6
- metadata.gz: 94c63bc3a414703e1f29c2890a077af2c752dbcbd6f8de2e229b982802fa0b226d06186f8a0c8c5af54a526263c9dceb5f2074d64911f2420ba1ee595f5f0642
7
- data.tar.gz: a7519e0aded683d91e0cf088d82a12349183616c3dec0b27beb97d969df0fa7e54df7b47c63120078c7743cddf72bd1b6a5730be608fe2e794f985b98b6fbda1
6
+ metadata.gz: be62476276374b23481ee433c76b784361a402b9b763730e2f86326758c9fac7e74d2af147fd560ed2780591557f9ded2853434c83655cc8424b60604f9c9429
7
+ data.tar.gz: a7de077c04074bd76205fd71a4831a67c621306fdcef8b0260727bb0927d3f2420e1a2383a43f4623a21df1f1761481606eecb68dcb95f3ce0bf077e1f67c6d3
data/Gemfile CHANGED
@@ -8,7 +8,7 @@ group :development, :test do
8
8
  gem 'bson'
9
9
  end
10
10
 
11
- group :development, :test do
11
+ group :development do
12
12
  gem 'ruby-debug', :platform => :mri_18
13
13
  gem 'ruby-debug19', :platform => :mri_19, :require => 'ruby-debug'
14
14
  gem 'byebug', :platform => :mri_20
data/README.md CHANGED
@@ -52,22 +52,22 @@ After the prompts, this will create an initializer: `config/initializers/oboe.rb
52
52
  You can instrument your Sinatra application by adding the following code to your `config.ru` Rackup file:
53
53
 
54
54
  ```ruby
55
- # If you're not using Bundler.require. Make sure this is done
56
- # after the Sinatra require directive.
57
- require 'oboe'
58
-
59
- # When traces should be initiated for incoming requests. Valid options are
60
- # "always", "through" (when the request is initiated with a tracing header
61
- # from upstream) and "never". You must set this directive to "always" in
62
- # order to initiate tracing.
63
- Oboe::Config[:tracing_mode] = 'through'
64
-
65
- # You can remove the following line in production to allow for
66
- # auto sampling or managing the sample rate through the TraceView portal.
67
- # Oboe::Config[:sample_rate] = 1000000
68
-
69
- # You may want to replace the Oboe.logger with whichever logger you are using
70
- # Oboe.logger = Sinatra.logger
55
+ # If you're not using Bundler.require. Make sure this is done
56
+ # after the Sinatra require directive.
57
+ require 'oboe'
58
+
59
+ # When traces should be initiated for incoming requests. Valid options are
60
+ # "always", "through" (when the request is initiated with a tracing header
61
+ # from upstream) and "never". You must set this directive to "always" in
62
+ # order to initiate tracing.
63
+ Oboe::Config[:tracing_mode] = 'through'
64
+
65
+ # You can remove the following line in production to allow for
66
+ # auto sampling or managing the sample rate through the TraceView portal.
67
+ # Oboe::Config[:sample_rate] = 1000000
68
+
69
+ # You may want to replace the Oboe.logger with whichever logger you are using
70
+ # Oboe.logger = Sinatra.logger
71
71
  ```
72
72
 
73
73
  Note: If you're on Heroku, you don't need to set `tracing_mode` or `sample_rate` - they will be automatically configured.
@@ -83,17 +83,19 @@ As long as the oboe gem is in your `Gemfile` (inserted after the `gem 'padrino'`
83
83
  If you need to set `Oboe::Config` values on stack boot, you can do so by adding the following
84
84
  to your `config/boot.rb` file:
85
85
 
86
- Padrino.before_load do
87
- # When traces should be initiated for incoming requests. Valid options are
88
- # "always", "through" (when the request is initiated with a tracing header
89
- # from upstream) and "never". You must set this directive to "always" in
90
- # order to initiate tracing.
91
- Oboe::Config[:tracing_mode] = 'always'
92
-
93
- # You can remove the following line in production to allow for
94
- # auto sampling or managing the sample rate through the TraceView portal.
95
- Oboe::Config[:sample_rate] = 1e6
96
- end
86
+ ```ruby
87
+ Padrino.before_load do
88
+ # When traces should be initiated for incoming requests. Valid options are
89
+ # "always", "through" (when the request is initiated with a tracing header
90
+ # from upstream) and "never". You must set this directive to "always" in
91
+ # order to initiate tracing.
92
+ Oboe::Config[:tracing_mode] = 'always'
93
+
94
+ # You can remove the following line in production to allow for
95
+ # auto sampling or managing the sample rate through the TraceView portal.
96
+ Oboe::Config[:sample_rate] = 1e6
97
+ end
98
+ ```
97
99
 
98
100
  Note: If you're on Heroku, you don't need to set `tracing_mode` or `sample_rate` - they will be automatically configured.
99
101
 
@@ -58,6 +58,14 @@ module OboeBase
58
58
  Context.log(layer, label, options = options)
59
59
  end
60
60
 
61
+ def heroku?
62
+ false
63
+ end
64
+
65
+ def forking_webserver?
66
+ defined?(::Unicorn)
67
+ end
68
+
61
69
  ##
62
70
  # These methods should be implemented by the descendants
63
71
  # (Oboe_metal, Oboe_metal (JRuby), Heroku_metal)
@@ -1,7 +1,9 @@
1
1
  # Copyright (c) 2013 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
- module Oboe_metal < MetalBase
4
+ require 'base'
5
+
6
+ module Oboe_metal
5
7
  include_package 'com.tracelytics.joboe'
6
8
  import 'com.tracelytics.joboe'
7
9
  include_package 'com.tracelytics.joboe.SettingsReader'
@@ -84,7 +86,7 @@ module Oboe_metal < MetalBase
84
86
  # Only report __Init from here if we are not instrumenting a framework.
85
87
  # Otherwise, frameworks will handle reporting __Init after full initialization
86
88
  unless defined?(::Rails) or defined?(::Sinatra) or defined?(::Padrino)
87
- Oboe::API.report_init('rack') unless ["development", "test"].include? ENV['RACK_ENV']
89
+ Oboe::API.report_init
88
90
  end
89
91
 
90
92
  rescue Exception => e
@@ -6,7 +6,6 @@ begin
6
6
  require 'oboe/logger'
7
7
  require 'oboe/util'
8
8
  require 'oboe/xtrace'
9
- require 'base.rb'
10
9
 
11
10
  # If Oboe_metal is already defined then we are in a PaaS environment
12
11
  # with an alternate metal (such as Heroku: see the oboe-heroku gem)
@@ -8,7 +8,10 @@ module Oboe
8
8
  # installed, as well as the version of instrumentation and version of
9
9
  # layer.
10
10
  #
11
- def report_init(layer)
11
+ def report_init(layer = 'rack')
12
+ # Don't send __Init in development or test
13
+ return if ["development", "test"].include? ENV['RACK_ENV']
14
+
12
15
  platform_info = { '__Init' => 1 }
13
16
 
14
17
  begin
@@ -57,6 +57,9 @@ if defined?(::Padrino)
57
57
  if defined?(::Padrino::Rendering)
58
58
  ::Oboe::Util.send_include(::Padrino::Rendering::InstanceMethods, ::Oboe::PadrinoInst::Rendering)
59
59
  end
60
+
61
+ # Report __Init after fork when in Heroku
62
+ Oboe::API.report_init unless Oboe.heroku?
60
63
  end
61
64
 
62
65
  end
@@ -111,7 +111,9 @@ if defined?(::Rails)
111
111
  Oboe::Loading.load_access_key
112
112
  Oboe::Inst.load_instrumentation
113
113
  Oboe::Rails.load_instrumentation
114
- Oboe::API.report_init('rack') unless ["development", "test"].include? ENV['RACK_ENV']
114
+
115
+ # Report __Init after fork when in Heroku
116
+ Oboe::API.report_init unless Oboe.heroku?
115
117
  end
116
118
  end
117
119
  end
@@ -128,7 +130,9 @@ if defined?(::Rails)
128
130
  Oboe::Inst.load_instrumentation
129
131
  Oboe::Rails.load_instrumentation
130
132
  Oboe::Rails.include_helpers
131
- Oboe::API.report_init('rack') unless ["development", "test"].include? ENV['RACK_ENV']
133
+
134
+ # Report __Init after fork when in Heroku
135
+ Oboe::API.report_init unless Oboe.heroku?
132
136
  end
133
137
  end
134
138
  end
@@ -58,6 +58,9 @@ if defined?(::Sinatra)
58
58
  # instrumentation won't work anyways. Only load for pure Sinatra apps.
59
59
  ::Oboe::Util.send_include(::Sinatra::Base, ::Oboe::Sinatra::Base)
60
60
  ::Oboe::Util.send_include(::Sinatra::Templates, ::Oboe::Sinatra::Templates)
61
+
62
+ # Report __Init after fork when in Heroku
63
+ Oboe::API.report_init unless Oboe.heroku?
61
64
  end
62
65
  end
63
66
 
@@ -88,5 +88,10 @@ module Oboe
88
88
  end
89
89
 
90
90
  Oboe::Loading.require_api
91
- Oboe::Reporter.start
91
+
92
+ # Auto-start the Reporter unless we running Unicorn on Heroku
93
+ # In that case, we start the reporters after fork
94
+ unless defined?(::Unicorn) and ENV.has_key?('TRACEVIEW_URL')
95
+ Oboe::Reporter.start
96
+ end
92
97
 
@@ -5,8 +5,8 @@ module Oboe
5
5
  module Version
6
6
  MAJOR = 2
7
7
  MINOR = 6
8
- PATCH = 0
9
- BUILD = 2
8
+ PATCH = 1
9
+ BUILD = 0
10
10
 
11
11
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
12
12
  end
@@ -1,6 +1,8 @@
1
1
  # Copyright (c) 2013 AppNeta, Inc.
2
2
  # All rights reserved.
3
3
 
4
+ require 'base'
5
+
4
6
  module Oboe_metal
5
7
  class Context
6
8
  class << self
@@ -55,7 +57,7 @@ module Oboe_metal
55
57
  # Only report __Init from here if we are not instrumenting a framework.
56
58
  # Otherwise, frameworks will handle reporting __Init after full initialization
57
59
  unless defined?(::Rails) or defined?(::Sinatra) or defined?(::Padrino)
58
- Oboe::API.report_init('rack') unless ["development", "test"].include? ENV['RACK_ENV']
60
+ Oboe::API.report_init
59
61
  end
60
62
 
61
63
  rescue Exception => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oboe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0.2
4
+ version: 2.6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-10 00:00:00.000000000 Z
12
+ date: 2014-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake