appoptics_apm 4.8.4 → 4.11.1
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 +5 -5
- data/.gitignore +7 -1
- data/.rubocop.yml +27 -6
- data/.travis.yml +24 -37
- data/.travis/bundle.sh +9 -0
- data/CONFIG.md +1 -1
- data/Gemfile +6 -6
- data/appoptics_apm.gemspec +6 -2
- data/examples/SDK/01_basic_tracing.rb +1 -1
- data/ext/oboe_metal/extconf.rb +6 -2
- data/ext/oboe_metal/noop/noop.c +2 -1
- data/ext/oboe_metal/src/VERSION +1 -1
- data/lib/appoptics_apm.rb +1 -3
- data/lib/appoptics_apm/api.rb +0 -1
- data/lib/appoptics_apm/api/logging.rb +6 -2
- data/lib/appoptics_apm/api/tracing.rb +4 -0
- data/lib/appoptics_apm/api/util.rb +5 -7
- data/lib/appoptics_apm/config.rb +16 -5
- data/lib/appoptics_apm/frameworks/grape.rb +3 -2
- data/lib/appoptics_apm/frameworks/padrino.rb +7 -37
- data/lib/appoptics_apm/frameworks/rails.rb +0 -1
- data/lib/appoptics_apm/frameworks/rails/inst/action_controller.rb +1 -1
- data/lib/appoptics_apm/frameworks/rails/inst/action_view.rb +12 -25
- data/lib/appoptics_apm/frameworks/rails/inst/active_record.rb +1 -1
- data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/utils.rb +1 -1
- data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/utils5x.rb +1 -1
- data/lib/appoptics_apm/frameworks/sinatra.rb +4 -33
- data/lib/appoptics_apm/inst/curb.rb +6 -6
- data/lib/appoptics_apm/inst/faraday.rb +16 -4
- data/lib/appoptics_apm/inst/graphql.rb +240 -0
- data/lib/appoptics_apm/inst/grpc_client.rb +1 -1
- data/lib/appoptics_apm/inst/rack.rb +11 -11
- data/lib/appoptics_apm/oboe_init_options.rb +13 -3
- data/lib/appoptics_apm/sdk/custom_metrics.rb +2 -0
- data/lib/appoptics_apm/sdk/logging.rb +1 -1
- data/lib/appoptics_apm/sdk/tracing.rb +120 -2
- data/lib/appoptics_apm/support/transaction_metrics.rb +2 -1
- data/lib/appoptics_apm/support/transaction_settings.rb +40 -15
- data/lib/appoptics_apm/support/x_trace_options.rb +110 -0
- data/lib/appoptics_apm/version.rb +2 -2
- data/lib/appoptics_apm/xtrace.rb +7 -7
- data/lib/oboe_metal.rb +1 -1
- data/lib/rails/generators/appoptics_apm/install_generator.rb +23 -21
- data/lib/rails/generators/appoptics_apm/templates/appoptics_apm_initializer.rb +68 -30
- metadata +40 -21
- data/Rakefile +0 -234
- data/build_gem.sh +0 -15
- data/build_gem_upload_to_packagecloud.sh +0 -15
- data/lib/appoptics_apm/api/profiling.rb +0 -203
- data/lib/appoptics_apm/frameworks/rails/inst/action_controller3.rb +0 -55
- data/lib/appoptics_apm/frameworks/rails/inst/action_view_30.rb +0 -50
- data/lib/appoptics_apm/legacy_method_profiling.rb +0 -90
- data/lib/appoptics_apm/method_profiling.rb +0 -33
- data/lib/oboe/README +0 -2
- data/lib/oboe/backward_compatibility.rb +0 -80
- data/lib/oboe/inst/rack.rb +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 26c9d31f4b5d680bd14d2cc041c337ea687f87e85c909fb6133d92e3f8292105
|
|
4
|
+
data.tar.gz: 1694af39aa2e9c8105a7d1b4fa590af16a5a86ae2b41bc9998531f2b16d192af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3257648c80a8da542d0e3f99a49c53b4ea6f3c2dd3ef37d6e6ebc1384f53054b3883b41f6ae43880f310a5ff4b49c37eaa67450a2d9818946e248180c6834222
|
|
7
|
+
data.tar.gz: ba4d2a1e71ab6805d73a038bbd1c6593889249e5ebdac1005cbb9df6befad04ef728bcfc67780db2352a10a43c694e991314530452dca57d17297f75c30c3d69
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Style/StringLiterals:
|
|
2
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
|
3
|
+
StyleGuide: '#consistent-string-literals'
|
|
4
|
+
Enabled: false
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
Layout/LineLength:
|
|
7
|
+
Description: 'Limit lines to 80 characters.'
|
|
8
|
+
Enabled: false
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
Naming/VariableNumber:
|
|
11
|
+
Description: 'Use the configured style when numbering variables.'
|
|
12
|
+
Enabled: false
|
|
13
|
+
|
|
14
|
+
Style/FrozenStringLiteralComment:
|
|
15
|
+
Description: >-
|
|
16
|
+
Add the frozen_string_literal comment to the top of files
|
|
17
|
+
to help transition to frozen string literals by default.
|
|
18
|
+
Enabled: false
|
|
19
|
+
|
|
20
|
+
Style/Documentation:
|
|
21
|
+
Description: 'Document classes and non-namespace modules.'
|
|
22
|
+
Enabled: false
|
|
23
|
+
|
|
24
|
+
Style/WordArray:
|
|
25
|
+
EnforcedStyle: brackets
|
|
26
|
+
|
|
27
|
+
Metrics/BlockLength:
|
|
28
|
+
Exclude:
|
|
29
|
+
- test/*/*_test.rb
|
data/.travis.yml
CHANGED
|
@@ -8,9 +8,9 @@ cache:
|
|
|
8
8
|
env:
|
|
9
9
|
- DBTYPE=postgresql
|
|
10
10
|
- DBTYPE=mysql2
|
|
11
|
-
- DBTYPE=mysql
|
|
12
11
|
|
|
13
12
|
rvm:
|
|
13
|
+
- 2.7.0
|
|
14
14
|
- 2.6.4
|
|
15
15
|
- 2.5.5
|
|
16
16
|
- 2.4.5
|
|
@@ -33,38 +33,14 @@ matrix:
|
|
|
33
33
|
exclude:
|
|
34
34
|
- rvm: ruby-head
|
|
35
35
|
gemfile: gemfiles/rails42.gemfile
|
|
36
|
+
- rvm: 2.7.0
|
|
37
|
+
gemfile: gemfiles/rails42.gemfile
|
|
36
38
|
- rvm: 2.6.4
|
|
37
39
|
gemfile: gemfiles/rails42.gemfile
|
|
38
40
|
- rvm: 2.4.5
|
|
39
41
|
gemfile: gemfiles/rails60.gemfile
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
env: DBTYPE=mysql
|
|
43
|
-
- rvm: 2.5.5
|
|
44
|
-
env: DBTYPE=mysql
|
|
45
|
-
- rvm: 2.4.5
|
|
46
|
-
env: DBTYPE=mysql
|
|
47
|
-
- rvm: ruby-head
|
|
48
|
-
env: DBTYPE=mysql
|
|
49
|
-
|
|
50
|
-
- gemfile: gemfiles/unit.gemfile
|
|
51
|
-
env: DBTYPE=mysql
|
|
52
|
-
- gemfile: gemfiles/noop.gemfile
|
|
53
|
-
env: DBTYPE=mysql
|
|
54
|
-
- gemfile: gemfiles/libraries.gemfile
|
|
55
|
-
env: DBTYPE=mysql
|
|
56
|
-
- gemfile: gemfiles/instrumentation_mocked.gemfile
|
|
57
|
-
env: DBTYPE=mysql
|
|
58
|
-
- gemfile: gemfiles/instrumentation_mocked_oldgems.gemfile
|
|
59
|
-
env: DBTYPE=mysql
|
|
60
|
-
- gemfile: gemfiles/frameworks.gemfile
|
|
61
|
-
env: DBTYPE=mysql
|
|
62
|
-
- gemfile: gemfiles/rails52.gemfile
|
|
63
|
-
env: DBTYPE=mysql
|
|
64
|
-
- gemfile: gemfiles/rails60.gemfile
|
|
65
|
-
env: DBTYPE=mysql
|
|
66
|
-
- gemfile: gemfiles/delayed_job.gemfile
|
|
67
|
-
env: DBTYPE=mysql
|
|
42
|
+
- rvm: 2.4.5 # excluding because of new sprockets version (4.0.0)
|
|
43
|
+
gemfile: gemfiles/rails52.gemfile
|
|
68
44
|
|
|
69
45
|
- gemfile: gemfiles/unit.gemfile
|
|
70
46
|
env: DBTYPE=mysql2
|
|
@@ -83,7 +59,8 @@ matrix:
|
|
|
83
59
|
allow_failures:
|
|
84
60
|
- rvm: ruby-head
|
|
85
61
|
|
|
86
|
-
# FIXME:
|
|
62
|
+
# FIXME: No cassandra tests for now
|
|
63
|
+
# ____ Figure out if this is still an issue when reviving cassandra
|
|
87
64
|
# Attempt Travis/Cassandra fix re: https://github.com/travis-ci/travis-ci/issues/1484
|
|
88
65
|
# Updated Cassandra: https://github.com/travis-ci/travis-ci/issues/1650
|
|
89
66
|
|
|
@@ -98,9 +75,17 @@ matrix:
|
|
|
98
75
|
# - sudo service cassandra start
|
|
99
76
|
|
|
100
77
|
install:
|
|
101
|
-
- curl -LO http://kent.dl.sourceforge.net/project/swig/swig/swig-3.0.
|
|
102
|
-
-
|
|
103
|
-
-
|
|
78
|
+
# - curl -LO http://kent.dl.sourceforge.net/project/swig/swig/swig-3.0.12/swig-3.0.12.tar.gz
|
|
79
|
+
# - curl -LO http://kent.dl.sourceforge.net/project/swig/swig/swig-4.0.1/swig-4.0.1.tar.gz
|
|
80
|
+
# - tar xzf swig-4.0.1.tar.gz
|
|
81
|
+
# - pushd swig-4.0.1
|
|
82
|
+
# - ./configure && make && sudo make install
|
|
83
|
+
# - popd
|
|
84
|
+
|
|
85
|
+
# use swig from git, it is the only one that works with Ruby 2.7 for now
|
|
86
|
+
- git clone https://github.com/swig/swig.git
|
|
87
|
+
- pushd swig
|
|
88
|
+
- ./autogen.sh
|
|
104
89
|
- ./configure && make && sudo make install
|
|
105
90
|
- popd
|
|
106
91
|
|
|
@@ -111,15 +96,17 @@ before_script:
|
|
|
111
96
|
- export APPOPTICS_REPORTER_FILE_SINGLE=false
|
|
112
97
|
- export APPOPTICS_TOKEN_BUCKET_CAPACITY=1000
|
|
113
98
|
- export APPOPTICS_TOKEN_BUCKET_RATE=1000
|
|
114
|
-
- export
|
|
115
|
-
|
|
116
|
-
- bundle
|
|
99
|
+
- export APPOPTICS_FROM_S3=true
|
|
100
|
+
|
|
101
|
+
# - bundle update --jobs=3 --retry=3
|
|
102
|
+
- ./.travis/bundle.sh
|
|
103
|
+
- bundle exec rake distclean fetch compile
|
|
117
104
|
- psql -c 'create database travis_ci_test;' -U postgres
|
|
118
105
|
- mysql -e 'create database travis_ci_test;'
|
|
119
106
|
- redis-server --requirepass secret_pass &
|
|
120
107
|
- sleep 10
|
|
121
108
|
|
|
122
|
-
script: "
|
|
109
|
+
script: "bundle exec rake test"
|
|
123
110
|
|
|
124
111
|
services:
|
|
125
112
|
- mongodb
|
data/.travis/bundle.sh
ADDED
data/CONFIG.md
CHANGED
|
@@ -17,7 +17,7 @@ Name | Description | Default
|
|
|
17
17
|
|
|
18
18
|
Name | Description | Default
|
|
19
19
|
---- | ----------- | -------
|
|
20
|
-
`APPOPTICS_GEM_TEST` | puts the gem in test mode
|
|
20
|
+
`APPOPTICS_GEM_TEST` | puts the gem in test mode to avoid restarting certain background services used in testing. `false`
|
|
21
21
|
`DBTYPE` | For tests on Ruby on Rails, specifies the database type to test against. `postgres`, `mysql` and `mysql2` are valid options. | `postgres`
|
|
22
22
|
`APPOPTICS_CASSANDRA_SERVER` | specifies the Cassandra server to test against. | `127.0.0.1:9160`
|
|
23
23
|
`APPOPTICS_MONGO_SERVER` | specifies the Mongo server to test against. | `127.0.0.1:27017`
|
data/Gemfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
|
+
gem 'rake'
|
|
2
3
|
|
|
3
4
|
group :development, :test do
|
|
4
|
-
gem 'rake'
|
|
5
5
|
gem 'minitest'
|
|
6
6
|
gem 'minitest-reporters', '< 1.0.18'
|
|
7
7
|
gem 'minitest-debugger', :require => false
|
|
@@ -18,12 +18,12 @@ group :development, :test do
|
|
|
18
18
|
gem 'byebug'
|
|
19
19
|
gem 'get_process_mem'
|
|
20
20
|
gem 'memory_profiler'
|
|
21
|
-
end
|
|
22
21
|
|
|
23
|
-
if defined?(JRUBY_VERSION)
|
|
24
|
-
|
|
25
|
-
else
|
|
26
|
-
|
|
22
|
+
if defined?(JRUBY_VERSION)
|
|
23
|
+
gem 'sinatra', :require => false
|
|
24
|
+
else
|
|
25
|
+
gem 'sinatra'
|
|
26
|
+
end
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
gemspec
|
data/appoptics_apm.gemspec
CHANGED
|
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
|
6
6
|
s.version = AppOpticsAPM::Version::STRING
|
|
7
7
|
s.date = Time.now.strftime('%Y-%m-%d')
|
|
8
8
|
|
|
9
|
-
s.license = "Librato Open License, Version 1.0"
|
|
9
|
+
s.license = "Librato Open License, Version 1.0, https://bit.ly/2Kmm0mN"
|
|
10
10
|
|
|
11
11
|
s.authors = ["Maia Engeli", "Peter Giacomo Lombardo", "Spiros Eliopoulos"]
|
|
12
12
|
s.email = %q{support@appoptics.com}
|
|
@@ -32,6 +32,9 @@ Automatic tracing and metrics for Ruby applications. Get started at appoptics.co
|
|
|
32
32
|
'ext/oboe_metal/src/bson/bson.h',
|
|
33
33
|
'ext/oboe_metal/src/bson/platform_hacks.h',
|
|
34
34
|
'ext/oboe_metal/src/VERSION']
|
|
35
|
+
s.files -= ['build_gem.sh',
|
|
36
|
+
'build_gem_upload_to_packagecloud.sh',
|
|
37
|
+
'Rakefile']
|
|
35
38
|
|
|
36
39
|
# TODO this is commented out util we can actually provide gems for different platforms
|
|
37
40
|
# it will create a gem that goes into noop on Darwin and other unsupported platforms
|
|
@@ -51,9 +54,10 @@ Automatic tracing and metrics for Ruby applications. Get started at appoptics.co
|
|
|
51
54
|
unless defined?(JRUBY_VERSION)
|
|
52
55
|
s.add_development_dependency('byebug', '>= 8.0.0')
|
|
53
56
|
s.add_development_dependency('minitest-hooks', '>= 1.5.0')
|
|
57
|
+
s.add_development_dependency('minitest-focus', '>=1.1.2')
|
|
54
58
|
s.add_development_dependency('benchmark-ips', '>= 2.7.2')
|
|
55
59
|
end
|
|
56
60
|
|
|
57
|
-
s.required_ruby_version = '>= 2.
|
|
61
|
+
s.required_ruby_version = '>= 2.4.0'
|
|
58
62
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
|
59
63
|
end
|
data/ext/oboe_metal/extconf.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
# Copyright (c) 2016 SolarWinds, LLC.
|
|
2
4
|
# All rights reserved.
|
|
3
5
|
|
|
@@ -20,7 +22,7 @@ ao_include = File.join(ext_dir, 'src')
|
|
|
20
22
|
version = File.read(File.join(ao_include, 'VERSION')).chomp
|
|
21
23
|
if ENV['APPOPTICS_FROM_S3'].to_s.downcase == 'true'
|
|
22
24
|
ao_path = File.join('https://s3-us-west-2.amazonaws.com/rc-files-t2/c-lib/', version)
|
|
23
|
-
puts
|
|
25
|
+
puts 'Fetching c-lib from S3'
|
|
24
26
|
else
|
|
25
27
|
ao_path = File.join('https://files.appoptics.com/c-lib', version)
|
|
26
28
|
end
|
|
@@ -29,7 +31,7 @@ ao_arch = 'x86_64'
|
|
|
29
31
|
if File.exist?('/etc/alpine-release')
|
|
30
32
|
version = open('/etc/alpine-release').read.chomp
|
|
31
33
|
ao_arch =
|
|
32
|
-
if Gem::Version.new(version) <
|
|
34
|
+
if Gem::Version.new(version) < Gem::Version.new('3.9')
|
|
33
35
|
'alpine-libressl-x86_64'
|
|
34
36
|
else # openssl
|
|
35
37
|
'alpine-x86_64'
|
|
@@ -46,6 +48,8 @@ success = false
|
|
|
46
48
|
while retries > 0
|
|
47
49
|
begin
|
|
48
50
|
# download
|
|
51
|
+
# TODO warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open
|
|
52
|
+
# ____ figure out if URI.open is supported in older rubies
|
|
49
53
|
download = open(ao_item, 'rb')
|
|
50
54
|
IO.copy_stream(download, clib)
|
|
51
55
|
|
data/ext/oboe_metal/noop/noop.c
CHANGED
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
/* ruby calls this to load the extension */
|
|
4
4
|
void Init_oboe_noop(void) {
|
|
5
5
|
/* assume we haven't yet defined Hola */
|
|
6
|
-
VALUE klass = rb_define_class("OboeNoop", rb_cObject);
|
|
6
|
+
// VALUE klass = rb_define_class("OboeNoop", rb_cObject);
|
|
7
|
+
rb_define_class("OboeNoop", rb_cObject);
|
|
7
8
|
}
|
data/ext/oboe_metal/src/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
7.1.1
|
data/lib/appoptics_apm.rb
CHANGED
|
@@ -43,12 +43,11 @@ begin
|
|
|
43
43
|
|
|
44
44
|
# appoptics_apm/loading can set AppOpticsAPM.loaded = false if the service key is not working
|
|
45
45
|
require 'appoptics_apm/loading'
|
|
46
|
-
require 'appoptics_apm/legacy_method_profiling'
|
|
47
|
-
require 'appoptics_apm/method_profiling'
|
|
48
46
|
|
|
49
47
|
if AppOpticsAPM.loaded
|
|
50
48
|
require 'appoptics_apm/instrumentation'
|
|
51
49
|
require 'appoptics_apm/support/transaction_metrics'
|
|
50
|
+
require 'appoptics_apm/support/x_trace_options'
|
|
52
51
|
|
|
53
52
|
# Frameworks
|
|
54
53
|
require 'appoptics_apm/frameworks/rails'
|
|
@@ -68,7 +67,6 @@ begin
|
|
|
68
67
|
# Load Ruby module last. If there is no framework detected,
|
|
69
68
|
# it will load all of the Ruby instrumentation
|
|
70
69
|
require 'appoptics_apm/ruby'
|
|
71
|
-
require 'oboe/backward_compatibility'
|
|
72
70
|
|
|
73
71
|
require 'appoptics_apm/test' if ENV['APPOPTICS_GEM_TEST']
|
|
74
72
|
rescue => e
|
data/lib/appoptics_apm/api.rb
CHANGED
|
@@ -55,7 +55,7 @@ module AppOpticsAPM
|
|
|
55
55
|
# ==== Arguments
|
|
56
56
|
#
|
|
57
57
|
# * +layer+ - The layer the reported event belongs to
|
|
58
|
-
# * +exception+ - The exception to report
|
|
58
|
+
# * +exception+ - The exception to report, responds to :message and :backtrace(optional)
|
|
59
59
|
# * +opts+ - Custom params if you want to log extra information
|
|
60
60
|
#
|
|
61
61
|
# ==== Example
|
|
@@ -80,7 +80,10 @@ module AppOpticsAPM
|
|
|
80
80
|
opts.merge!(:Spec => 'error',
|
|
81
81
|
:ErrorClass => exception.class.name,
|
|
82
82
|
:ErrorMsg => exception.message)
|
|
83
|
-
|
|
83
|
+
|
|
84
|
+
if exception.respond_to?(:backtrace) && exception.backtrace
|
|
85
|
+
opts.merge!(:Backtrace => exception.backtrace.join("\r\n"))
|
|
86
|
+
end
|
|
84
87
|
|
|
85
88
|
exception.instance_variable_set(:@exn_logged, true)
|
|
86
89
|
log(layer, :error, opts)
|
|
@@ -205,6 +208,7 @@ module AppOpticsAPM
|
|
|
205
208
|
def log_info(layer, opts = {})
|
|
206
209
|
return AppOpticsAPM::Context.toString unless AppOpticsAPM.tracing?
|
|
207
210
|
|
|
211
|
+
opts[:Spec] = 'info'
|
|
208
212
|
log_event(layer, :info, AppOpticsAPM::Context.createEvent, opts)
|
|
209
213
|
end
|
|
210
214
|
|
|
@@ -48,6 +48,10 @@ module AppOpticsAPM
|
|
|
48
48
|
[start_trace_with_target(span, xtrace, target, opts) { yield }, target['X-Trace']]
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
def profile_method(*args)
|
|
52
|
+
AppOpticsAPM.logger.warn("DEPRECATED: AppOpticsAPM::API.profile_method is deprecated. Use: AppOpticsAPM::SDK::trace_method")
|
|
53
|
+
AppOpticsAPM::SDK.trace_method(*args)
|
|
54
|
+
end
|
|
51
55
|
end
|
|
52
56
|
end
|
|
53
57
|
end
|
|
@@ -24,16 +24,14 @@ module AppOpticsAPM
|
|
|
24
24
|
|
|
25
25
|
# Internal: Get the current backtrace.
|
|
26
26
|
#
|
|
27
|
-
#
|
|
28
|
-
#
|
|
29
|
-
# made.
|
|
27
|
+
# from - int, from position in array of backtraces
|
|
28
|
+
# to - int, end position in array of backtraces, can be negative to count from the end
|
|
30
29
|
#
|
|
31
30
|
# Returns a string with each frame of the backtrace separated by '\r\n'.
|
|
32
31
|
#
|
|
33
|
-
def backtrace(
|
|
32
|
+
def backtrace(from = 0, to = -1)
|
|
34
33
|
bt = Kernel.caller
|
|
35
|
-
bt.
|
|
36
|
-
trim_backtrace(bt).join("\r\n")
|
|
34
|
+
trim_backtrace(bt[from..to]).join("\r\n")
|
|
37
35
|
end
|
|
38
36
|
|
|
39
37
|
# Internal: Trim a backtrace to a manageable size
|
|
@@ -115,7 +113,7 @@ module AppOpticsAPM
|
|
|
115
113
|
end
|
|
116
114
|
|
|
117
115
|
def xtrace_v2?(xtr)
|
|
118
|
-
|
|
116
|
+
xtr && xtr.start_with?('2B')
|
|
119
117
|
end
|
|
120
118
|
end
|
|
121
119
|
end
|
data/lib/appoptics_apm/config.rb
CHANGED
|
@@ -16,13 +16,20 @@ module AppOpticsAPM
|
|
|
16
16
|
@@instrumentation = [:action_controller, :action_controller_api, :action_view,
|
|
17
17
|
:active_record, :bunnyclient, :bunnyconsumer, :cassandra, :curb,
|
|
18
18
|
:dalli, :delayed_jobclient, :delayed_jobworker,
|
|
19
|
-
:
|
|
19
|
+
:excon, :faraday, :graphql, :grpc_client, :grpc_server, :grape,
|
|
20
20
|
:httpclient, :nethttp, :memcached, :mongo, :moped, :padrino, :rack, :redis,
|
|
21
21
|
:resqueclient, :resqueworker, :rest_client,
|
|
22
22
|
:sequel, :sidekiqclient, :sidekiqworker, :sinatra, :typhoeus]
|
|
23
23
|
|
|
24
|
+
# ignore configs for instrumentations we don't have anymore
|
|
25
|
+
# can't remove because the config may still be present in configs created
|
|
26
|
+
# with previous gem versions
|
|
27
|
+
@@ignore = [:em_http_request]
|
|
28
|
+
|
|
24
29
|
# Subgrouping of instrumentation
|
|
25
|
-
@@http_clients = [:curb, :excon,
|
|
30
|
+
@@http_clients = [:curb, :excon,
|
|
31
|
+
# :em_http_request,
|
|
32
|
+
:faraday, :httpclient, :nethttp, :rest_client, :typhoeus]
|
|
26
33
|
|
|
27
34
|
##
|
|
28
35
|
# load_config_file
|
|
@@ -136,7 +143,7 @@ module AppOpticsAPM
|
|
|
136
143
|
#
|
|
137
144
|
# rubocop:disable Metrics/AbcSize
|
|
138
145
|
def self.initialize(_data = {})
|
|
139
|
-
@@instrumentation.each { |k| @@config[k] = {} }
|
|
146
|
+
(@@instrumentation+@@ignore).each { |k| @@config[k] = {} }
|
|
140
147
|
@@config[:transaction_name] = {}
|
|
141
148
|
|
|
142
149
|
# Always load the template, it has all the keys and defaults defined,
|
|
@@ -240,11 +247,15 @@ module AppOpticsAPM
|
|
|
240
247
|
end
|
|
241
248
|
|
|
242
249
|
elsif key == :tracing_mode
|
|
243
|
-
# CAN'T DO
|
|
250
|
+
# CAN'T DO `set_tracing_mode` ANYMORE, ALL TRACING COMMUNICATION TO OBOE
|
|
244
251
|
# IS NOW HANDLED BY TransactionSettings
|
|
245
252
|
# AppOpticsAPM.set_tracing_mode(value.to_sym) if AppOpticsAPM.loaded
|
|
246
253
|
|
|
247
|
-
|
|
254
|
+
# Make sure that the mode is stored as a symbol
|
|
255
|
+
@@config[key.to_sym] = value.to_sym
|
|
256
|
+
|
|
257
|
+
elsif key == :trigger_tracing_mode
|
|
258
|
+
# Make sure that the mode is stored as a symbol
|
|
248
259
|
@@config[key.to_sym] = value.to_sym
|
|
249
260
|
end
|
|
250
261
|
end
|