instana 1.193.2 → 1.193.3.pre1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +194 -133
- data/.gitignore +2 -0
- data/.rubocop.yml +5 -1147
- data/.rubocop_todo.yml +1140 -0
- data/Appraisals +96 -0
- data/Gemfile +11 -32
- data/Rakefile +16 -39
- data/bin/console +5 -4
- data/gemfiles/.bundle/config +1 -2
- data/gemfiles/cuba_30.gemfile +14 -0
- data/gemfiles/dalli_20.gemfile +14 -0
- data/gemfiles/excon_02.gemfile +14 -0
- data/gemfiles/graphql_10.gemfile +14 -0
- data/gemfiles/grpc_10.gemfile +14 -0
- data/gemfiles/net_http_01.gemfile +13 -0
- data/gemfiles/rack_16.gemfile +14 -0
- data/gemfiles/rack_20.gemfile +14 -0
- data/gemfiles/rails_42.gemfile +16 -0
- data/gemfiles/rails_50.gemfile +16 -0
- data/gemfiles/rails_52.gemfile +16 -0
- data/gemfiles/rails_60.gemfile +16 -0
- data/gemfiles/redis_40.gemfile +14 -0
- data/gemfiles/resque_122.gemfile +15 -0
- data/gemfiles/resque_20.gemfile +14 -0
- data/gemfiles/rest_client_16.gemfile +14 -0
- data/gemfiles/rest_client_20.gemfile +14 -0
- data/gemfiles/roda_20.gemfile +14 -0
- data/gemfiles/roda_30.gemfile +14 -0
- data/gemfiles/sidekiq_42.gemfile +14 -0
- data/gemfiles/sidekiq_50.gemfile +14 -0
- data/gemfiles/sinatra_14.gemfile +14 -0
- data/instana.gemspec +1 -7
- data/lib/instana/activator.rb +41 -0
- data/lib/instana/activators/cuba.rb +18 -0
- data/lib/instana/activators/dalli.rb +20 -0
- data/lib/instana/activators/excon.rb +17 -0
- data/lib/instana/activators/graphql.rb +19 -0
- data/lib/instana/activators/grpc_client.rb +17 -0
- data/lib/instana/activators/grpc_server.rb +17 -0
- data/lib/instana/activators/net_http.rb +17 -0
- data/lib/instana/activators/rack.rb +13 -0
- data/lib/instana/activators/rails.rb +15 -0
- data/lib/instana/activators/redis.rb +17 -0
- data/lib/instana/activators/resque_client.rb +18 -0
- data/lib/instana/activators/resque_worker.rb +30 -0
- data/lib/instana/activators/rest_client.rb +17 -0
- data/lib/instana/activators/roda.rb +18 -0
- data/lib/instana/activators/sidekiq_client.rb +21 -0
- data/lib/instana/activators/sidekiq_worker.rb +21 -0
- data/lib/instana/activators/sinatra.rb +18 -0
- data/lib/instana/frameworks/cuba.rb +6 -13
- data/lib/instana/frameworks/rails.rb +0 -1
- data/lib/instana/frameworks/roda.rb +7 -13
- data/lib/instana/frameworks/sinatra.rb +1 -8
- data/lib/instana/instrumentation/dalli.rb +0 -6
- data/lib/instana/instrumentation/excon.rb +51 -57
- data/lib/instana/instrumentation/graphql.rb +16 -18
- data/lib/instana/instrumentation/grpc.rb +4 -10
- data/lib/instana/instrumentation/instrumented_request.rb +2 -1
- data/lib/instana/instrumentation/net-http.rb +2 -5
- data/lib/instana/instrumentation/rack.rb +1 -0
- data/lib/instana/instrumentation/redis.rb +0 -5
- data/lib/instana/instrumentation/resque.rb +0 -25
- data/lib/instana/instrumentation/rest-client.rb +0 -5
- data/lib/instana/instrumentation/sidekiq-client.rb +0 -9
- data/lib/instana/instrumentation/sidekiq-worker.rb +0 -9
- data/lib/instana/setup.rb +3 -1
- data/lib/instana/version.rb +1 -1
- data/test/activator_test.rb +27 -0
- data/test/frameworks/cuba_test.rb +38 -40
- data/test/frameworks/rails/activerecord_test.rb +13 -13
- data/test/frameworks/rails_test.rb +15 -0
- data/test/frameworks/roda_test.rb +39 -41
- data/test/frameworks/sinatra_test.rb +61 -64
- data/test/instrumentation/excon_test.rb +1 -0
- data/test/instrumentation/grpc_test.rb +2 -1
- data/test/instrumentation/{net-http_test.rb → net_http_test.rb} +1 -0
- data/test/instrumentation/{instrumented_request_test.rb → rack_instrumented_request_test.rb} +1 -1
- data/test/{frameworks → instrumentation}/rack_test.rb +0 -1
- data/test/instrumentation/resque_test.rb +3 -11
- data/test/instrumentation/{rest-client_test.rb → rest_client_test.rb} +6 -0
- data/test/instrumentation/sidekiq-client_test.rb +1 -0
- data/test/instrumentation/sidekiq-worker_test.rb +1 -0
- data/test/{servers/grpc_50051.rb → support/apps/grpc/boot.rb} +1 -1
- data/test/{apps → support/apps/grpc}/grpc_server.rb +0 -0
- data/test/{servers/rackapp_6511.rb → support/apps/http_endpoint/boot.rb} +0 -0
- data/test/{servers/rails_3205.rb → support/apps/rails/boot.rb} +8 -14
- data/test/{models → support/apps/rails/models}/block.rb +1 -1
- data/test/{models → support/apps/rails/models}/block6.rb +0 -0
- data/test/support/apps/resque/boot.rb +2 -0
- data/test/{jobs → support/apps/resque/jobs}/resque_error_job.rb +0 -0
- data/test/{jobs → support/apps/resque/jobs}/resque_fast_job.rb +0 -0
- data/test/support/apps/sidekiq/boot.rb +21 -0
- data/test/{jobs → support/apps/sidekiq/jobs}/sidekiq_job_1.rb +0 -0
- data/test/{jobs → support/apps/sidekiq/jobs}/sidekiq_job_2.rb +0 -0
- data/test/{servers → support/apps}/sidekiq/worker.rb +2 -2
- data/test/support/helpers.rb +94 -0
- data/test/test_helper.rb +24 -138
- metadata +89 -81
- data/gemfiles/libraries.gemfile +0 -73
- data/gemfiles/rails32.gemfile +0 -51
- data/gemfiles/rails42.gemfile +0 -50
- data/gemfiles/rails50.gemfile +0 -52
- data/gemfiles/rails52.gemfile +0 -52
- data/gemfiles/rails60.gemfile +0 -72
- data/lib/instana/instrumentation.rb +0 -25
- data/lib/instana/test.rb +0 -43
- data/test/apps/cuba.rb +0 -19
- data/test/apps/roda.rb +0 -13
- data/test/apps/sinatra.rb +0 -9
- data/test/servers/helpers/sidekiq_worker_initializer.rb +0 -27
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'net/http'
|
2
2
|
|
3
|
-
|
4
|
-
module
|
3
|
+
module Instana
|
4
|
+
module Instrumentation
|
5
5
|
module NetHTTPInstrumentation
|
6
6
|
def request(*args, &block)
|
7
7
|
if !Instana.tracer.tracing? || !started?
|
@@ -54,7 +54,4 @@ if defined?(::Net::HTTP) && ::Instana.config[:nethttp][:enabled]
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
end
|
57
|
-
|
58
|
-
::Instana.logger.debug "Instrumenting Net::HTTP"
|
59
|
-
Net::HTTP.prepend(::Instana::NetHTTPInstrumentation)
|
60
57
|
end
|
@@ -93,28 +93,3 @@ module Instana
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
end
|
96
|
-
|
97
|
-
if defined?(::Resque) && RUBY_VERSION >= '1.9.3'
|
98
|
-
|
99
|
-
if ::Instana.config[:'resque-client'][:enabled]
|
100
|
-
::Instana.logger.debug 'Instrumenting Resque Client'
|
101
|
-
::Resque.prepend(::Instana::Instrumentation::ResqueClient)
|
102
|
-
end
|
103
|
-
|
104
|
-
if ::Instana.config[:'resque-worker'][:enabled]
|
105
|
-
::Instana.logger.debug 'Instrumenting Resque Worker'
|
106
|
-
|
107
|
-
::Resque::Worker.prepend(::Instana::Instrumentation::ResqueWorker)
|
108
|
-
::Resque::Job.prepend(::Instana::Instrumentation::ResqueJob)
|
109
|
-
|
110
|
-
::Resque.before_fork do |job|
|
111
|
-
::Instana.agent.before_resque_fork
|
112
|
-
end
|
113
|
-
::Resque.after_fork do |job|
|
114
|
-
::Instana.agent.after_resque_fork
|
115
|
-
end
|
116
|
-
|
117
|
-
# Set this so we assure that any remaining collected traces are reported at_exit
|
118
|
-
ENV['RUN_AT_EXIT_HOOKS'] = "1"
|
119
|
-
end
|
120
|
-
end
|
@@ -17,8 +17,3 @@ module Instana
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
21
|
-
if defined?(::RestClient::Request) && ::Instana.config[:'rest-client'][:enabled]
|
22
|
-
::Instana.logger.debug "Instrumenting RestClient"
|
23
|
-
::RestClient::Request.send(:prepend, ::Instana::Instrumentation::RestClientRequest)
|
24
|
-
end
|
@@ -34,12 +34,3 @@ module Instana
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
37
|
-
|
38
|
-
if defined?(::Sidekiq) && ::Instana.config[:'sidekiq-client'][:enabled]
|
39
|
-
::Sidekiq.configure_client do |cfg|
|
40
|
-
cfg.client_middleware do |chain|
|
41
|
-
::Instana.logger.debug "Instrumenting Sidekiq client"
|
42
|
-
chain.add ::Instana::Instrumentation::SidekiqClient
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
@@ -43,12 +43,3 @@ module Instana
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
47
|
-
if defined?(::Sidekiq) && ::Instana.config[:'sidekiq-worker'][:enabled]
|
48
|
-
::Sidekiq.configure_server do |cfg|
|
49
|
-
cfg.server_middleware do |chain|
|
50
|
-
::Instana.logger.debug "Instrumenting Sidekiq worker"
|
51
|
-
chain.add ::Instana::Instrumentation::SidekiqWorker
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
data/lib/instana/setup.rb
CHANGED
@@ -7,10 +7,12 @@ require "instana/collector"
|
|
7
7
|
require "instana/secrets"
|
8
8
|
require "instana/tracer"
|
9
9
|
require "instana/tracing/processor"
|
10
|
-
|
10
|
+
|
11
|
+
require 'instana/activator'
|
11
12
|
|
12
13
|
::Instana.setup
|
13
14
|
::Instana.agent.setup
|
15
|
+
::Instana::Activator.start
|
14
16
|
|
15
17
|
# Register the metric collectors
|
16
18
|
unless RUBY_PLATFORM == 'java'.freeze
|
data/lib/instana/version.rb
CHANGED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ActivatorTest < Minitest::Test
|
4
|
+
def test_start
|
5
|
+
refute_nil Instana::Activator.trace_point
|
6
|
+
assert Instana::Activator.trace_point.enabled?
|
7
|
+
end
|
8
|
+
|
9
|
+
def test_klass_call
|
10
|
+
assert_equal [], Instana::Activator.call
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_instance_call
|
14
|
+
subject = Class.new(Instana::Activator) do
|
15
|
+
def can_instrument?
|
16
|
+
true
|
17
|
+
end
|
18
|
+
|
19
|
+
def instrument
|
20
|
+
true
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
assert_equal 1, Instana::Activator.call.length
|
25
|
+
assert subject.call
|
26
|
+
end
|
27
|
+
end
|
@@ -1,57 +1,55 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
require File.expand_path(File.dirname(__FILE__) + '/../apps/cuba')
|
4
|
-
require 'rack/test'
|
1
|
+
require 'test_helper'
|
2
|
+
require 'rack/test'
|
5
3
|
|
6
|
-
|
7
|
-
|
4
|
+
class CubaTest < Minitest::Test
|
5
|
+
include Rack::Test::Methods
|
6
|
+
APP = Rack::Builder.parse_file('test/support/apps/cuba/config.ru').first
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
def app
|
9
|
+
APP
|
10
|
+
end
|
12
11
|
|
13
|
-
|
14
|
-
|
12
|
+
def test_basic_get
|
13
|
+
clear_all!
|
15
14
|
|
16
|
-
|
17
|
-
|
15
|
+
r = get '/hello'
|
16
|
+
assert last_response.ok?
|
18
17
|
|
19
|
-
|
20
|
-
|
18
|
+
assert r.headers.key?("X-Instana-T")
|
19
|
+
assert r.headers.key?("X-Instana-S")
|
21
20
|
|
22
|
-
|
23
|
-
|
21
|
+
spans = ::Instana.processor.queued_spans
|
22
|
+
assert_equal 1, spans.count
|
24
23
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
first_span = spans.first
|
25
|
+
assert_equal :rack, first_span[:n]
|
26
|
+
assert first_span.key?(:data)
|
27
|
+
assert first_span[:data].key?(:http)
|
29
28
|
|
30
|
-
|
31
|
-
|
29
|
+
assert first_span[:data][:http].key?(:method)
|
30
|
+
assert_equal "GET", first_span[:data][:http][:method]
|
32
31
|
|
33
|
-
|
34
|
-
|
32
|
+
assert first_span[:data][:http].key?(:url)
|
33
|
+
assert_equal "/hello", first_span[:data][:http][:url]
|
35
34
|
|
36
|
-
|
37
|
-
|
35
|
+
assert first_span[:data][:http].key?(:status)
|
36
|
+
assert_equal 200, first_span[:data][:http][:status]
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
38
|
+
assert first_span[:data][:http].key?(:host)
|
39
|
+
assert_equal "example.org", first_span[:data][:http][:host]
|
40
|
+
end
|
42
41
|
|
43
|
-
|
44
|
-
|
42
|
+
def test_path_template
|
43
|
+
clear_all!
|
45
44
|
|
46
|
-
|
47
|
-
|
45
|
+
r = get '/greet/instana'
|
46
|
+
assert last_response.ok?
|
48
47
|
|
49
|
-
|
50
|
-
|
48
|
+
spans = ::Instana.processor.queued_spans
|
49
|
+
assert_equal 1, spans.count
|
51
50
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
51
|
+
first_span = spans.first
|
52
|
+
assert_equal :rack, first_span[:n]
|
53
|
+
assert_equal '/greet/{name}', first_span[:data][:http][:path_tpl]
|
56
54
|
end
|
57
55
|
end
|
@@ -16,7 +16,7 @@ class ActiveRecordTest < Minitest::Test
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_postgresql
|
19
|
-
skip unless
|
19
|
+
skip unless has_postgres_database?
|
20
20
|
|
21
21
|
clear_all!
|
22
22
|
|
@@ -41,7 +41,7 @@ class ActiveRecordTest < Minitest::Test
|
|
41
41
|
sql = "INSERT INTO \"blocks\" (\"name\", \"color\", \"created_at\", \"updated_at\") VALUES ($?, $?, $?, $?) RETURNING \"id\""
|
42
42
|
end
|
43
43
|
ar_span = find_first_span_by_qualifier(ar_spans) do |span|
|
44
|
-
span[:data][:activerecord][:sql] == sql
|
44
|
+
span[:data][:activerecord][:sql].squeeze == sql.squeeze
|
45
45
|
end
|
46
46
|
|
47
47
|
found = false
|
@@ -53,7 +53,7 @@ class ActiveRecordTest < Minitest::Test
|
|
53
53
|
sql = "SELECT \"blocks\".* FROM \"blocks\" WHERE \"blocks\".\"name\" = ? LIMIT ?"
|
54
54
|
end
|
55
55
|
ar_span = find_first_span_by_qualifier(ar_spans) do |span|
|
56
|
-
span[:data][:activerecord][:sql] == sql
|
56
|
+
span[:data][:activerecord][:sql].squeeze == sql.squeeze
|
57
57
|
end
|
58
58
|
|
59
59
|
found = false
|
@@ -63,12 +63,12 @@ class ActiveRecordTest < Minitest::Test
|
|
63
63
|
sql = "DELETE FROM \"blocks\" WHERE \"blocks\".\"id\" = $?"
|
64
64
|
end
|
65
65
|
ar_span = find_first_span_by_qualifier(ar_spans) do |span|
|
66
|
-
span[:data][:activerecord][:sql] == sql
|
66
|
+
span[:data][:activerecord][:sql].squeeze == sql.squeeze
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
70
|
def test_postgresql_without_sanitize
|
71
|
-
skip unless
|
71
|
+
skip unless has_postgres_database?
|
72
72
|
|
73
73
|
# Shut SQL sanitization off
|
74
74
|
::Instana.config[:sanitize_sql] = false
|
@@ -98,7 +98,7 @@ class ActiveRecordTest < Minitest::Test
|
|
98
98
|
sql = "INSERT INTO \"blocks\" (\"name\", \"color\", \"created_at\", \"updated_at\") VALUES ($1, $2, $3, $4) RETURNING \"id\""
|
99
99
|
end
|
100
100
|
ar_span = find_first_span_by_qualifier(ar_spans) do |span|
|
101
|
-
span[:data][:activerecord][:sql] == sql
|
101
|
+
span[:data][:activerecord][:sql].squeeze == sql.squeeze
|
102
102
|
end
|
103
103
|
assert ar_span[:data][:activerecord].key?(:binds)
|
104
104
|
assert ar_span[:data][:activerecord][:binds].is_a?(Array)
|
@@ -112,7 +112,7 @@ class ActiveRecordTest < Minitest::Test
|
|
112
112
|
sql = "SELECT \"blocks\".* FROM \"blocks\" WHERE \"blocks\".\"name\" = ? LIMIT ?"
|
113
113
|
end
|
114
114
|
ar_span = find_first_span_by_qualifier(ar_spans) do |span|
|
115
|
-
span[:data][:activerecord][:sql] == sql
|
115
|
+
span[:data][:activerecord][:sql].squeeze == sql.squeeze
|
116
116
|
end
|
117
117
|
assert ar_span[:data][:activerecord].key?(:binds)
|
118
118
|
assert ar_span[:data][:activerecord][:binds].is_a?(Array)
|
@@ -124,7 +124,7 @@ class ActiveRecordTest < Minitest::Test
|
|
124
124
|
sql = "DELETE FROM \"blocks\" WHERE \"blocks\".\"id\" = $1"
|
125
125
|
end
|
126
126
|
ar_span = find_first_span_by_qualifier(ar_spans) do |span|
|
127
|
-
span[:data][:activerecord][:sql] == sql
|
127
|
+
span[:data][:activerecord][:sql].squeeze == sql.squeeze
|
128
128
|
end
|
129
129
|
assert ar_span[:data][:activerecord].key?(:binds)
|
130
130
|
assert ar_span[:data][:activerecord][:binds].is_a?(Array)
|
@@ -132,7 +132,7 @@ class ActiveRecordTest < Minitest::Test
|
|
132
132
|
end
|
133
133
|
|
134
134
|
def test_postgresql_lock_table
|
135
|
-
skip unless
|
135
|
+
skip unless has_postgres_database?
|
136
136
|
|
137
137
|
clear_all!
|
138
138
|
|
@@ -163,7 +163,7 @@ class ActiveRecordTest < Minitest::Test
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def test_postgresql_raw_execute
|
166
|
-
skip unless
|
166
|
+
skip unless has_postgres_database?
|
167
167
|
|
168
168
|
clear_all!
|
169
169
|
|
@@ -183,7 +183,7 @@ class ActiveRecordTest < Minitest::Test
|
|
183
183
|
end
|
184
184
|
|
185
185
|
def test_postgresql_raw_execute_error
|
186
|
-
skip unless
|
186
|
+
skip unless has_postgres_database?
|
187
187
|
|
188
188
|
clear_all!
|
189
189
|
|
@@ -205,7 +205,7 @@ class ActiveRecordTest < Minitest::Test
|
|
205
205
|
end
|
206
206
|
|
207
207
|
def test_mysql2
|
208
|
-
skip unless
|
208
|
+
skip unless has_mysql2_database?
|
209
209
|
|
210
210
|
clear_all!
|
211
211
|
|
@@ -242,7 +242,7 @@ class ActiveRecordTest < Minitest::Test
|
|
242
242
|
end
|
243
243
|
|
244
244
|
def test_mysql
|
245
|
-
skip unless
|
245
|
+
skip unless has_mysql_database?
|
246
246
|
|
247
247
|
clear_all!
|
248
248
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
require 'support/apps/rails/boot'
|
4
|
+
|
5
|
+
require_relative 'rails/actioncontroller_test'
|
6
|
+
require_relative 'rails/activerecord_test'
|
7
|
+
|
8
|
+
case Rails::VERSION::MAJOR
|
9
|
+
when 3
|
10
|
+
require_relative 'rails/actionview3_test'
|
11
|
+
when 4
|
12
|
+
require_relative 'rails/actionview4_test'
|
13
|
+
else
|
14
|
+
require_relative 'rails/actionview5_test'
|
15
|
+
end
|
@@ -1,58 +1,56 @@
|
|
1
1
|
|
2
|
-
|
3
|
-
|
4
|
-
require File.expand_path(File.dirname(__FILE__) + '/../apps/roda')
|
5
|
-
require 'rack/test'
|
2
|
+
require 'test_helper'
|
3
|
+
require 'rack/test'
|
6
4
|
|
7
|
-
|
8
|
-
|
5
|
+
class RodaTest < Minitest::Test
|
6
|
+
include Rack::Test::Methods
|
7
|
+
APP = Rack::Builder.parse_file('test/support/apps/roda/config.ru').first
|
9
8
|
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
def app
|
10
|
+
APP
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_basic_get
|
14
|
+
clear_all!
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
+
r = get '/hello'
|
17
|
+
assert last_response.ok?
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
+
assert r.headers.key?("X-Instana-T")
|
20
|
+
assert r.headers.key?("X-Instana-S")
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
+
spans = ::Instana.processor.queued_spans
|
23
|
+
assert_equal 1, spans.count
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
+
first_span = spans.first
|
26
|
+
assert_equal :rack, first_span[:n]
|
27
|
+
assert first_span.key?(:data)
|
28
|
+
assert first_span[:data].key?(:http)
|
25
29
|
|
26
|
-
|
27
|
-
|
28
|
-
assert first_span.key?(:data)
|
29
|
-
assert first_span[:data].key?(:http)
|
30
|
+
assert first_span[:data][:http].key?(:method)
|
31
|
+
assert_equal "GET", first_span[:data][:http][:method]
|
30
32
|
|
31
|
-
|
32
|
-
|
33
|
+
assert first_span[:data][:http].key?(:url)
|
34
|
+
assert_equal "/hello", first_span[:data][:http][:url]
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
+
assert first_span[:data][:http].key?(:status)
|
37
|
+
assert_equal 200, first_span[:data][:http][:status]
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
+
assert first_span[:data][:http].key?(:host)
|
40
|
+
assert_equal "example.org", first_span[:data][:http][:host]
|
41
|
+
end
|
39
42
|
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
def test_path_template
|
45
|
-
clear_all!
|
43
|
+
def test_path_template
|
44
|
+
clear_all!
|
46
45
|
|
47
|
-
|
48
|
-
|
46
|
+
r = get '/greet/instana'
|
47
|
+
assert last_response.ok?
|
49
48
|
|
50
|
-
|
51
|
-
|
49
|
+
spans = ::Instana.processor.queued_spans
|
50
|
+
assert_equal 1, spans.count
|
52
51
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
end
|
52
|
+
first_span = spans.first
|
53
|
+
assert_equal :rack, first_span[:n]
|
54
|
+
assert_equal '/greet/{name}', first_span[:data][:http][:path_tpl]
|
57
55
|
end
|
58
56
|
end
|