oboe 2.6.0.2 → 2.6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/README.md +29 -27
- data/lib/base.rb +8 -0
- data/lib/joboe_metal.rb +4 -2
- data/lib/oboe.rb +0 -1
- data/lib/oboe/api/layerinit.rb +4 -1
- data/lib/oboe/frameworks/padrino.rb +3 -0
- data/lib/oboe/frameworks/rails.rb +6 -2
- data/lib/oboe/frameworks/sinatra.rb +3 -0
- data/lib/oboe/loading.rb +6 -1
- data/lib/oboe/version.rb +2 -2
- data/lib/oboe_metal.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5236804c4d8fb3575b96b9adc6166157f3b262aa
|
4
|
+
data.tar.gz: c38126e75df9257d61b0c6572a96409795f37f0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be62476276374b23481ee433c76b784361a402b9b763730e2f86326758c9fac7e74d2af147fd560ed2780591557f9ded2853434c83655cc8424b60604f9c9429
|
7
|
+
data.tar.gz: a7de077c04074bd76205fd71a4831a67c621306fdcef8b0260727bb0927d3f2420e1a2383a43f4623a21df1f1761481606eecb68dcb95f3ce0bf077e1f67c6d3
|
data/Gemfile
CHANGED
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
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
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
|
|
data/lib/base.rb
CHANGED
@@ -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)
|
data/lib/joboe_metal.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Copyright (c) 2013 AppNeta, Inc.
|
2
2
|
# All rights reserved.
|
3
3
|
|
4
|
-
|
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
|
89
|
+
Oboe::API.report_init
|
88
90
|
end
|
89
91
|
|
90
92
|
rescue Exception => e
|
data/lib/oboe.rb
CHANGED
data/lib/oboe/api/layerinit.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
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
|
|
data/lib/oboe/loading.rb
CHANGED
@@ -88,5 +88,10 @@ module Oboe
|
|
88
88
|
end
|
89
89
|
|
90
90
|
Oboe::Loading.require_api
|
91
|
-
|
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
|
|
data/lib/oboe/version.rb
CHANGED
data/lib/oboe_metal.rb
CHANGED
@@ -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
|
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
|
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-
|
12
|
+
date: 2014-03-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|