instana 1.7.5 → 1.7.6

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: 968b0d69a6812e078d8e16552798b28005fc9cf1
4
- data.tar.gz: 23b3315b9dce25b258156e85e3eebbc221b81396
3
+ metadata.gz: d45e4817a11c73f3e703e38cacb884cc2219393e
4
+ data.tar.gz: 099bd8ed5eb581eb5f550c1d22c1cb3744e1fc97
5
5
  SHA512:
6
- metadata.gz: f99acdde5c0fe11ca3ef729c82f43b4f8e28647a67c7f92f3f6ff04ab3c1e3967e7a89ee0466c6fd7d57ef6bc8b18fee4706690bb69c12e33e55a84d08826afb
7
- data.tar.gz: d48ea584fd211c9a3533654155610c2ac776ca5a852ac69b34781bca374837f28203ec66d8b17f4a20793eb91a29086e90e6acefdb60ea473edac7839bd07bc3
6
+ metadata.gz: 43ff3857a545a20eaea8295aa513abe77f3e5e15e7641235bcdcfaf146b502e28d75119f680a6c6933bf53151ed5ed3f7a5f0d9636ea46de26172bb4eaf4d733
7
+ data.tar.gz: 7fba5eb8b19c8c5a3da7df4cdc25af0e57de41c375eb2fff90059649950cc3c9566c8ccb43ddb5e81b49145727031babe10438c2ad3e62686e946b3e5aff557a
@@ -21,6 +21,8 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.required_ruby_version = '>= 2.1'
23
23
 
24
+ spec.licenses = ['MIT']
25
+
24
26
  spec.add_development_dependency "bundler", "~> 1.11"
25
27
  spec.add_development_dependency "rake", "~> 10.0"
26
28
  spec.add_development_dependency "minitest", "~> 5.0"
@@ -33,6 +35,7 @@ Gem::Specification.new do |spec|
33
35
  spec.add_runtime_dependency('sys-proctable', '>= 1.1.3')
34
36
  spec.add_runtime_dependency('get_process_mem', '>= 0.2.1')
35
37
  spec.add_runtime_dependency('timers', '>= 4.0.0')
38
+ spec.add_runtime_dependency('oj', '~> 3.3')
36
39
 
37
40
  # Indirect dependency
38
41
  # https://github.com/instana/ruby-sensor/issues/10
@@ -1,4 +1,4 @@
1
- require 'json'
1
+ require 'oj'
2
2
  require 'net/http'
3
3
  require 'socket'
4
4
  require 'sys/proctable'
@@ -7,6 +7,8 @@ require 'uri'
7
7
  require 'thread'
8
8
  include Sys
9
9
 
10
+ Oj.default_options = {:mode => :strict}
11
+
10
12
  module Instana
11
13
  class Agent
12
14
  attr_accessor :state
@@ -205,14 +207,14 @@ module Instana
205
207
 
206
208
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{DISCOVERY_PATH}")
207
209
  req = Net::HTTP::Put.new(uri)
208
- req.body = announce_payload.to_json
210
+ req.body = Oj.dump(announce_payload)
209
211
 
210
212
  ::Instana.logger.debug "Announce: http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{DISCOVERY_PATH} - payload: #{req.body}"
211
213
 
212
214
  response = make_host_agent_request(req)
213
215
 
214
216
  if response && (response.code.to_i == 200)
215
- data = JSON.parse(response.body)
217
+ data = Oj.load(response.body)
216
218
  @process[:report_pid] = data['pid']
217
219
  @agent_uuid = data['agentUuid']
218
220
  true
@@ -243,7 +245,7 @@ module Instana
243
245
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{path}")
244
246
  req = Net::HTTP::Post.new(uri)
245
247
 
246
- req.body = payload.to_json
248
+ req.body = Oj.dump(payload)
247
249
  response = make_host_agent_request(req)
248
250
 
249
251
  if response
@@ -271,7 +273,7 @@ module Instana
271
273
  # @param json_string [String] the request from the host agent
272
274
  #
273
275
  def handle_response(json_string)
274
- their_request = JSON.parse(json_string).first
276
+ their_request = Oj.load(json_string)
275
277
 
276
278
  if their_request.key?("action")
277
279
  if their_request["action"] == "ruby.source"
@@ -286,7 +288,7 @@ module Instana
286
288
  path = "com.instana.plugin.ruby/response.#{@process[:report_pid]}?messageId=#{URI.encode(their_request['messageId'])}"
287
289
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{path}")
288
290
  req = Net::HTTP::Post.new(uri)
289
- req.body = payload.to_json
291
+ req.body = Oj.dump(payload)
290
292
  ::Instana.logger.debug "Responding to agent request: #{req.inspect}"
291
293
  make_host_agent_request(req)
292
294
  end
@@ -308,7 +310,7 @@ module Instana
308
310
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{path}")
309
311
  req = Net::HTTP::Post.new(uri)
310
312
 
311
- req.body = spans.to_json
313
+ req.body = Oj.dump(spans)
312
314
  response = make_host_agent_request(req)
313
315
 
314
316
  if response
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.7.5"
2
+ VERSION = "1.7.6"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -1,4 +1,7 @@
1
1
  require 'test_helper'
2
+ require 'oj'
3
+
4
+ Oj.default_options = {:mode => :strict}
2
5
 
3
6
  class AgentTest < Minitest::Test
4
7
  def test_agent_host_detection
@@ -65,7 +68,7 @@ class AgentTest < Minitest::Test
65
68
  ::Instana.agent.instance_variable_set(:@discovered, discovery)
66
69
 
67
70
  url = "http://#{::Instana.config[:agent_host]}:#{::Instana.config[:agent_port]}/com.instana.plugin.ruby.discovery"
68
- json = { 'pid' => Process.pid, 'agentUuid' => 'abc' }.to_json
71
+ json = Oj.dump({ 'pid' => Process.pid, 'agentUuid' => 'abc' })
69
72
  stub_request(:put, url).to_return(:body => json, :status => 200)
70
73
 
71
74
  assert_equal true, ::Instana.agent.announce_sensor
@@ -92,7 +95,7 @@ class AgentTest < Minitest::Test
92
95
  ::Instana.agent.instance_variable_set(:@discovered, discovery)
93
96
 
94
97
  url = "http://#{::Instana.config[:agent_host]}:#{::Instana.config[:agent_port]}/com.instana.plugin.ruby.discovery"
95
- json = { 'pid' => Process.pid, 'agentUuid' => 'abc' }.to_json
98
+ json = Oj.dump({ 'pid' => Process.pid, 'agentUuid' => 'abc' })
96
99
  stub_request(:put, url).to_return(:body => json, :status => 200)
97
100
  ::Instana.agent.announce_sensor
98
101
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instana
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.5
4
+ version: 1.7.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-22 00:00:00.000000000 Z
11
+ date: 2017-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: 4.0.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: oj
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '3.3'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '3.3'
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: ffi
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +290,8 @@ files:
276
290
  - test/tracing/tracer_async_test.rb
277
291
  - test/tracing/tracer_test.rb
278
292
  homepage: https://www.instana.com/
279
- licenses: []
293
+ licenses:
294
+ - MIT
280
295
  metadata: {}
281
296
  post_install_message:
282
297
  rdoc_options: []
@@ -294,51 +309,51 @@ required_rubygems_version: !ruby/object:Gem::Requirement
294
309
  version: '0'
295
310
  requirements: []
296
311
  rubyforge_project:
297
- rubygems_version: 2.6.11
312
+ rubygems_version: 2.6.13
298
313
  signing_key:
299
314
  specification_version: 4
300
315
  summary: Ruby sensor for Instana
301
316
  test_files:
302
- - test/agent/agent_test.rb
303
- - test/apps/cuba.rb
304
- - test/apps/grpc_server.rb
305
317
  - test/apps/roda.rb
306
318
  - test/apps/sinatra.rb
319
+ - test/apps/grpc_server.rb
320
+ - test/apps/cuba.rb
321
+ - test/config_test.rb
322
+ - test/agent/agent_test.rb
323
+ - test/servers/sidekiq/worker.rb
324
+ - test/servers/rackapp_6511.rb
325
+ - test/servers/rails_3205.rb
326
+ - test/servers/grpc_50051.rb
327
+ - test/servers/helpers/sidekiq_worker_initializer.rb
328
+ - test/instrumentation/excon_test.rb
329
+ - test/instrumentation/net-http_test.rb
330
+ - test/instrumentation/dalli_test.rb
331
+ - test/instrumentation/sidekiq-client_test.rb
332
+ - test/instrumentation/redis_test.rb
333
+ - test/instrumentation/grpc_test.rb
334
+ - test/instrumentation/sidekiq-worker_test.rb
335
+ - test/instrumentation/rest-client_test.rb
336
+ - test/test_helper.rb
337
+ - test/models/block.rb
307
338
  - test/benchmarks/bench_id_generation.rb
308
339
  - test/benchmarks/bench_opentracing.rb
309
- - test/config_test.rb
310
- - test/frameworks/cuba_test.rb
311
- - test/frameworks/rack_test.rb
312
- - test/frameworks/rails/actioncontroller_test.rb
340
+ - test/frameworks/rails/activerecord4_test.rb
341
+ - test/frameworks/rails/actionview5_test.rb
342
+ - test/frameworks/rails/activerecord5_test.rb
313
343
  - test/frameworks/rails/actionview3_test.rb
314
344
  - test/frameworks/rails/actionview4_test.rb
315
- - test/frameworks/rails/actionview5_test.rb
345
+ - test/frameworks/rails/actioncontroller_test.rb
316
346
  - test/frameworks/rails/activerecord3_test.rb
317
- - test/frameworks/rails/activerecord4_test.rb
318
- - test/frameworks/rails/activerecord5_test.rb
319
- - test/frameworks/roda_test.rb
347
+ - test/frameworks/rack_test.rb
320
348
  - test/frameworks/sinatra_test.rb
349
+ - test/frameworks/roda_test.rb
350
+ - test/frameworks/cuba_test.rb
321
351
  - test/instana_test.rb
322
- - test/instrumentation/dalli_test.rb
323
- - test/instrumentation/excon_test.rb
324
- - test/instrumentation/grpc_test.rb
325
- - test/instrumentation/net-http_test.rb
326
- - test/instrumentation/redis_test.rb
327
- - test/instrumentation/rest-client_test.rb
328
- - test/instrumentation/sidekiq-client_test.rb
329
- - test/instrumentation/sidekiq-worker_test.rb
330
- - test/jobs/sidekiq_job_1.rb
331
- - test/jobs/sidekiq_job_2.rb
332
- - test/models/block.rb
333
- - test/servers/grpc_50051.rb
334
- - test/servers/helpers/sidekiq_worker_initializer.rb
335
- - test/servers/rackapp_6511.rb
336
- - test/servers/rails_3205.rb
337
- - test/servers/sidekiq/worker.rb
338
- - test/test_helper.rb
339
- - test/tracing/custom_test.rb
340
- - test/tracing/id_management_test.rb
341
352
  - test/tracing/opentracing_test.rb
342
- - test/tracing/trace_test.rb
353
+ - test/tracing/custom_test.rb
343
354
  - test/tracing/tracer_async_test.rb
355
+ - test/tracing/trace_test.rb
344
356
  - test/tracing/tracer_test.rb
357
+ - test/tracing/id_management_test.rb
358
+ - test/jobs/sidekiq_job_2.rb
359
+ - test/jobs/sidekiq_job_1.rb