instana 1.9.2 → 1.9.3

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
  SHA256:
3
- metadata.gz: cfd06dbcdef17ee23af827a31d44a8164cf411741f6b1e24cf663db29525aa78
4
- data.tar.gz: cd225402ace448611a928ea3d791f6e5b14a1f0ce84d466cceb9946a9cb79c40
3
+ metadata.gz: 5b516628bd567b0a6fd89f7efc692769c8c5b8c4835c997b3a82ddcb89252020
4
+ data.tar.gz: d4ec473e20dde540a70a2a5a10a551f40ac9d5abc9ea13d78b159bda560c7fcc
5
5
  SHA512:
6
- metadata.gz: c66287deebd47b616870b4bc662ce5036f0bcb107dc722935c0c8c9df63b6c7a7e0cba6df2d0a7114980e77419d6f4e9972995c5d9427bf4c9af710b6349749f
7
- data.tar.gz: 8c44efe3ab78a4a889ed829ece255fae612e1b5438024253a4577960a7634d891011c0b750a210040c215f2838746d5451c860f4b98bbd57a7a5ae725db5be7d
6
+ metadata.gz: 98e0fbce0e3dc7f41e9e9f6b5c1c422b0896e549e78eda9492d5113e8bea603dd8697740bac12f52a2f3bd0bca1339dddd40fea95f55c15aff2093d90ce93f36
7
+ data.tar.gz: 20083670850c5288a7a6fb88f9eb40e3508d1b33912adec99fbf9757bbe49e49d21a624bb20d14a7589711716803677a007904d1afb0da4eb86c2cbd94ae8384
data/lib/instana/agent.rb CHANGED
@@ -12,9 +12,9 @@ require 'instana/agent/tasks'
12
12
 
13
13
  include Sys
14
14
 
15
- Oj.default_options = {:mode => :strict}
16
-
17
15
  module Instana
16
+ OJ_OPTIONS = {:mode => :strict}
17
+
18
18
  class Agent
19
19
  include AgentHelpers
20
20
  include AgentHooks
@@ -209,14 +209,14 @@ module Instana
209
209
 
210
210
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{DISCOVERY_PATH}")
211
211
  req = Net::HTTP::Put.new(uri)
212
- req.body = Oj.dump(announce_payload)
212
+ req.body = Oj.dump(announce_payload, OJ_OPTIONS)
213
213
 
214
214
  ::Instana.logger.debug "Announce: http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{DISCOVERY_PATH} - payload: #{req.body}"
215
215
 
216
216
  response = make_host_agent_request(req)
217
217
 
218
218
  if response && (response.code.to_i == 200)
219
- data = Oj.load(response.body)
219
+ data = Oj.load(response.body, OJ_OPTIONS)
220
220
  @process[:report_pid] = data['pid']
221
221
  @agent_uuid = data['agentUuid']
222
222
 
@@ -251,7 +251,7 @@ module Instana
251
251
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{path}")
252
252
  req = Net::HTTP::Post.new(uri)
253
253
 
254
- req.body = Oj.dump(payload)
254
+ req.body = Oj.dump(payload, OJ_OPTIONS)
255
255
  response = make_host_agent_request(req)
256
256
 
257
257
  if response
@@ -290,7 +290,9 @@ module Instana
290
290
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{path}")
291
291
  req = Net::HTTP::Post.new(uri)
292
292
 
293
- req.body = Oj.dump(spans, :omit_nil => true)
293
+ opts = OJ_OPTIONS.merge({omit_nil: true})
294
+
295
+ req.body = Oj.dump(spans, opts)
294
296
  response = make_host_agent_request(req)
295
297
 
296
298
  if response
@@ -4,8 +4,11 @@ module AgentTasks
4
4
  #
5
5
  # @param json_string [String] the requests from the host agent
6
6
  #
7
+
8
+ OJ_OPTIONS = {mode: :strict}
9
+
7
10
  def handle_agent_tasks(json_string)
8
- tasks = Oj.load(json_string)
11
+ tasks = Oj.load(json_string, OJ_OPTIONS)
9
12
 
10
13
  if tasks.is_a?(Hash)
11
14
  process_agent_task(tasks)
@@ -34,7 +37,7 @@ module AgentTasks
34
37
  path = "com.instana.plugin.ruby/response.#{@process[:report_pid]}?messageId=#{URI.encode(task['messageId'])}"
35
38
  uri = URI.parse("http://#{@discovered[:agent_host]}:#{@discovered[:agent_port]}/#{path}")
36
39
  req = Net::HTTP::Post.new(uri)
37
- req.body = Oj.dump(payload)
40
+ req.body = Oj.dump(payload, OJ_OPTIONS)
38
41
  ::Instana.logger.debug "Responding to agent request: #{req.inspect}"
39
42
  make_host_agent_request(req)
40
43
 
@@ -1,4 +1,4 @@
1
1
  module Instana
2
- VERSION = "1.9.2"
2
+ VERSION = "1.9.3"
3
3
  VERSION_FULL = "instana-#{VERSION}"
4
4
  end
@@ -1,8 +1,6 @@
1
1
  require 'test_helper'
2
2
  require 'oj'
3
3
 
4
- Oj.default_options = {:mode => :strict}
5
-
6
4
  class AgentTest < Minitest::Test
7
5
  def test_agent_host_detection
8
6
  url = "http://#{::Instana.config[:agent_host]}:#{::Instana.config[:agent_port]}/"
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.9.2
4
+ version: 1.9.3
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: 2019-05-05 00:00:00.000000000 Z
11
+ date: 2019-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler