instana 1.217.0 → 2.0.0
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 +4 -4
- data/.circleci/config.yml +101 -225
- data/.tekton/.currency/scripts/generate_report.py +194 -22
- data/.tekton/pipeline.yaml +65 -152
- data/.tekton/prepuller-restart-service-account.yaml +31 -0
- data/.tekton/ruby-tracer-prepuller-cronjob.yaml +20 -0
- data/.tekton/ruby-tracer-prepuller.yaml +27 -26
- data/.tekton/task.yaml +31 -27
- data/Gemfile +5 -0
- data/README.md +2 -1
- data/Rakefile +1 -1
- data/examples/otel.rb +98 -0
- data/examples/tracing.rb +1 -0
- data/gemfiles/rails_61.gemfile +1 -0
- data/gemfiles/rails_70.gemfile +1 -0
- data/instana.gemspec +5 -0
- data/lib/instana/base.rb +4 -2
- data/lib/instana/instrumentation/action_cable.rb +8 -4
- data/lib/instana/instrumentation/action_controller.rb +2 -4
- data/lib/instana/instrumentation/action_mailer.rb +1 -1
- data/lib/instana/instrumentation/action_view.rb +4 -4
- data/lib/instana/instrumentation/active_job.rb +26 -13
- data/lib/instana/instrumentation/active_record.rb +1 -1
- data/lib/instana/instrumentation/aws_sdk_dynamodb.rb +1 -1
- data/lib/instana/instrumentation/aws_sdk_lambda.rb +1 -1
- data/lib/instana/instrumentation/aws_sdk_s3.rb +1 -1
- data/lib/instana/instrumentation/aws_sdk_sns.rb +1 -1
- data/lib/instana/instrumentation/aws_sdk_sqs.rb +1 -1
- data/lib/instana/instrumentation/dalli.rb +1 -1
- data/lib/instana/instrumentation/excon.rb +2 -2
- data/lib/instana/instrumentation/graphql.rb +3 -3
- data/lib/instana/instrumentation/grpc.rb +14 -13
- data/lib/instana/instrumentation/mongo.rb +3 -3
- data/lib/instana/instrumentation/net-http.rb +5 -4
- data/lib/instana/instrumentation/rack.rb +36 -4
- data/lib/instana/instrumentation/redis.rb +1 -1
- data/lib/instana/instrumentation/resque.rb +10 -8
- data/lib/instana/instrumentation/rest-client.rb +4 -4
- data/lib/instana/instrumentation/sequel.rb +3 -3
- data/lib/instana/instrumentation/shoryuken.rb +4 -1
- data/lib/instana/instrumentation/sidekiq-client.rb +21 -19
- data/lib/instana/instrumentation/sidekiq-worker.rb +22 -21
- data/lib/instana/instrumented_logger.rb +1 -1
- data/lib/instana/samplers/result.rb +32 -0
- data/lib/instana/samplers/samplers.rb +76 -0
- data/lib/instana/serverless.rb +4 -2
- data/lib/instana/setup.rb +4 -5
- data/lib/instana/trace/export.rb +36 -0
- data/lib/instana/{tracing → trace}/processor.rb +19 -15
- data/lib/instana/trace/span.rb +532 -0
- data/lib/instana/{tracing → trace}/span_context.rb +17 -8
- data/lib/instana/trace/span_kind.rb +51 -0
- data/lib/instana/trace/span_limits.rb +63 -0
- data/lib/instana/{tracer.rb → trace/tracer.rb} +106 -54
- data/lib/instana/trace/tracer_provider.rb +198 -0
- data/lib/instana/trace.rb +74 -0
- data/lib/instana/util.rb +11 -0
- data/lib/instana/version.rb +1 -1
- data/test/frameworks/sinatra_test.rb +2 -1
- data/test/instrumentation/aws_test.rb +7 -7
- data/test/instrumentation/dalli_test.rb +8 -8
- data/test/instrumentation/excon_test.rb +3 -3
- data/test/instrumentation/graphql_test.rb +4 -4
- data/test/instrumentation/grpc_test.rb +8 -8
- data/test/instrumentation/mongo_test.rb +1 -1
- data/test/instrumentation/net_http_test.rb +6 -6
- data/test/instrumentation/rails_action_cable_test.rb +2 -2
- data/test/instrumentation/rails_action_mailer_test.rb +1 -1
- data/test/instrumentation/rails_active_job_test.rb +1 -1
- data/test/instrumentation/rails_active_record_database_missing_test.rb +2 -3
- data/test/instrumentation/rails_active_record_test.rb +8 -7
- data/test/instrumentation/redis_test.rb +7 -7
- data/test/instrumentation/resque_test.rb +5 -5
- data/test/instrumentation/rest_client_test.rb +1 -2
- data/test/instrumentation/sequel_test.rb +12 -6
- data/test/instrumentation/sidekiq-client_test.rb +2 -2
- data/test/instrumentation/sidekiq-worker_test.rb +2 -2
- data/test/{tracing → trace}/custom_test.rb +32 -25
- data/test/{tracing → trace}/id_management_test.rb +0 -2
- data/test/{tracing → trace}/instrumented_logger_test.rb +1 -1
- data/test/{tracing → trace}/processor_test.rb +6 -6
- data/test/{tracing → trace}/span_context_test.rb +3 -3
- data/test/{tracing → trace}/span_test.rb +7 -7
- data/test/{tracing → trace}/tracer_async_test.rb +43 -30
- data/test/trace/tracer_provider_test.rb +148 -0
- data/test/{tracing → trace}/tracer_test.rb +48 -37
- metadata +105 -32
- data/examples/opentracing.rb +0 -35
- data/lib/instana/open_tracing/carrier.rb +0 -7
- data/lib/instana/open_tracing/instana_tracer.rb +0 -99
- data/lib/instana/tracing/span.rb +0 -431
- data/lib/opentracing.rb +0 -32
- data/test/tracing/opentracing_test.rb +0 -382
@@ -25,7 +25,7 @@ class DalliTest < Minitest::Test
|
|
25
25
|
@dc.set(:instana, :boom)
|
26
26
|
|
27
27
|
result = nil
|
28
|
-
::Instana.tracer.
|
28
|
+
::Instana.tracer.in_span(:dalli_test) do
|
29
29
|
result = @dc.get(:instana)
|
30
30
|
end
|
31
31
|
|
@@ -87,7 +87,7 @@ class DalliTest < Minitest::Test
|
|
87
87
|
clear_all!
|
88
88
|
|
89
89
|
result = nil
|
90
|
-
::Instana.tracer.
|
90
|
+
::Instana.tracer.in_span(:dalli_test) do
|
91
91
|
result = @dc.set(:instana, :rocks)
|
92
92
|
end
|
93
93
|
|
@@ -121,7 +121,7 @@ class DalliTest < Minitest::Test
|
|
121
121
|
|
122
122
|
@dc.set(:instana, :rocks)
|
123
123
|
result = nil
|
124
|
-
::Instana.tracer.
|
124
|
+
::Instana.tracer.in_span(:dalli_test) do
|
125
125
|
result = @dc.replace(:instana, :rocks)
|
126
126
|
end
|
127
127
|
|
@@ -155,7 +155,7 @@ class DalliTest < Minitest::Test
|
|
155
155
|
|
156
156
|
@dc.set(:instana, :rocks)
|
157
157
|
result = nil
|
158
|
-
::Instana.tracer.
|
158
|
+
::Instana.tracer.in_span(:dalli_test) do
|
159
159
|
result = @dc.delete(:instana)
|
160
160
|
end
|
161
161
|
|
@@ -189,7 +189,7 @@ class DalliTest < Minitest::Test
|
|
189
189
|
|
190
190
|
result = nil
|
191
191
|
@dc.set(:counter, 0, nil, :raw => true)
|
192
|
-
::Instana.tracer.
|
192
|
+
::Instana.tracer.in_span(:dalli_test) do
|
193
193
|
result = @dc.incr(:counter, 1, nil, 0)
|
194
194
|
end
|
195
195
|
|
@@ -223,7 +223,7 @@ class DalliTest < Minitest::Test
|
|
223
223
|
|
224
224
|
result = nil
|
225
225
|
@dc.set(:counter, 0, nil, :raw => true)
|
226
|
-
::Instana.tracer.
|
226
|
+
::Instana.tracer.in_span(:dalli_test) do
|
227
227
|
result = @dc.decr(:counter, 1, nil, 0)
|
228
228
|
end
|
229
229
|
|
@@ -258,7 +258,7 @@ class DalliTest < Minitest::Test
|
|
258
258
|
@dc.set(:one, 1)
|
259
259
|
@dc.set(:three, 3)
|
260
260
|
|
261
|
-
::Instana.tracer.
|
261
|
+
::Instana.tracer.in_span(:dalli_test) do
|
262
262
|
@dc.get_multi(:one, :two, :three, :four)
|
263
263
|
end
|
264
264
|
|
@@ -295,7 +295,7 @@ class DalliTest < Minitest::Test
|
|
295
295
|
|
296
296
|
result = nil
|
297
297
|
begin
|
298
|
-
::Instana.tracer.
|
298
|
+
::Instana.tracer.in_span(:dalli_test) do
|
299
299
|
result = broken_dc.get(:instana)
|
300
300
|
end
|
301
301
|
rescue
|
@@ -26,7 +26,7 @@ class ExconTest < Minitest::Test
|
|
26
26
|
url = "http://127.0.0.1:6511"
|
27
27
|
|
28
28
|
connection = Excon.new(url)
|
29
|
-
Instana.tracer.
|
29
|
+
Instana.tracer.in_span(:'excon-test') do
|
30
30
|
connection.get(:path => '/?basic_get')
|
31
31
|
end
|
32
32
|
|
@@ -104,7 +104,7 @@ class ExconTest < Minitest::Test
|
|
104
104
|
|
105
105
|
begin
|
106
106
|
connection = Excon.new(url)
|
107
|
-
Instana.tracer.
|
107
|
+
Instana.tracer.in_span('excon-test') do
|
108
108
|
connection.get(:path => '/error')
|
109
109
|
end
|
110
110
|
rescue
|
@@ -145,7 +145,7 @@ class ExconTest < Minitest::Test
|
|
145
145
|
|
146
146
|
connection = Excon.new(url)
|
147
147
|
request = { :method => :get, :path => '/?pipelined_request' }
|
148
|
-
Instana.tracer.
|
148
|
+
Instana.tracer.in_span('excon-test') do
|
149
149
|
connection.requests([request, request, request])
|
150
150
|
end
|
151
151
|
|
@@ -122,7 +122,7 @@ class GraphqlTest < Minitest::Test
|
|
122
122
|
}
|
123
123
|
}
|
124
124
|
|
125
|
-
results = Instana.tracer.
|
125
|
+
results = Instana.tracer.in_span('graphql-test') { Schema.execute(query) }
|
126
126
|
query_span, root_span = *Instana.processor.queued_spans
|
127
127
|
|
128
128
|
assert_equal expected_results, results.to_h
|
@@ -200,7 +200,7 @@ class GraphqlTest < Minitest::Test
|
|
200
200
|
}
|
201
201
|
}
|
202
202
|
|
203
|
-
results = Instana.tracer.
|
203
|
+
results = Instana.tracer.in_span('graphql-test') { Schema.execute(query) }
|
204
204
|
query_span, root_span = *Instana.processor.queued_spans
|
205
205
|
|
206
206
|
assert_equal expected_results, results.to_h
|
@@ -244,7 +244,7 @@ class GraphqlTest < Minitest::Test
|
|
244
244
|
}
|
245
245
|
}
|
246
246
|
|
247
|
-
results = Instana.tracer.
|
247
|
+
results = Instana.tracer.in_span('graphql-test') { Schema.execute(query) }
|
248
248
|
query_span, root_span = *Instana.processor.queued_spans
|
249
249
|
|
250
250
|
assert_equal expected_results, results.to_h
|
@@ -278,7 +278,7 @@ class GraphqlTest < Minitest::Test
|
|
278
278
|
}
|
279
279
|
}
|
280
280
|
|
281
|
-
results = Instana.tracer.
|
281
|
+
results = Instana.tracer.in_span('graphql-test') { Schema.execute(query) }
|
282
282
|
query_span, root_span = *Instana.processor.queued_spans
|
283
283
|
|
284
284
|
assert_equal expected_results, results.to_h
|
@@ -45,7 +45,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
45
45
|
clear_all!
|
46
46
|
response = nil
|
47
47
|
|
48
|
-
Instana.tracer.
|
48
|
+
Instana.tracer.in_span(:rpctests) do
|
49
49
|
response = client_stub.ping(
|
50
50
|
PingPongService::PingRequest.new(message: 'Hello World')
|
51
51
|
)
|
@@ -123,7 +123,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
123
123
|
clear_all!
|
124
124
|
response = nil
|
125
125
|
|
126
|
-
Instana.tracer.
|
126
|
+
Instana.tracer.in_span(:rpctests) do
|
127
127
|
response = client_stub.ping_with_client_stream(
|
128
128
|
(0..5).map do |index|
|
129
129
|
PingPongService::PingRequest.new(message: index.to_s)
|
@@ -168,7 +168,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
168
168
|
clear_all!
|
169
169
|
responses = []
|
170
170
|
|
171
|
-
Instana.tracer.
|
171
|
+
Instana.tracer.in_span(:rpctests) do
|
172
172
|
responses = client_stub.ping_with_server_stream(
|
173
173
|
PingPongService::PingRequest.new(message: 'Hello World')
|
174
174
|
)
|
@@ -209,7 +209,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
209
209
|
clear_all!
|
210
210
|
responses = []
|
211
211
|
|
212
|
-
Instana.tracer.
|
212
|
+
Instana.tracer.in_span(:rpctests) do
|
213
213
|
responses = client_stub.ping_with_bidi_stream(
|
214
214
|
(0..5).map do |index|
|
215
215
|
PingPongService::PingRequest.new(message: (index * 2).to_s)
|
@@ -252,7 +252,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
252
252
|
|
253
253
|
def test_request_response_failure
|
254
254
|
clear_all!
|
255
|
-
Instana.tracer.
|
255
|
+
Instana.tracer.in_span(:rpctests) do
|
256
256
|
begin
|
257
257
|
client_stub.fail_to_ping( PingPongService::PingRequest.new(message: 'Hello World'))
|
258
258
|
rescue
|
@@ -292,7 +292,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
292
292
|
|
293
293
|
def test_client_streamer_failure
|
294
294
|
clear_all!
|
295
|
-
Instana.tracer.
|
295
|
+
Instana.tracer.in_span(:rpctests) do
|
296
296
|
begin
|
297
297
|
client_stub.fail_to_ping_with_client_stream(
|
298
298
|
(0..5).map do |index|
|
@@ -337,7 +337,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
337
337
|
|
338
338
|
def test_server_streamer_failure
|
339
339
|
clear_all!
|
340
|
-
Instana.tracer.
|
340
|
+
Instana.tracer.in_span(:rpctests) do
|
341
341
|
begin
|
342
342
|
client_stub.fail_to_ping_with_server_stream(
|
343
343
|
PingPongService::PingRequest.new(message: 'Hello World')
|
@@ -379,7 +379,7 @@ class GrpcTest < Minitest::Test # rubocop:disable Metrics/ClassLength
|
|
379
379
|
|
380
380
|
def test_bidi_streamer_failure
|
381
381
|
clear_all!
|
382
|
-
Instana.tracer.
|
382
|
+
Instana.tracer.in_span(:rpctests) do
|
383
383
|
client_stub.fail_to_ping_with_bidi_stream(
|
384
384
|
(0..5).map do |index|
|
385
385
|
PingPongService::PingRequest.new(message: (index * 2).to_s)
|
@@ -13,7 +13,7 @@ class MongoTest < Minitest::Test
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_mongo
|
16
|
-
Instana.tracer.
|
16
|
+
Instana.tracer.in_span(:'mongo-test') do
|
17
17
|
client = Mongo::Client.new('mongodb://127.0.0.1:27017/instana')
|
18
18
|
client[:people].delete_many({ name: /$S*/ })
|
19
19
|
client[:people].insert_many([{ _id: 1, name: "Stan" }])
|
@@ -19,7 +19,7 @@ class NetHTTPTest < Minitest::Test
|
|
19
19
|
clear_all!
|
20
20
|
WebMock.allow_net_connect!
|
21
21
|
|
22
|
-
Instana.tracer.
|
22
|
+
Instana.tracer.in_span(:"net-http-test") do
|
23
23
|
Net::HTTP.get(URI('http://127.0.0.1:6511/?query_value=true'))
|
24
24
|
end
|
25
25
|
|
@@ -37,7 +37,7 @@ class NetHTTPTest < Minitest::Test
|
|
37
37
|
clear_all!
|
38
38
|
WebMock.allow_net_connect!
|
39
39
|
|
40
|
-
Instana.tracer.
|
40
|
+
Instana.tracer.in_span(:"net-http-test") do
|
41
41
|
Net::HTTP.get(URI('http://127.0.0.1:6511/'))
|
42
42
|
end
|
43
43
|
|
@@ -76,7 +76,7 @@ class NetHTTPTest < Minitest::Test
|
|
76
76
|
req = Net::HTTP::Get.new(uri)
|
77
77
|
|
78
78
|
response = nil
|
79
|
-
Instana.tracer.
|
79
|
+
Instana.tracer.in_span('net-http-test') do
|
80
80
|
Net::HTTP.start(req.uri.hostname, req.uri.port, :open_timeout => 1, :read_timeout => 1) do |http|
|
81
81
|
response = http.request(req)
|
82
82
|
end
|
@@ -118,7 +118,7 @@ class NetHTTPTest < Minitest::Test
|
|
118
118
|
WebMock.allow_net_connect!
|
119
119
|
|
120
120
|
response = nil
|
121
|
-
Instana.tracer.
|
121
|
+
Instana.tracer.in_span('net-http-test') do
|
122
122
|
http = Net::HTTP.new("127.0.0.1", 6511)
|
123
123
|
response = http.request(Net::HTTP::Post.new("/"))
|
124
124
|
end
|
@@ -159,7 +159,7 @@ class NetHTTPTest < Minitest::Test
|
|
159
159
|
WebMock.allow_net_connect!
|
160
160
|
|
161
161
|
begin
|
162
|
-
Instana.tracer.
|
162
|
+
Instana.tracer.in_span('net-http-error-test') do
|
163
163
|
http = Net::HTTP.new("asdfasdf.asdfsadf", 80)
|
164
164
|
http.request(Net::HTTP::Get.new("/blah"))
|
165
165
|
end
|
@@ -189,7 +189,7 @@ class NetHTTPTest < Minitest::Test
|
|
189
189
|
WebMock.allow_net_connect!
|
190
190
|
|
191
191
|
response = nil
|
192
|
-
Instana.tracer.
|
192
|
+
Instana.tracer.in_span('net-http-error-test') do
|
193
193
|
http = Net::HTTP.new("127.0.0.1", 6511)
|
194
194
|
response = http.request(Net::HTTP::Get.new("/error"))
|
195
195
|
end
|
@@ -42,7 +42,7 @@ class RailsActionCableTest < Minitest::Test
|
|
42
42
|
connection = mock_connection
|
43
43
|
connection.instance_variable_set(
|
44
44
|
:@instana_trace_context,
|
45
|
-
Instana::SpanContext.new('ABC', 'ABC')
|
45
|
+
Instana::SpanContext.new(trace_id: 'ABC', span_id: 'ABC')
|
46
46
|
)
|
47
47
|
channel_klass = Class.new(ActionCable::Channel::Base)
|
48
48
|
|
@@ -95,7 +95,7 @@ class RailsActionCableTest < Minitest::Test
|
|
95
95
|
connection = mock_connection
|
96
96
|
connection.instance_variable_set(
|
97
97
|
:@instana_trace_context,
|
98
|
-
Instana::SpanContext.new('ABC', 'ABC')
|
98
|
+
Instana::SpanContext.new(trace_id: 'ABC', span_id: 'ABC')
|
99
99
|
)
|
100
100
|
channel_klass = Class.new(ActionCable::Channel::Base) do
|
101
101
|
def sample
|
@@ -37,7 +37,7 @@ class RailsActiveJobTest < Minitest::Test
|
|
37
37
|
# ActiveJob::QueueAdapters::TestAdapter.new doesn't work for this test on any version less than 6
|
38
38
|
skip unless Rails::VERSION::MAJOR >= 6
|
39
39
|
|
40
|
-
Instana.tracer.
|
40
|
+
Instana.tracer.in_span(:peform_test) do
|
41
41
|
SampleJob.perform_later("test_enqueue_perform")
|
42
42
|
end
|
43
43
|
|
@@ -8,7 +8,7 @@ require 'fileutils'
|
|
8
8
|
class RailsActiveRecordDatabaseMissingTest < Minitest::Test
|
9
9
|
def setup
|
10
10
|
skip unless ENV['DATABASE_URL']
|
11
|
-
|
11
|
+
clear_all!
|
12
12
|
@old_url = ENV['DATABASE_URL']
|
13
13
|
SQLite3::Database.new('/tmp/test.db')
|
14
14
|
ENV['DATABASE_URL'] = 'sqlite3:///tmp/test.db'
|
@@ -29,13 +29,12 @@ class RailsActiveRecordDatabaseMissingTest < Minitest::Test
|
|
29
29
|
|
30
30
|
def test_error_on_missing_database
|
31
31
|
assert_raises(ActiveRecord::StatementInvalid) do
|
32
|
-
Instana
|
32
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
33
33
|
b = Block.new
|
34
34
|
FileUtils.rm('/tmp/test.db')
|
35
35
|
b.save!
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
39
38
|
spans = ::Instana.processor.queued_spans
|
40
39
|
span = find_first_span_by_name(spans, :activerecord)
|
41
40
|
|
@@ -6,6 +6,7 @@ require 'support/apps/active_record/active_record'
|
|
6
6
|
|
7
7
|
class RailsActiveRecordTest < Minitest::Test
|
8
8
|
def setup
|
9
|
+
clear_all!
|
9
10
|
skip unless ENV['DATABASE_URL']
|
10
11
|
@connection = ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
|
11
12
|
ActiveRecord::Migration.suppress_messages do
|
@@ -28,7 +29,8 @@ class RailsActiveRecordTest < Minitest::Test
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def test_create
|
31
|
-
|
32
|
+
# clear_all!
|
33
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
32
34
|
Block.create(name: 'core', color: 'blue')
|
33
35
|
end
|
34
36
|
|
@@ -42,10 +44,9 @@ class RailsActiveRecordTest < Minitest::Test
|
|
42
44
|
|
43
45
|
def test_read
|
44
46
|
Block.create(name: 'core', color: 'blue')
|
45
|
-
Instana
|
47
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
46
48
|
Block.find_by(name: 'core')
|
47
49
|
end
|
48
|
-
|
49
50
|
spans = ::Instana.processor.queued_spans
|
50
51
|
assert_equal 2, spans.length
|
51
52
|
span = find_first_span_by_name(spans, :activerecord)
|
@@ -58,7 +59,7 @@ class RailsActiveRecordTest < Minitest::Test
|
|
58
59
|
Block.create(name: 'core', color: 'blue')
|
59
60
|
b = Block.find_by(name: 'core')
|
60
61
|
|
61
|
-
Instana
|
62
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
62
63
|
b.color = 'red'
|
63
64
|
b.save
|
64
65
|
end
|
@@ -74,7 +75,7 @@ class RailsActiveRecordTest < Minitest::Test
|
|
74
75
|
def test_delete
|
75
76
|
b = Block.create(name: 'core', color: 'blue')
|
76
77
|
|
77
|
-
Instana
|
78
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
78
79
|
b.delete
|
79
80
|
end
|
80
81
|
|
@@ -87,7 +88,7 @@ class RailsActiveRecordTest < Minitest::Test
|
|
87
88
|
end
|
88
89
|
|
89
90
|
def test_raw
|
90
|
-
Instana
|
91
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
91
92
|
ActiveRecord::Base.connection.execute('SELECT 1')
|
92
93
|
end
|
93
94
|
|
@@ -101,7 +102,7 @@ class RailsActiveRecordTest < Minitest::Test
|
|
101
102
|
|
102
103
|
def test_raw_error
|
103
104
|
assert_raises ActiveRecord::StatementInvalid do
|
104
|
-
Instana
|
105
|
+
Instana.tracer.in_span(:ar_test, attributes: {}) do
|
105
106
|
ActiveRecord::Base.connection.execute('INVALID')
|
106
107
|
end
|
107
108
|
end
|
@@ -16,7 +16,7 @@ class RedisTest < Minitest::Test
|
|
16
16
|
def test_normal_call
|
17
17
|
clear_all!
|
18
18
|
|
19
|
-
Instana.tracer.
|
19
|
+
Instana.tracer.in_span(:redis_test) do
|
20
20
|
@redis_client.set('hello', 'world')
|
21
21
|
end
|
22
22
|
|
@@ -49,7 +49,7 @@ class RedisTest < Minitest::Test
|
|
49
49
|
def test_georadius
|
50
50
|
clear_all!
|
51
51
|
|
52
|
-
Instana.tracer.
|
52
|
+
Instana.tracer.in_span(:redis_test) do
|
53
53
|
@redis_client.georadius('Sicily', '15', '37', '200', 'km', 'WITHCOORD', 'WITHDIST')
|
54
54
|
end
|
55
55
|
|
@@ -59,7 +59,7 @@ class RedisTest < Minitest::Test
|
|
59
59
|
def test_normal_call_with_error
|
60
60
|
clear_all!
|
61
61
|
|
62
|
-
Instana.tracer.
|
62
|
+
Instana.tracer.in_span(:redis_test) do
|
63
63
|
begin
|
64
64
|
@redis_client.zadd('hello', 'invalid', 'value')
|
65
65
|
rescue; end
|
@@ -71,7 +71,7 @@ class RedisTest < Minitest::Test
|
|
71
71
|
def test_pipeline_call
|
72
72
|
clear_all!
|
73
73
|
|
74
|
-
Instana.tracer.
|
74
|
+
Instana.tracer.in_span(:redis_test) do
|
75
75
|
@redis_client.pipelined do |pipeline|
|
76
76
|
pipeline.set('hello', 'world')
|
77
77
|
pipeline.set('other', 'world')
|
@@ -84,7 +84,7 @@ class RedisTest < Minitest::Test
|
|
84
84
|
def test_pipeline_call_with_error
|
85
85
|
clear_all!
|
86
86
|
|
87
|
-
Instana.tracer.
|
87
|
+
Instana.tracer.in_span(:redis_test) do
|
88
88
|
begin
|
89
89
|
@redis_client.pipelined do |pipeline|
|
90
90
|
pipeline.set('other', 'world')
|
@@ -99,7 +99,7 @@ class RedisTest < Minitest::Test
|
|
99
99
|
def test_multi_call
|
100
100
|
clear_all!
|
101
101
|
|
102
|
-
Instana.tracer.
|
102
|
+
Instana.tracer.in_span(:redis_test) do
|
103
103
|
@redis_client.multi do |multi|
|
104
104
|
multi.set('hello', 'world')
|
105
105
|
multi.set('other', 'world')
|
@@ -112,7 +112,7 @@ class RedisTest < Minitest::Test
|
|
112
112
|
def test_multi_call_with_error
|
113
113
|
clear_all!
|
114
114
|
|
115
|
-
Instana.tracer.
|
115
|
+
Instana.tracer.in_span(:redis_test) do
|
116
116
|
begin
|
117
117
|
@redis_client.multi do |multi|
|
118
118
|
multi.set('other', 'world')
|
@@ -19,7 +19,7 @@ class ResqueClientTest < Minitest::Test
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_enqueue
|
22
|
-
::Instana.tracer.
|
22
|
+
::Instana.tracer.in_span(:'resque-client_test') do
|
23
23
|
::Resque.enqueue(FastJob)
|
24
24
|
end
|
25
25
|
|
@@ -62,7 +62,7 @@ class ResqueClientTest < Minitest::Test
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def test_enqueue_to
|
65
|
-
::Instana.tracer.
|
65
|
+
::Instana.tracer.in_span(:'resque-client_test') do
|
66
66
|
::Resque.enqueue_to(:critical, FastJob)
|
67
67
|
end
|
68
68
|
|
@@ -84,7 +84,7 @@ class ResqueClientTest < Minitest::Test
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def test_dequeue
|
87
|
-
::Instana.tracer.
|
87
|
+
::Instana.tracer.in_span(:'resque-client_test') do
|
88
88
|
::Resque.dequeue(FastJob, { :generate => :farfalla })
|
89
89
|
end
|
90
90
|
|
@@ -102,7 +102,7 @@ class ResqueClientTest < Minitest::Test
|
|
102
102
|
end
|
103
103
|
|
104
104
|
def test_worker_job
|
105
|
-
::Instana.tracer.
|
105
|
+
::Instana.tracer.in_span(:'resque-client_test') do
|
106
106
|
::Resque.enqueue_to(:critical, FastJob)
|
107
107
|
end
|
108
108
|
|
@@ -135,7 +135,7 @@ class ResqueClientTest < Minitest::Test
|
|
135
135
|
|
136
136
|
def test_worker_job_no_propagate
|
137
137
|
::Instana.config[:'resque-client'][:propagate] = false
|
138
|
-
::Instana.tracer.
|
138
|
+
::Instana.tracer.in_span(:'resque-client_test') do
|
139
139
|
::Resque.enqueue_to(:critical, FastJob)
|
140
140
|
end
|
141
141
|
|
@@ -26,7 +26,7 @@ class RestClientTest < Minitest::Test
|
|
26
26
|
|
27
27
|
url = "http://127.0.0.1:6511/"
|
28
28
|
|
29
|
-
Instana.tracer.
|
29
|
+
Instana.tracer.in_span('restclient-test') do
|
30
30
|
RestClient.get url
|
31
31
|
end
|
32
32
|
|
@@ -81,7 +81,6 @@ class RestClientTest < Minitest::Test
|
|
81
81
|
rack_span = find_first_span_by_name(spans, :rack)
|
82
82
|
rest_span = find_first_span_by_name(spans, :'rest-client')
|
83
83
|
net_span = find_first_span_by_name(spans, :'net-http')
|
84
|
-
|
85
84
|
# Span name validation
|
86
85
|
assert_equal :rack, rack_span[:n]
|
87
86
|
assert_equal :sdk, rest_span[:n]
|
@@ -28,7 +28,8 @@ class SequelTest < Minitest::Test
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_create
|
31
|
-
|
31
|
+
clear_all!
|
32
|
+
Instana.tracer.in_span(:sequel_test, attributes: {}) do
|
32
33
|
@model.insert(name: 'core', color: 'blue')
|
33
34
|
end
|
34
35
|
spans = ::Instana.processor.queued_spans
|
@@ -39,8 +40,9 @@ class SequelTest < Minitest::Test
|
|
39
40
|
end
|
40
41
|
|
41
42
|
def test_read
|
43
|
+
clear_all!
|
42
44
|
@model.insert(name: 'core', color: 'blue')
|
43
|
-
Instana
|
45
|
+
Instana.tracer.in_span(:sequel_test, attributes: {}) do
|
44
46
|
@model.where(name: 'core').first
|
45
47
|
end
|
46
48
|
spans = ::Instana.processor.queued_spans
|
@@ -52,8 +54,9 @@ class SequelTest < Minitest::Test
|
|
52
54
|
end
|
53
55
|
|
54
56
|
def test_update
|
57
|
+
clear_all!
|
55
58
|
@model.insert(name: 'core', color: 'blue')
|
56
|
-
Instana
|
59
|
+
Instana.tracer.in_span(:sequel_test, attributes: {}) do
|
57
60
|
@model.where(name: 'core').update(color: 'red')
|
58
61
|
end
|
59
62
|
spans = ::Instana.processor.queued_spans
|
@@ -66,8 +69,9 @@ class SequelTest < Minitest::Test
|
|
66
69
|
end
|
67
70
|
|
68
71
|
def test_delete
|
72
|
+
clear_all!
|
69
73
|
@model.insert(name: 'core', color: 'blue')
|
70
|
-
Instana
|
74
|
+
Instana.tracer.in_span(:sequel_test, attributes: {}) do
|
71
75
|
@model.where(name: 'core').delete
|
72
76
|
end
|
73
77
|
spans = ::Instana.processor.queued_spans
|
@@ -80,7 +84,8 @@ class SequelTest < Minitest::Test
|
|
80
84
|
end
|
81
85
|
|
82
86
|
def test_raw
|
83
|
-
|
87
|
+
clear_all!
|
88
|
+
Instana.tracer.in_span(:sequel_test, attributes: {}) do
|
84
89
|
@db.run('SELECT 1')
|
85
90
|
end
|
86
91
|
spans = ::Instana.processor.queued_spans
|
@@ -92,8 +97,9 @@ class SequelTest < Minitest::Test
|
|
92
97
|
end
|
93
98
|
|
94
99
|
def test_raw_error
|
100
|
+
clear_all!
|
95
101
|
assert_raises Sequel::DatabaseError do
|
96
|
-
Instana
|
102
|
+
Instana.tracer.in_span(:sequel_test, attributes: {}) do
|
97
103
|
@db.run('INVALID')
|
98
104
|
end
|
99
105
|
end
|
@@ -21,7 +21,7 @@ class SidekiqClientTest < Minitest::Test
|
|
21
21
|
|
22
22
|
def test_enqueue
|
23
23
|
clear_all!
|
24
|
-
Instana.tracer.
|
24
|
+
Instana.tracer.in_span(:sidekiqtests) do
|
25
25
|
disable_redis_instrumentation
|
26
26
|
::Sidekiq::Client.push(
|
27
27
|
'queue' => 'some_random_queue',
|
@@ -72,7 +72,7 @@ class SidekiqClientTest < Minitest::Test
|
|
72
72
|
def test_enqueue_failure
|
73
73
|
clear_all!
|
74
74
|
|
75
|
-
Instana.tracer.
|
75
|
+
Instana.tracer.in_span(:sidekiqtests) do
|
76
76
|
disable_redis_instrumentation
|
77
77
|
add_sidekiq_exception_middleware
|
78
78
|
begin
|
@@ -77,7 +77,7 @@ class SidekiqServerTest < Minitest::Test
|
|
77
77
|
$sidekiq_mode = :server
|
78
78
|
inject_instrumentation
|
79
79
|
|
80
|
-
Instana.tracer.
|
80
|
+
Instana.tracer.in_span(:sidekiqtests) do
|
81
81
|
disable_redis_instrumentation
|
82
82
|
::Sidekiq::Client.push(
|
83
83
|
'queue' => 'important',
|
@@ -110,7 +110,7 @@ class SidekiqServerTest < Minitest::Test
|
|
110
110
|
$sidekiq_mode = :server
|
111
111
|
inject_instrumentation
|
112
112
|
|
113
|
-
Instana.tracer.
|
113
|
+
Instana.tracer.in_span(:sidekiqtests) do
|
114
114
|
disable_redis_instrumentation
|
115
115
|
::Sidekiq::Client.push(
|
116
116
|
'queue' => 'important',
|