oboe 2.7.7.1-java → 2.7.8.1-java

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 44247dad53ec61599ece5203a8fccc1063797e33
4
- data.tar.gz: 1ae26684562b3282b90506580c0c203b4e9ce86f
3
+ metadata.gz: 62cd3db82e213327668a85173155c2a26f7283ec
4
+ data.tar.gz: e5c55906ad783742b8af7d35aa0e008eea6c4f38
5
5
  SHA512:
6
- metadata.gz: 7cada019bdb599b445c970ebc5c66bdcdb74447c91b24c064b4821611db33fd47c930167ab4db96ab4f318cd2c2d7776b4ed763aa4f5e6ba6d62f1500c7bc023
7
- data.tar.gz: abed2fc5e5fb5c34b661369f0c750b627143c2536c6e4d211998a03fc086a770807f05fd01a18bb6738037bf3dc0dfc5f89869ba3a15f514fc3c8bb427928e41
6
+ metadata.gz: 4a54753774a6c4ca87119e5dba44a7bb0f71c78358477fe084e0b40327e297074039e471cf85e6678c787c54d608af24f5278350d5de68394d3960db59ff6b96
7
+ data.tar.gz: bf1813f9ff669b8744bc3633df3d5457c5d72660b44b3215d1c3a7262c01903bb809c7bb668b95d2ac450594cd5824f5a4661b14833d4110fa17f2f9345e0578
data/CHANGELOG.md CHANGED
@@ -4,6 +4,41 @@ https://github.com/appneta/oboe-ruby/releases
4
4
 
5
5
  Dates in this file are in the format MM/DD/YYYY.
6
6
 
7
+ # oboe 2.7.8.1
8
+
9
+ This patch release includes:
10
+
11
+ * Improved sampling management and reporting
12
+
13
+ Pushed to Rubygems:
14
+
15
+ https://rubygems.org/gems/oboe/versions/2.7.8.1
16
+ https://rubygems.org/gems/oboe/versions/2.7.8.1-java
17
+
18
+
19
+ # oboe 2.7.7.1
20
+
21
+ This patch release includes:
22
+
23
+ * Add support and instrumentation for Sequel: #91
24
+
25
+ Pushed to Rubygems:
26
+
27
+ https://rubygems.org/gems/oboe/versions/2.7.7.1
28
+ https://rubygems.org/gems/oboe/versions/2.7.7.1-java
29
+
30
+ # oboe 2.7.6.2
31
+
32
+ This patch release includes:
33
+
34
+ * Fixed metrics when hosting a JRuby application under a Java webserver such as Tomcat: #94
35
+ * Fix for moped aggregate calls: #95
36
+
37
+ Pushed to Rubygems:
38
+
39
+ https://rubygems.org/gems/oboe/versions/2.7.6.2
40
+ https://rubygems.org/gems/oboe/versions/2.7.6.2-java
41
+
7
42
  # oboe 2.7.5.1 (11/20/2014)
8
43
 
9
44
  This patch release includes:
data/Gemfile CHANGED
@@ -39,7 +39,11 @@ if defined?(JRUBY_VERSION)
39
39
  else
40
40
  gem 'mysql'
41
41
  gem 'mysql2'
42
- gem 'pg'
42
+ if RUBY_VERSION < '1.9.3'
43
+ gem 'pg', '0.17.1'
44
+ else
45
+ gem 'pg'
46
+ end
43
47
  end
44
48
 
45
49
  if RUBY_VERSION >= '1.9'
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 = sr_cfg.sampleRate
157
- Oboe.sample_source = sr_cfg.sampleRateSource.a
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
@@ -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
- elsif opts.key?('Force') || Oboe.sample?(opts.merge(:layer => layer, :xtrace => xtrace))
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
@@ -31,8 +31,8 @@ module OboeBase
31
31
 
32
32
  attr_accessor :reporter
33
33
  attr_accessor :loaded
34
- attr_accessor :sample_source
35
- attr_accessor :sample_rate
34
+ thread_local :sample_source
35
+ thread_local :sample_rate
36
36
  thread_local :layer
37
37
  thread_local :layer_op
38
38
 
@@ -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
@@ -8,7 +8,7 @@ module Oboe
8
8
  module Version
9
9
  MAJOR = 2
10
10
  MINOR = 7
11
- PATCH = 7
11
+ PATCH = 8
12
12
  BUILD = 1
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
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
- # For older liboboe that returns true/false, just return that.
98
- return rv if [TrueClass, FalseClass].include?(rv.class) || (rv == 0)
99
-
100
- # liboboe version > 1.3.1 returning a bit masked integer with SampleRate and
101
- # source embedded
102
- Oboe.sample_rate = (rv & SAMPLE_RATE_MASK)
103
- Oboe.sample_source = (rv & SAMPLE_SOURCE_MASK) >> 24
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
@@ -1,7 +1,6 @@
1
1
  require 'grape'
2
2
 
3
3
  class GrapeSimple < Grape::API
4
- set :reload, true
5
4
 
6
5
  get '/json_endpoint' do
7
6
  present({ :test => true })
@@ -45,6 +45,8 @@ class RackTestApp < Minitest::Test
45
45
 
46
46
  assert traces[0].has_key?('SampleRate')
47
47
  assert traces[0].has_key?('SampleSource')
48
+ assert traces[1].has_key?('ProcessID')
49
+ assert traces[1].has_key?('ThreadID')
48
50
 
49
51
  assert last_response.ok?
50
52
 
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.7.1
4
+ version: 2.7.8.1
5
5
  platform: java
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-12-14 00:00:00.000000000 Z
12
+ date: 2015-01-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -186,35 +186,35 @@ specification_version: 4
186
186
  summary: AppNeta TraceView performance instrumentation gem for Ruby
187
187
  test_files:
188
188
  - test/minitest_helper.rb
189
- - test/support/config_test.rb
190
- - test/support/xtrace_test.rb
191
- - test/support/liboboe_settings_test.rb
192
- - test/profiling/method_test.rb
193
- - test/frameworks/sinatra_test.rb
194
189
  - test/frameworks/grape_test.rb
195
190
  - test/frameworks/padrino_test.rb
191
+ - test/frameworks/sinatra_test.rb
196
192
  - test/frameworks/apps/sinatra_simple.rb
197
- - test/frameworks/apps/grape_simple.rb
198
193
  - test/frameworks/apps/padrino_simple.rb
199
- - test/instrumentation/memcache_test.rb
200
- - test/instrumentation/moped_test.rb
201
- - test/instrumentation/rack_test.rb
202
- - test/instrumentation/http_test.rb
194
+ - test/frameworks/apps/grape_simple.rb
195
+ - test/instrumentation/mongo_test.rb
203
196
  - test/instrumentation/redis_hashes_test.rb
204
- - test/instrumentation/em_http_request_test.rb
197
+ - test/instrumentation/sequel_pg_test.rb
205
198
  - test/instrumentation/redis_misc_test.rb
206
- - test/instrumentation/redis_sets_test.rb
207
- - test/instrumentation/memcached_test.rb
199
+ - test/instrumentation/dalli_test.rb
208
200
  - test/instrumentation/redis_keys_test.rb
201
+ - test/instrumentation/redis_sortedsets_test.rb
202
+ - test/instrumentation/redis_strings_test.rb
203
+ - test/instrumentation/sequel_mysql_test.rb
204
+ - test/instrumentation/redis_sets_test.rb
205
+ - test/instrumentation/http_test.rb
209
206
  - test/instrumentation/typhoeus_test.rb
210
207
  - test/instrumentation/resque_test.rb
208
+ - test/instrumentation/em_http_request_test.rb
209
+ - test/instrumentation/moped_test.rb
210
+ - test/instrumentation/rack_test.rb
211
+ - test/instrumentation/memcache_test.rb
211
212
  - test/instrumentation/faraday_test.rb
212
- - test/instrumentation/redis_sortedsets_test.rb
213
- - test/instrumentation/dalli_test.rb
214
- - test/instrumentation/sequel_mysql_test.rb
215
213
  - test/instrumentation/redis_lists_test.rb
216
- - test/instrumentation/cassandra_test.rb
217
- - test/instrumentation/redis_strings_test.rb
218
- - test/instrumentation/sequel_pg_test.rb
219
- - test/instrumentation/mongo_test.rb
220
214
  - test/instrumentation/sequel_mysql2_test.rb
215
+ - test/instrumentation/cassandra_test.rb
216
+ - test/instrumentation/memcached_test.rb
217
+ - test/profiling/method_test.rb
218
+ - test/support/liboboe_settings_test.rb
219
+ - test/support/config_test.rb
220
+ - test/support/xtrace_test.rb