appoptics_apm 4.8.0 → 4.9.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/.gitignore +5 -1
- data/.irbrc +3 -0
- data/.travis.yml +39 -24
- data/CONFIG.md +1 -1
- data/README.md +1 -1
- data/Rakefile +60 -53
- data/appoptics_apm.gemspec +1 -1
- data/build_gem_upload_to_packagecloud.sh +1 -6
- data/examples/SDK/01_basic_tracing.rb +0 -2
- data/ext/oboe_metal/README.md +69 -0
- data/ext/oboe_metal/src/VERSION +1 -1
- data/ext/oboe_metal/src/oboe.h +102 -71
- data/ext/oboe_metal/src/oboe.hpp +111 -69
- data/ext/oboe_metal/src/oboe_wrap.cxx +1470 -314
- data/lib/appoptics_apm.rb +1 -0
- data/lib/appoptics_apm/config.rb +11 -4
- data/lib/appoptics_apm/frameworks/rails/inst/action_controller.rb +4 -4
- data/lib/appoptics_apm/frameworks/rails/inst/action_controller6.rb +50 -0
- data/lib/appoptics_apm/frameworks/rails/inst/action_view.rb +1 -1
- data/lib/appoptics_apm/frameworks/rails/inst/active_record.rb +2 -2
- data/lib/appoptics_apm/inst/logger_formatter.rb +4 -3
- data/lib/appoptics_apm/inst/rack.rb +11 -11
- data/lib/appoptics_apm/oboe_init_options.rb +17 -4
- data/lib/appoptics_apm/support/transaction_settings.rb +40 -16
- data/lib/appoptics_apm/support/x_trace_options.rb +110 -0
- data/lib/appoptics_apm/version.rb +1 -1
- data/lib/rails/generators/appoptics_apm/templates/appoptics_apm_initializer.rb +37 -12
- data/oboe.code-workspace +66 -0
- data/scrap.rb +134 -0
- data/scrap_gemfile +5 -0
- data/scrap_gemfile.lock +140 -0
- metadata +12 -4
@@ -50,7 +50,7 @@ if defined?(AppOpticsAPM::Config)
|
|
50
50
|
AppOpticsAPM::Config[:verbose] = false
|
51
51
|
|
52
52
|
#
|
53
|
-
# Turn
|
53
|
+
# Turn Tracing on or off
|
54
54
|
#
|
55
55
|
# By default tracing is set to :enabled, the other option is :disabled.
|
56
56
|
# :enabled means that sampling will be done according to the current
|
@@ -61,31 +61,41 @@ if defined?(AppOpticsAPM::Config)
|
|
61
61
|
#
|
62
62
|
AppOpticsAPM::Config[:tracing_mode] = :enabled
|
63
63
|
|
64
|
+
#
|
65
|
+
# Turn Trigger Tracing on or off
|
66
|
+
#
|
67
|
+
# By default trigger tracing is :enabled, the other option is :disabled.
|
68
|
+
# It allows to use the X-Trace-Options header to force a request to be
|
69
|
+
# traced (within rate limits set for trigger tracing)
|
70
|
+
#
|
71
|
+
AppOpticsAPM::Config[:trigger_tracing_mode] = :enabled
|
72
|
+
|
64
73
|
#
|
65
74
|
# Trace Context in Logs
|
66
75
|
#
|
67
|
-
# Configure if and when the
|
76
|
+
# Configure if and when the Trace ID should be included in application logs.
|
68
77
|
# Common Ruby and Rails loggers are auto-instrumented, so that they can include
|
69
|
-
# the current
|
78
|
+
# the current Trace ID in log messages.
|
70
79
|
#
|
71
80
|
# The added string will look like: "ao.traceId=7435A9FE510AE4533414D425DADF4E180D2B4E36-0"
|
72
81
|
# It ends in '-1' if the request is sampled and in '-0' otherwise.
|
73
82
|
#
|
74
83
|
# The following options are available:
|
75
84
|
# :never (default)
|
76
|
-
# :sampled only include the
|
77
|
-
# :traced include the
|
78
|
-
# :always always add a
|
85
|
+
# :sampled only include the Trace ID of sampled requests
|
86
|
+
# :traced include the Trace ID for all traced requests
|
87
|
+
# :always always add a Trace ID, it will be '0000000000000000000000000000000000000000-0'
|
79
88
|
# when there is no tracing context.
|
80
89
|
#
|
81
90
|
AppOpticsAPM::Config[:log_traceId] = :never
|
82
91
|
|
83
92
|
#
|
84
|
-
# Prepend
|
93
|
+
# Prepend Domain to Transaction Name
|
85
94
|
#
|
86
|
-
# If this is set to `true` transaction names will be composed as
|
87
|
-
# `controller.action
|
88
|
-
#
|
95
|
+
# If this is set to `true` transaction names will be composed as
|
96
|
+
# `my.host.com/controller.action` instead of `controller.action`.
|
97
|
+
# This configuration applies to all transaction names, whether deduced by the
|
98
|
+
# instrumentation or implicitly set.
|
89
99
|
#
|
90
100
|
AppOpticsAPM::Config[:transaction_name][:prepend_domain] = false
|
91
101
|
|
@@ -195,6 +205,21 @@ if defined?(AppOpticsAPM::Config)
|
|
195
205
|
AppOpticsAPM::Config[:report_rescued_errors] = false
|
196
206
|
#
|
197
207
|
|
208
|
+
#
|
209
|
+
# EC2 Metadata Fetching Timeout
|
210
|
+
#
|
211
|
+
# The timeout can be in the range 0 - 3000 (milliseconds)
|
212
|
+
# Setting to 0 milliseconds effectively disables fetching from
|
213
|
+
# the metadata URL (not waiting), and should only be used if
|
214
|
+
# not running on EC2 / Openstack to minimize agent start up time.
|
215
|
+
#
|
216
|
+
AppOpticsAPM::Config[:ec2_metadata_timeout] = 1000
|
217
|
+
|
218
|
+
|
219
|
+
#############################################
|
220
|
+
## SETTINGS FOR INDIVIDUAL GEMS/FRAMEWORKS ##
|
221
|
+
#############################################
|
222
|
+
|
198
223
|
#
|
199
224
|
# Bunny Controller and Action
|
200
225
|
#
|
@@ -235,7 +260,7 @@ if defined?(AppOpticsAPM::Config)
|
|
235
260
|
AppOpticsAPM::Config[:dalli][:enabled] = true
|
236
261
|
AppOpticsAPM::Config[:delayed_jobclient][:enabled] = true
|
237
262
|
AppOpticsAPM::Config[:delayed_jobworker][:enabled] = true
|
238
|
-
AppOpticsAPM::Config[:em_http_request][:enabled] = false
|
263
|
+
# AppOpticsAPM::Config[:em_http_request][:enabled] = false # not supported anymore
|
239
264
|
AppOpticsAPM::Config[:excon][:enabled] = true
|
240
265
|
AppOpticsAPM::Config[:faraday][:enabled] = true
|
241
266
|
AppOpticsAPM::Config[:grpc_client][:enabled] = true
|
@@ -301,7 +326,7 @@ if defined?(AppOpticsAPM::Config)
|
|
301
326
|
AppOpticsAPM::Config[:dalli][:collect_backtraces] = false
|
302
327
|
AppOpticsAPM::Config[:delayed_jobclient][:collect_backtraces] = false
|
303
328
|
AppOpticsAPM::Config[:delayed_jobworker][:collect_backtraces] = false
|
304
|
-
AppOpticsAPM::Config[:em_http_request][:collect_backtraces] = true
|
329
|
+
# AppOpticsAPM::Config[:em_http_request][:collect_backtraces] = true # not supported anymore
|
305
330
|
AppOpticsAPM::Config[:excon][:collect_backtraces] = true
|
306
331
|
AppOpticsAPM::Config[:faraday][:collect_backtraces] = false
|
307
332
|
AppOpticsAPM::Config[:grape][:collect_backtraces] = true
|
data/oboe.code-workspace
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
{
|
2
|
+
"folders": [
|
3
|
+
{
|
4
|
+
"path": "/Users/maiaengeli/workspace/librato/oboe/liboboe"
|
5
|
+
}
|
6
|
+
],
|
7
|
+
"settings": {
|
8
|
+
"files.associations": {
|
9
|
+
"iosfwd": "c",
|
10
|
+
"rope": "c",
|
11
|
+
"*.ipp": "cpp",
|
12
|
+
"array": "cpp",
|
13
|
+
"hash_map": "cpp",
|
14
|
+
"deque": "cpp",
|
15
|
+
"list": "cpp",
|
16
|
+
"unordered_map": "cpp",
|
17
|
+
"unordered_set": "cpp",
|
18
|
+
"vector": "cpp",
|
19
|
+
"slist": "cpp",
|
20
|
+
"initializer_list": "cpp",
|
21
|
+
"string_view": "cpp",
|
22
|
+
"valarray": "cpp",
|
23
|
+
"*.tcc": "cpp",
|
24
|
+
"cctype": "cpp",
|
25
|
+
"clocale": "cpp",
|
26
|
+
"cmath": "cpp",
|
27
|
+
"cstdarg": "cpp",
|
28
|
+
"cstdint": "cpp",
|
29
|
+
"cstdio": "cpp",
|
30
|
+
"cstdlib": "cpp",
|
31
|
+
"cwchar": "cpp",
|
32
|
+
"cwctype": "cpp",
|
33
|
+
"exception": "cpp",
|
34
|
+
"iostream": "cpp",
|
35
|
+
"istream": "cpp",
|
36
|
+
"limits": "cpp",
|
37
|
+
"new": "cpp",
|
38
|
+
"ostream": "cpp",
|
39
|
+
"sstream": "cpp",
|
40
|
+
"stdexcept": "cpp",
|
41
|
+
"streambuf": "cpp",
|
42
|
+
"system_error": "cpp",
|
43
|
+
"cinttypes": "cpp",
|
44
|
+
"type_traits": "cpp",
|
45
|
+
"typeinfo": "cpp",
|
46
|
+
"tuple": "cpp",
|
47
|
+
"utility": "cpp",
|
48
|
+
"cstddef": "cpp",
|
49
|
+
"cstring": "cpp",
|
50
|
+
"ctime": "cpp",
|
51
|
+
"fstream": "cpp",
|
52
|
+
"functional": "cpp",
|
53
|
+
"memory": "cpp",
|
54
|
+
"optional": "cpp",
|
55
|
+
"chrono": "cpp",
|
56
|
+
"atomic": "cpp",
|
57
|
+
"codecvt": "cpp",
|
58
|
+
"condition_variable": "cpp",
|
59
|
+
"csignal": "cpp",
|
60
|
+
"iomanip": "cpp",
|
61
|
+
"mutex": "cpp",
|
62
|
+
"ratio": "cpp",
|
63
|
+
"thread": "cpp"
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
data/scrap.rb
ADDED
@@ -0,0 +1,134 @@
|
|
1
|
+
# Gemfile
|
2
|
+
#
|
3
|
+
# source "https://rubygems.org"
|
4
|
+
#
|
5
|
+
# gem 'rails', '~> 6.0.0'
|
6
|
+
# gem 'puma'
|
7
|
+
# gem 'pg'
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
require "rails"
|
12
|
+
require "active_model/railtie"
|
13
|
+
require "active_job/railtie"
|
14
|
+
require "active_record/railtie"
|
15
|
+
require "action_controller/railtie"
|
16
|
+
require "action_mailer/railtie"
|
17
|
+
require "action_view/railtie"
|
18
|
+
require "action_cable/engine"
|
19
|
+
require "rails/test_unit/railtie"
|
20
|
+
|
21
|
+
require 'rack/handler/puma'
|
22
|
+
|
23
|
+
|
24
|
+
# adjust this or comment out if you have a config/database.yml
|
25
|
+
ENV['DATABASE_URL'] = "postgresql://docker:#{ENV['DOCKER_PSQL_PASS']}@127.0.0.1:5432/travis_ci_test"
|
26
|
+
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
|
27
|
+
|
28
|
+
|
29
|
+
module Rails50APIStack
|
30
|
+
class Application < Rails::Application
|
31
|
+
config.api_only = true
|
32
|
+
|
33
|
+
routes.append do
|
34
|
+
get "/monkey/hello" => "monkey#hello"
|
35
|
+
get "/monkey/error" => "monkey#error"
|
36
|
+
end
|
37
|
+
|
38
|
+
config.cache_classes = true
|
39
|
+
config.eager_load = false
|
40
|
+
config.active_support.deprecation = :stderr
|
41
|
+
config.middleware.delete Rack::Lock
|
42
|
+
config.middleware.delete ActionDispatch::Flash
|
43
|
+
config.secret_token = "48837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
|
44
|
+
config.secret_key_base = "2049671-96803948"
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
class MonkeyController < ActionController::API
|
49
|
+
def hello
|
50
|
+
render :plain => {:Response => "Hello API!"}.to_json, content_type: 'application/json'
|
51
|
+
end
|
52
|
+
|
53
|
+
def error
|
54
|
+
raise "Rails API fake error from controller"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Rails50APIStack::Application.initialize!
|
59
|
+
|
60
|
+
Thread.new do
|
61
|
+
Rack::Handler::Puma.run(Rails50APIStack::Application.to_app, {:Host => '127.0.0.1', :Port => 8150})
|
62
|
+
end
|
63
|
+
|
64
|
+
|
65
|
+
class Rails50Stack
|
66
|
+
class Application < Rails::Application
|
67
|
+
routes.append do
|
68
|
+
get "/hello/world" => "hello#world"
|
69
|
+
end
|
70
|
+
|
71
|
+
config.cache_classes = true
|
72
|
+
config.eager_load = false
|
73
|
+
config.active_support.deprecation = :stderr
|
74
|
+
config.middleware.delete Rack::Lock
|
75
|
+
config.middleware.delete ActionDispatch::Flash
|
76
|
+
config.secret_token = "49837489qkuweoiuoqwehisuakshdjksadhaisdy78o34y138974xyqp9rmye8yrpiokeuioqwzyoiuxftoyqiuxrhm3iou1hrzmjk"
|
77
|
+
config.secret_key_base = "2048671-96803948"
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class HelloController < ActionController::Base
|
82
|
+
def world
|
83
|
+
render :plain => "Hello world!"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
Rails50Stack::Application.initialize!
|
88
|
+
|
89
|
+
Thread.new do
|
90
|
+
Rack::Handler::Puma.run(Rails50Stack::Application.to_app, {:Host => '127.0.0.1', :Port => 8140})
|
91
|
+
end
|
92
|
+
|
93
|
+
sleep(2)
|
94
|
+
|
95
|
+
# module Aaaa
|
96
|
+
# def do(arg)
|
97
|
+
# puts "#{arg} AAAA "
|
98
|
+
# super
|
99
|
+
# end
|
100
|
+
# end
|
101
|
+
#
|
102
|
+
# module Bbbb
|
103
|
+
# include Aaaa
|
104
|
+
#
|
105
|
+
# def do(arg)
|
106
|
+
# puts "#{arg} BBBB "
|
107
|
+
# super
|
108
|
+
# end
|
109
|
+
# end
|
110
|
+
#
|
111
|
+
# class Cccc
|
112
|
+
# prepend Aaaa
|
113
|
+
#
|
114
|
+
# def do(arg)
|
115
|
+
# puts "#{arg} CCCC "
|
116
|
+
# # super
|
117
|
+
# end
|
118
|
+
# end
|
119
|
+
#
|
120
|
+
# class Zzzz < Cccc
|
121
|
+
# # prepend Aaaa
|
122
|
+
# prepend Bbbb
|
123
|
+
#
|
124
|
+
# def do(arg)
|
125
|
+
# puts "#{arg} ZZZZ PI "
|
126
|
+
# super
|
127
|
+
# end
|
128
|
+
# end
|
129
|
+
#
|
130
|
+
# sleep 60
|
131
|
+
# puts Zzzz.ancestors
|
132
|
+
# Zzzz.new.do('hhhhmmmm? ')
|
133
|
+
|
134
|
+
|
data/scrap_gemfile
ADDED
data/scrap_gemfile.lock
ADDED
@@ -0,0 +1,140 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
actioncable (6.0.0)
|
5
|
+
actionpack (= 6.0.0)
|
6
|
+
nio4r (~> 2.0)
|
7
|
+
websocket-driver (>= 0.6.1)
|
8
|
+
actionmailbox (6.0.0)
|
9
|
+
actionpack (= 6.0.0)
|
10
|
+
activejob (= 6.0.0)
|
11
|
+
activerecord (= 6.0.0)
|
12
|
+
activestorage (= 6.0.0)
|
13
|
+
activesupport (= 6.0.0)
|
14
|
+
mail (>= 2.7.1)
|
15
|
+
actionmailer (6.0.0)
|
16
|
+
actionpack (= 6.0.0)
|
17
|
+
actionview (= 6.0.0)
|
18
|
+
activejob (= 6.0.0)
|
19
|
+
mail (~> 2.5, >= 2.5.4)
|
20
|
+
rails-dom-testing (~> 2.0)
|
21
|
+
actionpack (6.0.0)
|
22
|
+
actionview (= 6.0.0)
|
23
|
+
activesupport (= 6.0.0)
|
24
|
+
rack (~> 2.0)
|
25
|
+
rack-test (>= 0.6.3)
|
26
|
+
rails-dom-testing (~> 2.0)
|
27
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
28
|
+
actiontext (6.0.0)
|
29
|
+
actionpack (= 6.0.0)
|
30
|
+
activerecord (= 6.0.0)
|
31
|
+
activestorage (= 6.0.0)
|
32
|
+
activesupport (= 6.0.0)
|
33
|
+
nokogiri (>= 1.8.5)
|
34
|
+
actionview (6.0.0)
|
35
|
+
activesupport (= 6.0.0)
|
36
|
+
builder (~> 3.1)
|
37
|
+
erubi (~> 1.4)
|
38
|
+
rails-dom-testing (~> 2.0)
|
39
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
40
|
+
activejob (6.0.0)
|
41
|
+
activesupport (= 6.0.0)
|
42
|
+
globalid (>= 0.3.6)
|
43
|
+
activemodel (6.0.0)
|
44
|
+
activesupport (= 6.0.0)
|
45
|
+
activerecord (6.0.0)
|
46
|
+
activemodel (= 6.0.0)
|
47
|
+
activesupport (= 6.0.0)
|
48
|
+
activestorage (6.0.0)
|
49
|
+
actionpack (= 6.0.0)
|
50
|
+
activejob (= 6.0.0)
|
51
|
+
activerecord (= 6.0.0)
|
52
|
+
marcel (~> 0.3.1)
|
53
|
+
activesupport (6.0.0)
|
54
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
55
|
+
i18n (>= 0.7, < 2)
|
56
|
+
minitest (~> 5.1)
|
57
|
+
tzinfo (~> 1.1)
|
58
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
59
|
+
builder (3.2.3)
|
60
|
+
concurrent-ruby (1.1.5)
|
61
|
+
crass (1.0.4)
|
62
|
+
erubi (1.8.0)
|
63
|
+
globalid (0.4.2)
|
64
|
+
activesupport (>= 4.2.0)
|
65
|
+
i18n (1.6.0)
|
66
|
+
concurrent-ruby (~> 1.0)
|
67
|
+
loofah (2.2.3)
|
68
|
+
crass (~> 1.0.2)
|
69
|
+
nokogiri (>= 1.5.9)
|
70
|
+
mail (2.7.1)
|
71
|
+
mini_mime (>= 0.1.1)
|
72
|
+
marcel (0.3.3)
|
73
|
+
mimemagic (~> 0.3.2)
|
74
|
+
method_source (0.9.2)
|
75
|
+
mimemagic (0.3.3)
|
76
|
+
mini_mime (1.0.2)
|
77
|
+
mini_portile2 (2.4.0)
|
78
|
+
minitest (5.11.3)
|
79
|
+
nio4r (2.4.0)
|
80
|
+
nokogiri (1.10.4)
|
81
|
+
mini_portile2 (~> 2.4.0)
|
82
|
+
pg (1.1.4)
|
83
|
+
puma (4.1.0)
|
84
|
+
nio4r (~> 2.0)
|
85
|
+
rack (2.0.7)
|
86
|
+
rack-test (1.1.0)
|
87
|
+
rack (>= 1.0, < 3)
|
88
|
+
rails (6.0.0)
|
89
|
+
actioncable (= 6.0.0)
|
90
|
+
actionmailbox (= 6.0.0)
|
91
|
+
actionmailer (= 6.0.0)
|
92
|
+
actionpack (= 6.0.0)
|
93
|
+
actiontext (= 6.0.0)
|
94
|
+
actionview (= 6.0.0)
|
95
|
+
activejob (= 6.0.0)
|
96
|
+
activemodel (= 6.0.0)
|
97
|
+
activerecord (= 6.0.0)
|
98
|
+
activestorage (= 6.0.0)
|
99
|
+
activesupport (= 6.0.0)
|
100
|
+
bundler (>= 1.3.0)
|
101
|
+
railties (= 6.0.0)
|
102
|
+
sprockets-rails (>= 2.0.0)
|
103
|
+
rails-dom-testing (2.0.3)
|
104
|
+
activesupport (>= 4.2.0)
|
105
|
+
nokogiri (>= 1.6)
|
106
|
+
rails-html-sanitizer (1.2.0)
|
107
|
+
loofah (~> 2.2, >= 2.2.2)
|
108
|
+
railties (6.0.0)
|
109
|
+
actionpack (= 6.0.0)
|
110
|
+
activesupport (= 6.0.0)
|
111
|
+
method_source
|
112
|
+
rake (>= 0.8.7)
|
113
|
+
thor (>= 0.20.3, < 2.0)
|
114
|
+
rake (12.3.3)
|
115
|
+
sprockets (3.7.2)
|
116
|
+
concurrent-ruby (~> 1.0)
|
117
|
+
rack (> 1, < 3)
|
118
|
+
sprockets-rails (3.2.1)
|
119
|
+
actionpack (>= 4.0)
|
120
|
+
activesupport (>= 4.0)
|
121
|
+
sprockets (>= 3.0.0)
|
122
|
+
thor (0.20.3)
|
123
|
+
thread_safe (0.3.6)
|
124
|
+
tzinfo (1.2.5)
|
125
|
+
thread_safe (~> 0.1)
|
126
|
+
websocket-driver (0.7.1)
|
127
|
+
websocket-extensions (>= 0.1.0)
|
128
|
+
websocket-extensions (0.1.4)
|
129
|
+
zeitwerk (2.1.9)
|
130
|
+
|
131
|
+
PLATFORMS
|
132
|
+
ruby
|
133
|
+
|
134
|
+
DEPENDENCIES
|
135
|
+
pg
|
136
|
+
puma
|
137
|
+
rails (~> 6.0.0)
|
138
|
+
|
139
|
+
BUNDLED WITH
|
140
|
+
1.17.3
|