instana 1.199.6 → 1.202.0
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 +41 -6
- data/.rubocop.yml +11 -2
- data/lib/instana.rb +2 -4
- data/lib/instana/activator.rb +13 -1
- data/lib/instana/activators/active_job.rb +21 -0
- data/lib/instana/activators/aws_sdk_dynamodb.rb +1 -1
- data/lib/instana/activators/aws_sdk_s3.rb +1 -1
- data/lib/instana/activators/aws_sdk_sns.rb +1 -1
- data/lib/instana/activators/aws_sdk_sqs.rb +1 -1
- data/lib/instana/activators/redis.rb +1 -1
- data/lib/instana/activators/resque_worker.rb +4 -2
- data/lib/instana/activators/sidekiq_client.rb +1 -1
- data/lib/instana/activators/sidekiq_worker.rb +1 -1
- data/lib/instana/backend/host_agent.rb +7 -6
- data/lib/instana/backend/host_agent_reporting_observer.rb +2 -4
- data/lib/instana/backend/serverless_agent.rb +1 -1
- data/lib/instana/config.rb +6 -1
- data/lib/instana/frameworks/rails.rb +5 -5
- data/lib/instana/frameworks/roda.rb +1 -1
- data/lib/instana/instrumentation/active_job.rb +52 -0
- 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/instrumented_request.rb +4 -4
- data/lib/instana/instrumentation/rack.rb +1 -1
- data/lib/instana/instrumentation/shoryuken.rb +1 -1
- data/lib/instana/instrumented_logger.rb +26 -0
- data/lib/instana/setup.rb +5 -1
- data/lib/instana/snapshot/docker_container.rb +1 -1
- data/lib/instana/snapshot/fargate_task.rb +1 -1
- data/lib/instana/snapshot/google_cloud_run_instance.rb +1 -1
- data/lib/instana/tracing/processor.rb +8 -5
- data/lib/instana/tracing/span.rb +2 -2
- data/lib/instana/tracing/span_context.rb +1 -1
- data/lib/instana/version.rb +1 -1
- data/test/instrumentation/rails_active_job_test.rb +65 -0
- data/test/test_helper.rb +10 -1
- data/test/tracing/instrumented_logger_test.rb +39 -0
- metadata +9 -10
- data/benchmarks/10k-rack-traces.rb +0 -95
- data/benchmarks/Gemfile +0 -11
- data/benchmarks/Gemfile.lock +0 -38
- data/benchmarks/id_generation.rb +0 -16
- data/benchmarks/opentracing.rb +0 -30
- data/benchmarks/rack_vanilla_vs_traced.rb +0 -88
- data/benchmarks/stackprof_rack_tracing.rb +0 -80
- data/benchmarks/time_processing.rb +0 -16
data/benchmarks/Gemfile
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# (c) Copyright IBM Corp. 2021
|
4
|
-
# (c) Copyright Instana Inc. 2017
|
5
|
-
|
6
|
-
source "https://rubygems.org"
|
7
|
-
|
8
|
-
git_source(:github) {|repo_name| "https://github.com/instana/#{repo_name}" }
|
9
|
-
|
10
|
-
gem "instana", :path => "~/Projects/instana/ruby-sensor"
|
11
|
-
|
data/benchmarks/Gemfile.lock
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: ..
|
3
|
-
specs:
|
4
|
-
instana (1.9.6)
|
5
|
-
ffi (>= 1.0.11)
|
6
|
-
get_process_mem (>= 0.2.1)
|
7
|
-
oj (>= 3.0.11)
|
8
|
-
sys-proctable (>= 0.9.2)
|
9
|
-
timers (>= 4.0.0)
|
10
|
-
|
11
|
-
GEM
|
12
|
-
remote: https://rubygems.org/
|
13
|
-
specs:
|
14
|
-
ffi (1.11.1)
|
15
|
-
get_process_mem (0.2.4)
|
16
|
-
ffi (~> 1.0)
|
17
|
-
nio4r (2.4.0)
|
18
|
-
oj (3.8.1)
|
19
|
-
puma (4.1.0)
|
20
|
-
nio4r (~> 2.0)
|
21
|
-
rack (2.0.7)
|
22
|
-
ruby-prof (1.0.0)
|
23
|
-
sys-proctable (1.2.2)
|
24
|
-
ffi
|
25
|
-
timers (4.3.0)
|
26
|
-
|
27
|
-
PLATFORMS
|
28
|
-
ruby
|
29
|
-
x86_64-darwin-18
|
30
|
-
|
31
|
-
DEPENDENCIES
|
32
|
-
instana!
|
33
|
-
puma
|
34
|
-
rack
|
35
|
-
ruby-prof
|
36
|
-
|
37
|
-
BUNDLED WITH
|
38
|
-
2.0.2
|
data/benchmarks/id_generation.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# (c) Copyright IBM Corp. 2021
|
4
|
-
# (c) Copyright Instana Inc. 2017
|
5
|
-
|
6
|
-
require "bundler"
|
7
|
-
Bundler.require(:default)
|
8
|
-
|
9
|
-
require "benchmark"
|
10
|
-
|
11
|
-
ID_RANGE = -2**63..2**63-1
|
12
|
-
|
13
|
-
Benchmark.bm do |x|
|
14
|
-
x.report("generate_id raw ") { 1_000_000.times { rand(-2**63..2**63-1) } }
|
15
|
-
x.report("with fixed range ") { 1_000_000.times { rand(ID_RANGE) } }
|
16
|
-
end
|
data/benchmarks/opentracing.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# (c) Copyright IBM Corp. 2021
|
4
|
-
# (c) Copyright Instana Inc. 2017
|
5
|
-
|
6
|
-
require "bundler"
|
7
|
-
Bundler.require(:default)
|
8
|
-
|
9
|
-
require "benchmark"
|
10
|
-
|
11
|
-
Benchmark.bm do |x|
|
12
|
-
x.report("start_span, finish: ") {
|
13
|
-
50_000.times {
|
14
|
-
::Instana.tracer.start_span(:blah).finish
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
x.report("start_span, set_tag(5x), finish:") {
|
19
|
-
50_000.times {
|
20
|
-
span = ::Instana.tracer.start_span(:blah)
|
21
|
-
span.set_tag(:blah, 1)
|
22
|
-
span.set_tag(:dog, 1)
|
23
|
-
span.set_tag(:moon, "ok")
|
24
|
-
span.set_tag(:ape, 1)
|
25
|
-
span.set_tag(:blah, 1)
|
26
|
-
span.finish
|
27
|
-
}
|
28
|
-
}
|
29
|
-
|
30
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
# (c) Copyright IBM Corp. 2021
|
2
|
-
# (c) Copyright Instana Inc. 2017
|
3
|
-
|
4
|
-
require "bundler"
|
5
|
-
|
6
|
-
require 'rack'
|
7
|
-
require 'rack/builder'
|
8
|
-
require 'rack/handler/puma'
|
9
|
-
require 'net/http'
|
10
|
-
require "benchmark"
|
11
|
-
require "cgi"
|
12
|
-
Bundler.require(:default)
|
13
|
-
require "instana/rack"
|
14
|
-
|
15
|
-
Thread.new do
|
16
|
-
app = Rack::Builder.new {
|
17
|
-
map "/" do
|
18
|
-
run Proc.new {
|
19
|
-
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
20
|
-
}
|
21
|
-
end
|
22
|
-
map "/error" do
|
23
|
-
run Proc.new {
|
24
|
-
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
25
|
-
}
|
26
|
-
end
|
27
|
-
}
|
28
|
-
|
29
|
-
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7011})
|
30
|
-
end
|
31
|
-
|
32
|
-
Thread.new do
|
33
|
-
app = Rack::Builder.new {
|
34
|
-
use ::Instana::Rack
|
35
|
-
map "/" do
|
36
|
-
run Proc.new {
|
37
|
-
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
38
|
-
}
|
39
|
-
end
|
40
|
-
map "/error" do
|
41
|
-
run Proc.new {
|
42
|
-
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
43
|
-
}
|
44
|
-
end
|
45
|
-
}
|
46
|
-
|
47
|
-
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7012})
|
48
|
-
end
|
49
|
-
|
50
|
-
puts ""
|
51
|
-
puts "Vanilla Rack server started in background thread on localhost:7011"
|
52
|
-
puts "Instrumented Rack server started in background thread on localhost:7012"
|
53
|
-
puts ""
|
54
|
-
puts "Waiting on successful announce to host agent..."
|
55
|
-
puts ""
|
56
|
-
|
57
|
-
while !::Instana.agent.ready? do
|
58
|
-
sleep 2
|
59
|
-
end
|
60
|
-
|
61
|
-
puts "Starting benchmarks"
|
62
|
-
Benchmark.bm do |x|
|
63
|
-
|
64
|
-
uri = URI.parse("http://127.0.0.1:7011/")
|
65
|
-
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
66
|
-
x.report("vanilla") {
|
67
|
-
1_000.times {
|
68
|
-
req = Net::HTTP::Get.new(uri.request_uri)
|
69
|
-
hc.request(req)
|
70
|
-
}
|
71
|
-
}
|
72
|
-
end
|
73
|
-
|
74
|
-
uri = URI.parse("http://127.0.0.1:7012/")
|
75
|
-
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
76
|
-
x.report("traced ") {
|
77
|
-
1_000.times {
|
78
|
-
::Instana.tracer.start_or_continue_trace(:rack_call) do
|
79
|
-
req = Net::HTTP::Get.new(uri.request_uri)
|
80
|
-
hc.request(req)
|
81
|
-
end
|
82
|
-
}
|
83
|
-
}
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
|
88
|
-
sleep 10
|
@@ -1,80 +0,0 @@
|
|
1
|
-
# (c) Copyright IBM Corp. 2021
|
2
|
-
# (c) Copyright Instana Inc. 2017
|
3
|
-
|
4
|
-
require "bundler"
|
5
|
-
require "stackprof"
|
6
|
-
require 'rack'
|
7
|
-
require 'rack/builder'
|
8
|
-
require 'rack/handler/puma'
|
9
|
-
require 'net/http'
|
10
|
-
require "benchmark"
|
11
|
-
require "cgi"
|
12
|
-
Bundler.require(:default)
|
13
|
-
require "instana/rack"
|
14
|
-
|
15
|
-
Thread.new do
|
16
|
-
app = Rack::Builder.new {
|
17
|
-
map "/" do
|
18
|
-
run Proc.new {
|
19
|
-
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
20
|
-
}
|
21
|
-
end
|
22
|
-
map "/error" do
|
23
|
-
run Proc.new {
|
24
|
-
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
25
|
-
}
|
26
|
-
end
|
27
|
-
}
|
28
|
-
|
29
|
-
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7011})
|
30
|
-
end
|
31
|
-
|
32
|
-
Thread.new do
|
33
|
-
app = Rack::Builder.new {
|
34
|
-
use ::Instana::Rack
|
35
|
-
map "/" do
|
36
|
-
run Proc.new {
|
37
|
-
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
38
|
-
}
|
39
|
-
end
|
40
|
-
map "/error" do
|
41
|
-
run Proc.new {
|
42
|
-
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
43
|
-
}
|
44
|
-
end
|
45
|
-
}
|
46
|
-
|
47
|
-
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7012})
|
48
|
-
end
|
49
|
-
|
50
|
-
sleep(2)
|
51
|
-
puts "Rack server started in background thread on localhost:7011"
|
52
|
-
puts "Sleeping for 10 to allow announce"
|
53
|
-
sleep(10)
|
54
|
-
|
55
|
-
puts "Starting profile"
|
56
|
-
uri = URI.parse("http://127.0.0.1:7011/")
|
57
|
-
StackProf.run(mode: :wall, out: 'tmp/stackprof-rack-vanilla.dump') do
|
58
|
-
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
59
|
-
5_000.times {
|
60
|
-
::Instana.tracer.start_or_continue_trace(:rack_call) do
|
61
|
-
req = Net::HTTP::Get.new(uri.request_uri)
|
62
|
-
hc.request(req)
|
63
|
-
end
|
64
|
-
}
|
65
|
-
end
|
66
|
-
end
|
67
|
-
puts "stackprof tmp/stackprof-rack-vanilla.dump --text"
|
68
|
-
|
69
|
-
uri = URI.parse("http://127.0.0.1:7012/")
|
70
|
-
StackProf.run(mode: :wall, out: 'tmp/stackprof-rack-instrumented.dump') do
|
71
|
-
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
72
|
-
5_000.times {
|
73
|
-
::Instana.tracer.start_or_continue_trace(:rack_call) do
|
74
|
-
req = Net::HTTP::Get.new(uri.request_uri)
|
75
|
-
hc.request(req)
|
76
|
-
end
|
77
|
-
}
|
78
|
-
end
|
79
|
-
end
|
80
|
-
puts "stackprof tmp/stackprof-rack-instrumented.dump --text"
|
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
# (c) Copyright IBM Corp. 2021
|
4
|
-
# (c) Copyright Instana Inc. 2017
|
5
|
-
|
6
|
-
require "bundler"
|
7
|
-
Bundler.require(:default)
|
8
|
-
|
9
|
-
require "benchmark"
|
10
|
-
|
11
|
-
# Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
12
|
-
|
13
|
-
Benchmark.bm do |x|
|
14
|
-
x.report("Time.now: ") { 1_000_000.times { (Time.now.to_f * 1000).floor } }
|
15
|
-
x.report("get_clocktime:") { 1_000_000.times { Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) } }
|
16
|
-
end
|