instana 1.9.2 → 1.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/instana/agent.rb +8 -6
- data/lib/instana/agent/tasks.rb +5 -2
- data/lib/instana/version.rb +1 -1
- data/test/agent/agent_test.rb +0 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b516628bd567b0a6fd89f7efc692769c8c5b8c4835c997b3a82ddcb89252020
|
4
|
+
data.tar.gz: d4ec473e20dde540a70a2a5a10a551f40ac9d5abc9ea13d78b159bda560c7fcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/instana/agent/tasks.rb
CHANGED
@@ -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
|
|
data/lib/instana/version.rb
CHANGED
data/test/agent/agent_test.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|