oboe 2.7.7.1 → 2.7.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +5 -1
- data/lib/joboe_metal.rb +6 -3
- data/lib/oboe/api/logging.rb +25 -1
- data/lib/oboe/base.rb +2 -2
- data/lib/oboe/inst/rack.rb +2 -7
- data/lib/oboe/version.rb +1 -1
- data/lib/oboe_metal.rb +18 -8
- data/test/frameworks/apps/grape_simple.rb +0 -1
- data/test/instrumentation/rack_test.rb +2 -0
- metadata +24 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b9bbd08a173607dee7479100a3d26a882dda4f1
|
4
|
+
data.tar.gz: 8ae72fb3f10506ccc4947628e77a55f3af33c6b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2b91731560f39824bb91dd58c25cfc4b5c4f16a799477d29c1e8e1565100962665b273c4ac920c47fe413bad7c635b6d7071905f6f4df352fb5d11859643af4
|
7
|
+
data.tar.gz: ae29ddce04ecec926340fedd43167a277e1afc05993c2405f868da6e37552d6ea7ff37e7770358547ebc9667b7ebf7c9f73abb61a66008ea6f1b9aa3b7594cce
|
data/Gemfile
CHANGED
data/lib/joboe_metal.rb
CHANGED
@@ -153,14 +153,17 @@ module Oboe
|
|
153
153
|
# Store the returned SampleRateConfig into Oboe::Config
|
154
154
|
if sr_cfg
|
155
155
|
begin
|
156
|
-
Oboe.sample_rate =
|
157
|
-
Oboe.sample_source =
|
156
|
+
Oboe::Config.sample_rate = cfg.sampleRate
|
157
|
+
Oboe::Config.sample_source = cfg.sampleRateSourceValue
|
158
158
|
# If we fail here, we do so quietly. This was we don't spam logs
|
159
159
|
# on every request
|
160
160
|
end
|
161
|
+
else
|
162
|
+
Oboe.sample_rate = -1
|
163
|
+
Oboe.sample_source = -1
|
161
164
|
end
|
162
165
|
|
163
|
-
sr_cfg
|
166
|
+
sr_cfg ? true : false
|
164
167
|
rescue => e
|
165
168
|
Oboe.logger.debug "[oboe/debug] #{e.message}"
|
166
169
|
false
|
data/lib/oboe/api/logging.rb
CHANGED
@@ -69,9 +69,33 @@ module Oboe
|
|
69
69
|
Oboe::Context.fromString(xtrace) if Oboe.pickup_context?(xtrace)
|
70
70
|
|
71
71
|
if Oboe.tracing?
|
72
|
+
# Pre-existing context. Either we inherited context from an
|
73
|
+
# incoming X-Trace request header or under JRuby, Joboe started
|
74
|
+
# tracing before the JRuby code was called (e.g. Tomcat)
|
72
75
|
Oboe.is_continued_trace = true
|
76
|
+
|
77
|
+
if Oboe.has_xtrace_header
|
78
|
+
opts[:TraceOrigin] = :continued_header
|
79
|
+
elsif Oboe.has_incoming_context
|
80
|
+
opts[:TraceOrigin] = :continued_context
|
81
|
+
else
|
82
|
+
opts[:TraceOrigin] = :continued
|
83
|
+
end
|
84
|
+
|
73
85
|
log_entry(layer, opts)
|
74
|
-
|
86
|
+
|
87
|
+
elsif opts.key?('Force')
|
88
|
+
# Forced tracing: used by __Init reporting
|
89
|
+
opts[:TraceOrigin] = :forced
|
90
|
+
log_event(layer, 'entry', Oboe::Context.startTrace, opts)
|
91
|
+
|
92
|
+
elsif Oboe.sample?(opts.merge(:layer => layer, :xtrace => xtrace))
|
93
|
+
# Probablistic tracing of a subset of requests based off of
|
94
|
+
# sample rate and sample source
|
95
|
+
opts[:SampleRate] = Oboe.sample_rate
|
96
|
+
opts[:SampleSource] = Oboe.sample_source
|
97
|
+
opts[:TraceOrigin] = :always_sampled
|
98
|
+
|
75
99
|
log_event(layer, 'entry', Oboe::Context.startTrace, opts)
|
76
100
|
end
|
77
101
|
end
|
data/lib/oboe/base.rb
CHANGED
data/lib/oboe/inst/rack.rb
CHANGED
@@ -37,6 +37,8 @@ module Oboe
|
|
37
37
|
report_kvs['Forwarded-Port'] = env['HTTP_X_FORWARDED_PORT'] if env.key?('HTTP_X_FORWARDED_PORT')
|
38
38
|
|
39
39
|
report_kvs['Ruby.Oboe.Version'] = ::Oboe::Version::STRING
|
40
|
+
report_kvs['ProcessID'] = Process.pid
|
41
|
+
report_kvs['ThreadID'] = Thread.current.to_s[/0x\w*/]
|
40
42
|
rescue StandardError => e
|
41
43
|
# Discard any potential exceptions. Debug log and report whatever we can.
|
42
44
|
Oboe.logger.debug "[oboe/debug] Rack KV collection error: #{e.inspect}"
|
@@ -50,13 +52,6 @@ module Oboe
|
|
50
52
|
report_kvs = {}
|
51
53
|
report_kvs[:URL] = URI.unescape(req.path)
|
52
54
|
|
53
|
-
if Oboe.always?
|
54
|
-
# Only report these KVs under tracing_mode 'always' (never for 'through')
|
55
|
-
# These KVs need to be in the entry event for server side.
|
56
|
-
report_kvs[:SampleRate] = Oboe.sample_rate
|
57
|
-
report_kvs[:SampleSource] = Oboe.sample_source
|
58
|
-
end
|
59
|
-
|
60
55
|
# Under JRuby, JOboe may have already started a trace. Make note of this
|
61
56
|
# if so and don't clear context on log_end (see oboe/api/logging.rb)
|
62
57
|
Oboe.has_incoming_context = Oboe.tracing?
|
data/lib/oboe/version.rb
CHANGED
data/lib/oboe_metal.rb
CHANGED
@@ -85,7 +85,7 @@ module Oboe
|
|
85
85
|
class << self
|
86
86
|
def sample?(opts = {})
|
87
87
|
begin
|
88
|
-
return false unless Oboe.always?
|
88
|
+
return false unless Oboe.always? && Oboe.loaded
|
89
89
|
|
90
90
|
# Assure defaults since SWIG enforces Strings
|
91
91
|
layer = opts[:layer] ? opts[:layer].strip : ''
|
@@ -94,13 +94,23 @@ module Oboe
|
|
94
94
|
|
95
95
|
rv = Oboe::Context.sampleRequest(layer, xtrace, tv_meta)
|
96
96
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
97
|
+
if rv == 0
|
98
|
+
if ENV.key?('OBOE_GEM_TEST')
|
99
|
+
# When in test, always trace and don't clear
|
100
|
+
# the stored sample rate/source
|
101
|
+
true
|
102
|
+
else
|
103
|
+
Oboe.sample_rate = -1
|
104
|
+
Oboe.sample_source = -1
|
105
|
+
false
|
106
|
+
end
|
107
|
+
else
|
108
|
+
# liboboe version > 1.3.1 returning a bit masked integer with SampleRate and
|
109
|
+
# source embedded
|
110
|
+
Oboe.sample_rate = (rv & SAMPLE_RATE_MASK)
|
111
|
+
Oboe.sample_source = (rv & SAMPLE_SOURCE_MASK) >> 24
|
112
|
+
true
|
113
|
+
end
|
104
114
|
rescue StandardError => e
|
105
115
|
Oboe.logger.debug "[oboe/error] sample? error: #{e.inspect}"
|
106
116
|
false
|
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.7.
|
4
|
+
version: 2.7.8.1
|
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:
|
12
|
+
date: 2015-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -187,36 +187,36 @@ signing_key:
|
|
187
187
|
specification_version: 4
|
188
188
|
summary: AppNeta TraceView performance instrumentation gem for Ruby
|
189
189
|
test_files:
|
190
|
-
- test/support/config_test.rb
|
191
|
-
- test/support/xtrace_test.rb
|
192
|
-
- test/support/liboboe_settings_test.rb
|
193
|
-
- test/profiling/method_test.rb
|
194
|
-
- test/minitest_helper.rb
|
195
|
-
- test/frameworks/sinatra_test.rb
|
196
190
|
- test/frameworks/grape_test.rb
|
191
|
+
- test/frameworks/padrino_test.rb
|
192
|
+
- test/frameworks/sinatra_test.rb
|
197
193
|
- test/frameworks/apps/sinatra_simple.rb
|
198
|
-
- test/frameworks/apps/grape_simple.rb
|
199
194
|
- test/frameworks/apps/padrino_simple.rb
|
200
|
-
- test/frameworks/
|
201
|
-
- test/
|
202
|
-
- test/instrumentation/
|
203
|
-
- test/instrumentation/rack_test.rb
|
204
|
-
- test/instrumentation/http_test.rb
|
195
|
+
- test/frameworks/apps/grape_simple.rb
|
196
|
+
- test/minitest_helper.rb
|
197
|
+
- test/instrumentation/mongo_test.rb
|
205
198
|
- test/instrumentation/redis_hashes_test.rb
|
206
|
-
- test/instrumentation/
|
199
|
+
- test/instrumentation/sequel_pg_test.rb
|
207
200
|
- test/instrumentation/redis_misc_test.rb
|
208
|
-
- test/instrumentation/
|
209
|
-
- test/instrumentation/memcached_test.rb
|
201
|
+
- test/instrumentation/dalli_test.rb
|
210
202
|
- test/instrumentation/redis_keys_test.rb
|
203
|
+
- test/instrumentation/redis_sortedsets_test.rb
|
204
|
+
- test/instrumentation/redis_strings_test.rb
|
205
|
+
- test/instrumentation/sequel_mysql_test.rb
|
206
|
+
- test/instrumentation/redis_sets_test.rb
|
207
|
+
- test/instrumentation/http_test.rb
|
211
208
|
- test/instrumentation/typhoeus_test.rb
|
212
209
|
- test/instrumentation/resque_test.rb
|
210
|
+
- test/instrumentation/em_http_request_test.rb
|
211
|
+
- test/instrumentation/moped_test.rb
|
212
|
+
- test/instrumentation/rack_test.rb
|
213
|
+
- test/instrumentation/memcache_test.rb
|
213
214
|
- test/instrumentation/faraday_test.rb
|
214
|
-
- test/instrumentation/redis_sortedsets_test.rb
|
215
|
-
- test/instrumentation/dalli_test.rb
|
216
|
-
- test/instrumentation/sequel_mysql_test.rb
|
217
215
|
- test/instrumentation/redis_lists_test.rb
|
218
|
-
- test/instrumentation/cassandra_test.rb
|
219
|
-
- test/instrumentation/redis_strings_test.rb
|
220
|
-
- test/instrumentation/sequel_pg_test.rb
|
221
|
-
- test/instrumentation/mongo_test.rb
|
222
216
|
- test/instrumentation/sequel_mysql2_test.rb
|
217
|
+
- test/instrumentation/cassandra_test.rb
|
218
|
+
- test/instrumentation/memcached_test.rb
|
219
|
+
- test/profiling/method_test.rb
|
220
|
+
- test/support/liboboe_settings_test.rb
|
221
|
+
- test/support/config_test.rb
|
222
|
+
- test/support/xtrace_test.rb
|