instana 1.10.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +23 -0
- data/.gitignore +16 -0
- data/.rubocop.yml +1156 -0
- data/.travis.yml +43 -0
- data/Configuration.md +149 -0
- data/Dockerfile +13 -0
- data/Gemfile +41 -0
- data/LICENSE +21 -0
- data/README.md +102 -0
- data/Rakefile +56 -0
- data/Tracing.md +145 -0
- data/Troubleshooting.md +32 -0
- data/benchmarks/Gemfile +7 -0
- data/benchmarks/id_generation.rb +12 -0
- data/benchmarks/opentracing.rb +26 -0
- data/benchmarks/rack_vanilla_vs_traced.rb +80 -0
- data/benchmarks/stackprof_rack_tracing.rb +77 -0
- data/benchmarks/time_processing.rb +12 -0
- data/bin/console +7 -0
- data/bin/setup +8 -0
- data/examples/opentracing.rb +31 -0
- data/examples/tracing.rb +80 -0
- data/gemfiles/libraries.gemfile +71 -0
- data/gemfiles/rails32.gemfile +51 -0
- data/gemfiles/rails42.gemfile +50 -0
- data/gemfiles/rails50.gemfile +52 -0
- data/instana.gemspec +46 -0
- data/lib/instana.rb +12 -0
- data/lib/instana/agent.rb +441 -0
- data/lib/instana/agent/helpers.rb +61 -0
- data/lib/instana/agent/hooks.rb +37 -0
- data/lib/instana/agent/tasks.rb +48 -0
- data/lib/instana/base.rb +54 -0
- data/lib/instana/collector.rb +116 -0
- data/lib/instana/collectors/gc.rb +57 -0
- data/lib/instana/collectors/memory.rb +34 -0
- data/lib/instana/collectors/thread.rb +30 -0
- data/lib/instana/config.rb +79 -0
- data/lib/instana/eum/eum-test.js.erb +16 -0
- data/lib/instana/eum/eum.js.erb +14 -0
- data/lib/instana/frameworks/cuba.rb +6 -0
- data/lib/instana/frameworks/instrumentation/abstract_mysql_adapter.rb +58 -0
- data/lib/instana/frameworks/instrumentation/action_controller.rb +183 -0
- data/lib/instana/frameworks/instrumentation/action_view.rb +43 -0
- data/lib/instana/frameworks/instrumentation/active_record.rb +27 -0
- data/lib/instana/frameworks/instrumentation/mysql2_adapter.rb +81 -0
- data/lib/instana/frameworks/instrumentation/mysql_adapter.rb +56 -0
- data/lib/instana/frameworks/instrumentation/postgresql_adapter.rb +71 -0
- data/lib/instana/frameworks/rails.rb +42 -0
- data/lib/instana/frameworks/roda.rb +6 -0
- data/lib/instana/frameworks/sinatra.rb +9 -0
- data/lib/instana/helpers.rb +40 -0
- data/lib/instana/instrumentation.rb +21 -0
- data/lib/instana/instrumentation/dalli.rb +78 -0
- data/lib/instana/instrumentation/excon.rb +74 -0
- data/lib/instana/instrumentation/grpc.rb +84 -0
- data/lib/instana/instrumentation/net-http.rb +66 -0
- data/lib/instana/instrumentation/rack.rb +77 -0
- data/lib/instana/instrumentation/redis.rb +82 -0
- data/lib/instana/instrumentation/resque.rb +131 -0
- data/lib/instana/instrumentation/rest-client.rb +34 -0
- data/lib/instana/instrumentation/sidekiq-client.rb +45 -0
- data/lib/instana/instrumentation/sidekiq-worker.rb +54 -0
- data/lib/instana/opentracing/carrier.rb +4 -0
- data/lib/instana/opentracing/tracer.rb +18 -0
- data/lib/instana/rack.rb +10 -0
- data/lib/instana/setup.rb +36 -0
- data/lib/instana/test.rb +40 -0
- data/lib/instana/thread_local.rb +15 -0
- data/lib/instana/tracer.rb +392 -0
- data/lib/instana/tracing/processor.rb +92 -0
- data/lib/instana/tracing/span.rb +401 -0
- data/lib/instana/tracing/span_context.rb +33 -0
- data/lib/instana/util.rb +261 -0
- data/lib/instana/version.rb +4 -0
- data/lib/oj_check.rb +16 -0
- data/lib/opentracing.rb +6 -0
- data/test/agent/agent_test.rb +143 -0
- data/test/apps/cuba.rb +15 -0
- data/test/apps/grpc_server.rb +81 -0
- data/test/apps/roda.rb +10 -0
- data/test/apps/sinatra.rb +5 -0
- data/test/benchmarks/bench_id_generation.rb +12 -0
- data/test/benchmarks/bench_opentracing.rb +13 -0
- data/test/config_test.rb +37 -0
- data/test/frameworks/cuba_test.rb +44 -0
- data/test/frameworks/rack_test.rb +167 -0
- data/test/frameworks/rails/actioncontroller_test.rb +93 -0
- data/test/frameworks/rails/actionview3_test.rb +255 -0
- data/test/frameworks/rails/actionview4_test.rb +254 -0
- data/test/frameworks/rails/actionview5_test.rb +221 -0
- data/test/frameworks/rails/activerecord3_test.rb +134 -0
- data/test/frameworks/rails/activerecord4_test.rb +134 -0
- data/test/frameworks/rails/activerecord5_test.rb +87 -0
- data/test/frameworks/roda_test.rb +44 -0
- data/test/frameworks/sinatra_test.rb +44 -0
- data/test/instana_test.rb +27 -0
- data/test/instrumentation/dalli_test.rb +253 -0
- data/test/instrumentation/excon_test.rb +147 -0
- data/test/instrumentation/grpc_test.rb +377 -0
- data/test/instrumentation/net-http_test.rb +160 -0
- data/test/instrumentation/redis_test.rb +119 -0
- data/test/instrumentation/resque_test.rb +128 -0
- data/test/instrumentation/rest-client_test.rb +55 -0
- data/test/instrumentation/sidekiq-client_test.rb +125 -0
- data/test/instrumentation/sidekiq-worker_test.rb +173 -0
- data/test/jobs/resque_error_job.rb +22 -0
- data/test/jobs/resque_fast_job.rb +20 -0
- data/test/jobs/sidekiq_job_1.rb +6 -0
- data/test/jobs/sidekiq_job_2.rb +7 -0
- data/test/models/block.rb +18 -0
- data/test/servers/grpc_50051.rb +20 -0
- data/test/servers/helpers/sidekiq_worker_initializer.rb +27 -0
- data/test/servers/rackapp_6511.rb +25 -0
- data/test/servers/rails_3205.rb +167 -0
- data/test/servers/sidekiq/worker.rb +27 -0
- data/test/test_helper.rb +145 -0
- data/test/tracing/custom_test.rb +158 -0
- data/test/tracing/id_management_test.rb +130 -0
- data/test/tracing/opentracing_test.rb +335 -0
- data/test/tracing/trace_test.rb +67 -0
- data/test/tracing/tracer_async_test.rb +198 -0
- data/test/tracing/tracer_test.rb +223 -0
- metadata +327 -0
data/Troubleshooting.md
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# Troubleshooting
|
2
|
+
|
3
|
+
The Instana gem has been designed to be fully automatic in process metric reporting and trace reporting. But if something
|
4
|
+
goes wrong, you can use the following steps and tips to potentially diagnose any issues that may exist.
|
5
|
+
|
6
|
+
# Supported Components
|
7
|
+
|
8
|
+
Make sure that the component that you want to get visibility into has been added to the support matrix. A list of all
|
9
|
+
supported components can be found in the [documentation](https://docs.instana.io/ecosystem/ruby/).
|
10
|
+
|
11
|
+
# Logging & Environment Variables
|
12
|
+
|
13
|
+
By default, the gem will log informational messages on boot that will indicate if any problems were encountered. If you
|
14
|
+
set the `INSTANA_DEBUG` environment variable, it will increase the amount of logging output.
|
15
|
+
|
16
|
+
![instana console output](https://s3.amazonaws.com/instana/Instana+Ruby+boot+console+logging+output.png)
|
17
|
+
|
18
|
+
In the example above, you can see that the host agent isn't available. Once the host agent is available, the Instana
|
19
|
+
gem will automatically re-connect without any intervention.
|
20
|
+
|
21
|
+
There are even more methods to control logging output. See the [Configuration](https://github.com/instana/ruby-sensor/blob/master/Configuration.md#logging)
|
22
|
+
document for details.
|
23
|
+
|
24
|
+
# Testing in your Application
|
25
|
+
|
26
|
+
To diagnose the Instana gem from your application, often simply opening an application console with verbose logging can be
|
27
|
+
enough to identify any potential issues:
|
28
|
+
|
29
|
+
![rails console](https://s3.amazonaws.com/instana/Instana+Ruby+Rails+console+output.png)
|
30
|
+
|
31
|
+
In the example above, you can see the Instana Ruby gem initialize, instrument some components and a success notification: `Host agent available. We're
|
32
|
+
in business`.
|
data/benchmarks/Gemfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "bundler"
|
3
|
+
Bundler.require(:default)
|
4
|
+
|
5
|
+
require "benchmark"
|
6
|
+
|
7
|
+
ID_RANGE = -2**63..2**63-1
|
8
|
+
|
9
|
+
Benchmark.bm do |x|
|
10
|
+
x.report("generate_id raw ") { 1_000_000.times { rand(-2**63..2**63-1) } }
|
11
|
+
x.report("with fixed range ") { 1_000_000.times { rand(ID_RANGE) } }
|
12
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "bundler"
|
3
|
+
Bundler.require(:default)
|
4
|
+
|
5
|
+
require "benchmark"
|
6
|
+
|
7
|
+
Benchmark.bm do |x|
|
8
|
+
x.report("start_span, finish: ") {
|
9
|
+
50_000.times {
|
10
|
+
::Instana.tracer.start_span(:blah).finish
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
x.report("start_span, set_tag(5x), finish:") {
|
15
|
+
50_000.times {
|
16
|
+
span = ::Instana.tracer.start_span(:blah)
|
17
|
+
span.set_tag(:blah, 1)
|
18
|
+
span.set_tag(:dog, 1)
|
19
|
+
span.set_tag(:moon, "ok")
|
20
|
+
span.set_tag(:ape, 1)
|
21
|
+
span.set_tag(:blah, 1)
|
22
|
+
span.finish
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require "bundler"
|
2
|
+
|
3
|
+
require 'rack'
|
4
|
+
require 'rack/builder'
|
5
|
+
require 'rack/handler/puma'
|
6
|
+
require 'net/http'
|
7
|
+
require "benchmark"
|
8
|
+
require "cgi"
|
9
|
+
Bundler.require(:default)
|
10
|
+
require "instana/rack"
|
11
|
+
|
12
|
+
Thread.new do
|
13
|
+
app = Rack::Builder.new {
|
14
|
+
map "/" do
|
15
|
+
run Proc.new {
|
16
|
+
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
17
|
+
}
|
18
|
+
end
|
19
|
+
map "/error" do
|
20
|
+
run Proc.new {
|
21
|
+
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
22
|
+
}
|
23
|
+
end
|
24
|
+
}
|
25
|
+
|
26
|
+
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7011})
|
27
|
+
end
|
28
|
+
|
29
|
+
Thread.new do
|
30
|
+
app = Rack::Builder.new {
|
31
|
+
use ::Instana::Rack
|
32
|
+
map "/" do
|
33
|
+
run Proc.new {
|
34
|
+
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
map "/error" do
|
38
|
+
run Proc.new {
|
39
|
+
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
40
|
+
}
|
41
|
+
end
|
42
|
+
}
|
43
|
+
|
44
|
+
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7012})
|
45
|
+
end
|
46
|
+
|
47
|
+
sleep(2)
|
48
|
+
puts "Rack server started in background thread on localhost:7011"
|
49
|
+
puts "Sleeping for 10 to allow announce"
|
50
|
+
sleep(10)
|
51
|
+
|
52
|
+
|
53
|
+
puts "Starting benchmarks"
|
54
|
+
Benchmark.bm do |x|
|
55
|
+
|
56
|
+
uri = URI.parse("http://127.0.0.1:7011/")
|
57
|
+
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
58
|
+
x.report("vanilla") {
|
59
|
+
1_000.times {
|
60
|
+
req = Net::HTTP::Get.new(uri.request_uri)
|
61
|
+
hc.request(req)
|
62
|
+
}
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
uri = URI.parse("http://127.0.0.1:7012/")
|
67
|
+
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
68
|
+
x.report("traced ") {
|
69
|
+
1_000.times {
|
70
|
+
::Instana.tracer.start_or_continue_trace(:rack_call) do
|
71
|
+
req = Net::HTTP::Get.new(uri.request_uri)
|
72
|
+
hc.request(req)
|
73
|
+
end
|
74
|
+
}
|
75
|
+
}
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
sleep 10
|
@@ -0,0 +1,77 @@
|
|
1
|
+
require "bundler"
|
2
|
+
require "stackprof"
|
3
|
+
require 'rack'
|
4
|
+
require 'rack/builder'
|
5
|
+
require 'rack/handler/puma'
|
6
|
+
require 'net/http'
|
7
|
+
require "benchmark"
|
8
|
+
require "cgi"
|
9
|
+
Bundler.require(:default)
|
10
|
+
require "instana/rack"
|
11
|
+
|
12
|
+
Thread.new do
|
13
|
+
app = Rack::Builder.new {
|
14
|
+
map "/" do
|
15
|
+
run Proc.new {
|
16
|
+
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
17
|
+
}
|
18
|
+
end
|
19
|
+
map "/error" do
|
20
|
+
run Proc.new {
|
21
|
+
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
22
|
+
}
|
23
|
+
end
|
24
|
+
}
|
25
|
+
|
26
|
+
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7011})
|
27
|
+
end
|
28
|
+
|
29
|
+
Thread.new do
|
30
|
+
app = Rack::Builder.new {
|
31
|
+
use ::Instana::Rack
|
32
|
+
map "/" do
|
33
|
+
run Proc.new {
|
34
|
+
[200, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"scene!\"]"]]
|
35
|
+
}
|
36
|
+
end
|
37
|
+
map "/error" do
|
38
|
+
run Proc.new {
|
39
|
+
[500, {"Content-Type" => "application/json"}, ["[\"Stan\",\"is\",\"on\",\"the\",\"error!\"]"]]
|
40
|
+
}
|
41
|
+
end
|
42
|
+
}
|
43
|
+
|
44
|
+
Rack::Handler::Puma.run(app, {:Host => '127.0.0.1', :Port => 7012})
|
45
|
+
end
|
46
|
+
|
47
|
+
sleep(2)
|
48
|
+
puts "Rack server started in background thread on localhost:7011"
|
49
|
+
puts "Sleeping for 10 to allow announce"
|
50
|
+
sleep(10)
|
51
|
+
|
52
|
+
puts "Starting profile"
|
53
|
+
uri = URI.parse("http://127.0.0.1:7011/")
|
54
|
+
StackProf.run(mode: :wall, out: 'tmp/stackprof-rack-vanilla.dump') do
|
55
|
+
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
56
|
+
5_000.times {
|
57
|
+
::Instana.tracer.start_or_continue_trace(:rack_call) do
|
58
|
+
req = Net::HTTP::Get.new(uri.request_uri)
|
59
|
+
hc.request(req)
|
60
|
+
end
|
61
|
+
}
|
62
|
+
end
|
63
|
+
end
|
64
|
+
puts "stackprof tmp/stackprof-rack-vanilla.dump --text"
|
65
|
+
|
66
|
+
uri = URI.parse("http://127.0.0.1:7012/")
|
67
|
+
StackProf.run(mode: :wall, out: 'tmp/stackprof-rack-instrumented.dump') do
|
68
|
+
::Net::HTTP.start(uri.host, uri.port) do |hc|
|
69
|
+
5_000.times {
|
70
|
+
::Instana.tracer.start_or_continue_trace(:rack_call) do
|
71
|
+
req = Net::HTTP::Get.new(uri.request_uri)
|
72
|
+
hc.request(req)
|
73
|
+
end
|
74
|
+
}
|
75
|
+
end
|
76
|
+
end
|
77
|
+
puts "stackprof tmp/stackprof-rack-instrumented.dump --text"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require "bundler"
|
3
|
+
Bundler.require(:default)
|
4
|
+
|
5
|
+
require "benchmark"
|
6
|
+
|
7
|
+
# Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
|
8
|
+
|
9
|
+
Benchmark.bm do |x|
|
10
|
+
x.report("Time.now: ") { 1_000_000.times { (Time.now.to_f * 1000).floor } }
|
11
|
+
x.report("get_clocktime:") { 1_000_000.times { Process.clock_gettime(Process::CLOCK_REALTIME, :millisecond) } }
|
12
|
+
end
|
data/bin/console
ADDED
data/bin/setup
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file contains a basic OpenTracing example.
|
2
|
+
#
|
3
|
+
# Note: The instana gem automatically sets the Instana tracer
|
4
|
+
# to `OpenTracing.global_tracer`. Once the gem is loaded, you can
|
5
|
+
# immediately start making OpenTracing calls.
|
6
|
+
#
|
7
|
+
require "opentracing"
|
8
|
+
|
9
|
+
entry_span = OpenTracing.start_span("HandMadeRackServer")
|
10
|
+
|
11
|
+
entry_span.set_tag(:'http.method', :get)
|
12
|
+
entry_span.set_tag(:'http.url', "/users")
|
13
|
+
entry_span.set_tag(:'span.kind', "entry")
|
14
|
+
|
15
|
+
intermediate_span = OpenTracing.start_span("myintermediate", :child_of => entry_span)
|
16
|
+
intermediate_span.finish()
|
17
|
+
|
18
|
+
db_span = OpenTracing.start_span('mydbspan', :child_of => entry_span)
|
19
|
+
db_span.set_tag(:'db.instance', "users")
|
20
|
+
db_span.set_tag(:'db.statement', "SELECT * FROM user_table")
|
21
|
+
db_span.set_tag(:'db.type', "mysql")
|
22
|
+
db_span.set_tag(:'db.user', "mysql_login")
|
23
|
+
db_span.set_tag(:'span.kind', "exit")
|
24
|
+
db_span.finish()
|
25
|
+
|
26
|
+
intermediate_span = OpenTracing.start_span("myintermediate", :child_of => entry_span)
|
27
|
+
intermediate_span.log("ALLOK", :message => "All seems ok")
|
28
|
+
intermediate_span.finish()
|
29
|
+
|
30
|
+
entry_span.set_tag(:'http.status_code', 200)
|
31
|
+
entry_span.finish()
|
data/examples/tracing.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
# This file outlines the Instana Ruby Tracing API.
|
2
|
+
#
|
3
|
+
# This same tracer also supports OpenTracing. See `opentracing.rb` for
|
4
|
+
# separate documentation.
|
5
|
+
|
6
|
+
# This API is also documented on rubydoc:
|
7
|
+
# http://www.rubydoc.info/gems/instana/1.7.8/Instana/Tracer
|
8
|
+
|
9
|
+
#######################################
|
10
|
+
## Block tracing
|
11
|
+
#######################################
|
12
|
+
|
13
|
+
#Instana::Tracer.start_or_continue_trace(name, kvs, incoming_context) - Initiates tracing
|
14
|
+
#Instana::Tracer.trace(name, kvs) - starts a new span in an existing Trace
|
15
|
+
|
16
|
+
# <start_or_continue_trace> will initiate a new trace. Often used at entry
|
17
|
+
# points in webservers (e.g. rack), it will initialize tracing and instrument the passed
|
18
|
+
# block. <incoming_id> is a hash for continuing remote traces (remote in terms
|
19
|
+
# of service calls, or message queues).
|
20
|
+
Instana::Tracer.start_or_continue_trace(:my_block_name, {}, incoming_context) do
|
21
|
+
# Code block
|
22
|
+
end
|
23
|
+
|
24
|
+
# <trace> will instrument a block of code in an already running trace.
|
25
|
+
# This is the most common use case (instead of initiating new
|
26
|
+
# traces).
|
27
|
+
Instana::Tracer.trace(:postgres, {:user => 'postgres'}) do
|
28
|
+
@postgres.select(1)
|
29
|
+
end
|
30
|
+
|
31
|
+
#######################################
|
32
|
+
## Lower level logging
|
33
|
+
#######################################
|
34
|
+
|
35
|
+
# <log_start_or_continue_trace> will initiate a new trace. Often used at entry
|
36
|
+
# points in webservers, it will establish a new trace (for web request,
|
37
|
+
# background jobs etc.).
|
38
|
+
# <incoming_context> is a hash for continuing remote traces (remote in terms
|
39
|
+
# of service calls, or message queues).
|
40
|
+
Instana::Tracer.log_start_or_continue(:rack, {}, incoming_context)
|
41
|
+
|
42
|
+
# <log_entry> will start a new span from the current span within
|
43
|
+
# a trace.
|
44
|
+
Instana::Tracer.log_entry(name, kvs)
|
45
|
+
|
46
|
+
# <log_exit> will close out the current span
|
47
|
+
Instana::Tracer.log_exit(name, kvs)
|
48
|
+
|
49
|
+
# <log_info> will append information to the current span in the
|
50
|
+
# trace. Examples could be redis options, contextual data, user
|
51
|
+
# login status etc...
|
52
|
+
Instana::Tracer.log_info({:some_key => 'some_value'})
|
53
|
+
|
54
|
+
# <log_error> will log an exception to the current span in the
|
55
|
+
# trace.
|
56
|
+
Instana::Tracer.log_error(Exception)
|
57
|
+
|
58
|
+
# <log_end> closes out the current span, finishes
|
59
|
+
# the trace and adds it to ::Instana.processor
|
60
|
+
# for reporting.
|
61
|
+
Instana::Tracer.log_end(:rack, {})
|
62
|
+
|
63
|
+
#######################################
|
64
|
+
# Lower level API Example
|
65
|
+
######################################
|
66
|
+
|
67
|
+
# Full Tracing Lifecycle example
|
68
|
+
#
|
69
|
+
Instana::Tracer.log_start_or_continue(:mywebserver, {:user_id => @user_id})
|
70
|
+
|
71
|
+
begin
|
72
|
+
Instana::Tracer.log_entry(:redis_lookup, {:redisdb => @redisdb.url})
|
73
|
+
@redisdb.get(@user_id.session_id)
|
74
|
+
rescue => e
|
75
|
+
Instana::Tracer.log_error(e)
|
76
|
+
ensure
|
77
|
+
Instana::Tracer.log_exit(:redis_lookup)
|
78
|
+
end
|
79
|
+
|
80
|
+
Instana::Tracer.log_end(:mywebserver)
|
@@ -0,0 +1,71 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
group :development, :test do
|
4
|
+
gem 'rake'
|
5
|
+
gem 'minitest', '5.9.1'
|
6
|
+
gem 'minitest-reporters'
|
7
|
+
gem 'minitest-debugger', :require => false
|
8
|
+
gem 'rack-test'
|
9
|
+
gem 'webmock'
|
10
|
+
gem 'puma'
|
11
|
+
# public_suffix dropped support for Ruby 2.1 and earlier.
|
12
|
+
gem 'public_suffix', '< 3.0'
|
13
|
+
end
|
14
|
+
|
15
|
+
group :development do
|
16
|
+
gem 'ruby-debug', :platforms => [:mri_18, :jruby]
|
17
|
+
gem 'debugger', :platform => :mri_19
|
18
|
+
|
19
|
+
if RUBY_VERSION > '1.8.7'
|
20
|
+
gem 'pry'
|
21
|
+
|
22
|
+
if RUBY_VERSION < '2.2'
|
23
|
+
gem 'byebug', '< 9.1.0'
|
24
|
+
gem 'pry-byebug'
|
25
|
+
else
|
26
|
+
gem 'pry-byebug'
|
27
|
+
end
|
28
|
+
else
|
29
|
+
gem 'pry', '0.9.12.4'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Frameworks
|
34
|
+
gem "sinatra", '1.4.7'
|
35
|
+
gem "cuba"
|
36
|
+
gem "roda"
|
37
|
+
|
38
|
+
# gRPC
|
39
|
+
gem 'grpc'
|
40
|
+
|
41
|
+
# HTTP Clients
|
42
|
+
gem 'rest-client'
|
43
|
+
|
44
|
+
# Webservers
|
45
|
+
gem "puma"
|
46
|
+
|
47
|
+
# HTTP Clients
|
48
|
+
gem 'excon'
|
49
|
+
|
50
|
+
# Memcache
|
51
|
+
gem 'dalli'
|
52
|
+
gem 'redis'
|
53
|
+
|
54
|
+
# Background Job queuing and processing
|
55
|
+
if RUBY_VERSION < '2.2'
|
56
|
+
gem 'sidekiq', '~> 4.2.10'
|
57
|
+
else
|
58
|
+
gem 'sidekiq', '> 5.0'
|
59
|
+
end
|
60
|
+
|
61
|
+
gem 'resque'
|
62
|
+
|
63
|
+
# Rack v2 dropped support for Ruby 2.2 and higher.
|
64
|
+
if RUBY_VERSION < '2.2'
|
65
|
+
gem 'rack', '< 2.0'
|
66
|
+
end
|
67
|
+
|
68
|
+
# Include the Instana Ruby gem's base set of gems
|
69
|
+
gemspec :path => File.expand_path(File.dirname(__FILE__) + '/../')
|
70
|
+
|
71
|
+
# vim:syntax=ruby
|