appoptics_apm 4.0.5 → 4.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff856df7c5459eb39bfa7b9d5a248c44f74a6d3e
4
- data.tar.gz: e41c9199c097afcae143d271016566f2fb2077f2
3
+ metadata.gz: 3b94b0d15e2fc4895a343bb84ef881116864407e
4
+ data.tar.gz: 2225955904b5ce063dcddb123014d1deb2f923a3
5
5
  SHA512:
6
- metadata.gz: ce3d4658d0bb2f448561fa6aa46f38a506eeabb6eb07681c726b2de3b1b63c5976be1b72851c598c7dcf975a53a85bc9a600267cf569fb1a834ee7ffac0f401e
7
- data.tar.gz: 374174feff92a2d0accbd4ce04548f580814d5d3246d390c67d694703474f91da860517cab0c1ba777c2ff4b499c00fcb9556fb0bbee4d2d02a7d50d32546ce6
6
+ metadata.gz: fafaacdc392b750d72c273a2295614ea808cc58da3048871e75d2337ea911381d632cd1c706291f01abe54e6a7d81c89e34a522475b6c765221669c7c46c1db5
7
+ data.tar.gz: 491ce4b517259a6bddb40513c158c11998d5e8556c3a8668317b6400725f6456f713216f70ec54e004ecf2c417498f2b84222144132064b6d5b0e762c4d68765
data/.travis.yml CHANGED
@@ -20,12 +20,49 @@ gemfile:
20
20
  - gemfiles/frameworks.gemfile
21
21
  - gemfiles/rails32.gemfile
22
22
  - gemfiles/rails42.gemfile
23
- - gemfiles/rails50.gemfile
24
23
  - gemfiles/rails51.gemfile
25
24
  - gemfiles/delayed_job.gemfile
26
25
 
26
+ env:
27
+ - DBTYPE=mysql
28
+ - DBTYPE=mysql2
29
+ - DBTYPE=postgresql
30
+
27
31
  matrix:
28
32
  exclude:
33
+ - rvm: 2.5.0
34
+ env: DBTYPE=mysql
35
+ - rvm: 2.4.3
36
+ env: DBTYPE=mysql
37
+
38
+ - gemfile: gemfiles/noop.gemfile
39
+ env: DBTYPE=mysql
40
+ - gemfile: gemfiles/libraries.gemfile
41
+ env: DBTYPE=mysql
42
+ - gemfile: gemfiles/instrumentation_mocked.gemfile
43
+ env: DBTYPE=mysql
44
+ - gemfile: gemfiles/instrumentation_mocked_oldgems.gemfile
45
+ env: DBTYPE=mysql
46
+ - gemfile: gemfiles/frameworks.gemfile
47
+ env: DBTYPE=mysql
48
+ - gemfile: gemfiles/rails51.gemfile
49
+ env: DBTYPE=mysql
50
+ - gemfile: gemfiles/delayed_job.gemfile
51
+ env: DBTYPE=mysql
52
+
53
+ - gemfile: gemfiles/noop.gemfile
54
+ env: DBTYPE=mysql2
55
+ - gemfile: gemfiles/libraries.gemfile
56
+ env: DBTYPE=mysql2
57
+ - gemfile: gemfiles/instrumentation_mocked.gemfile
58
+ env: DBTYPE=mysql2
59
+ - gemfile: gemfiles/instrumentation_mocked_oldgems.gemfile
60
+ env: DBTYPE=mysql2
61
+ - gemfile: gemfiles/frameworks.gemfile
62
+ env: DBTYPE=mysql2
63
+ - gemfile: gemfiles/delayed_job.gemfile
64
+ env: DBTYPE=mysql2
65
+
29
66
  # Rails 3.2 is not compatible with Ruby >= '2.4'
30
67
  - rvm: 2.5.0
31
68
  gemfile: gemfiles/rails32.gemfile
data/.yardopts ADDED
@@ -0,0 +1,5 @@
1
+ --no-private
2
+ --readme yardoc_frontpage.md
3
+ lib/appoptics_apm/api/logging.rb
4
+ lib/appoptics_apm/api/profiling.rb
5
+ lib/appoptics_apm/api/tracing.rb
data/Dockerfile_test CHANGED
@@ -31,10 +31,11 @@ RUN git clone https://github.com/rbenv/rbenv.git ~/.rbenv \
31
31
  && echo 'bundler' > ~/.rbenv/default-gems
32
32
 
33
33
  # install rubies to build our gem against
34
- RUN . ~/.profile \
34
+ RUN . ~/.profile \
35
35
  && rbenv install 1.9.3-p551 \
36
- && rbenv install 2.3.1 \
37
- && rbenv install 2.4.1
36
+ && rbenv install 2.3.6 \
37
+ && rbenv install 2.4.3 \
38
+ && rbenv install 2.5.0
38
39
  # && rbenv install jruby-9.0.5.0
39
40
 
40
41
  # install swig 3.0.8
data/Rakefile CHANGED
@@ -99,24 +99,25 @@ task :compile do
99
99
  if !defined?(JRUBY_VERSION)
100
100
  puts "== Building the c extension against Ruby #{RUBY_VERSION}"
101
101
 
102
- pwd = Dir.pwd
103
- ext_dir = File.expand_path('ext/oboe_metal')
104
- symlink = File.expand_path('lib/oboe_metal.so')
105
- so_file = File.expand_path('ext/oboe_metal/oboe_metal.so')
102
+ pwd = Dir.pwd
103
+ ext_dir = File.expand_path('ext/oboe_metal')
104
+ final_so = File.expand_path('lib/oboe_metal.so')
105
+ so_file = File.expand_path('ext/oboe_metal/oboe_metal.so')
106
106
 
107
107
  Dir.chdir ext_dir
108
+ ENV['FROM_S3'] = 'TRUE'
108
109
  cmd = [Gem.ruby, 'extconf.rb']
109
110
  sh cmd.join(' ')
110
111
  sh '/usr/bin/env make'
111
112
 
112
- File.delete symlink if File.exist? symlink
113
+ File.delete(final_so) if File.exist?(final_so)
113
114
 
114
- if File.exist? so_file
115
- File.symlink so_file, symlink
116
- Dir.chdir pwd
117
- puts "== Extension built and symlink'd to #{symlink}"
115
+ if File.exist?(so_file)
116
+ FileUtils.mv(so_file, final_so)
117
+ Dir.chdir(pwd)
118
+ puts "== Extension built and moved to #{final_so}"
118
119
  else
119
- Dir.chdir pwd
120
+ Dir.chdir(pwd)
120
121
  puts '!! Extension failed to build (see above). Have the required binary and header files been fetched?'
121
122
  puts '!! Try the tasks in this order: clean > fetchsource > compile.'
122
123
  end
@@ -16,26 +16,33 @@ jruby = defined?(JRUBY_VERSION) ? true : false
16
16
  ao_lib_dir = File.join(ext_dir, 'lib')
17
17
  ao_include = File.join(ext_dir, 'src')
18
18
 
19
- # Download the appropriate liboboe from files.appoptics.com
20
- ao_path = File.join('https://files.appoptics.com/c-lib', File.read(File.join(ao_include, 'VERSION')).chomp)
19
+ # Download the appropriate liboboe from S3(via rake for testing) or files.appoptics.com (production)
20
+ version = File.read(File.join(ao_include, 'VERSION')).chomp
21
+ if ENV['FROM_S3']
22
+ ao_path = File.join('https://s3-us-west-2.amazonaws.com/rc-files-t2/c-lib/', version)
23
+ puts "Fetching c-lib from S3"
24
+ else
25
+ ao_path = File.join('https://files.appoptics.com/c-lib', version)
26
+ end
21
27
  ao_arch = `ldd --version 2>&1` =~ /musl/ ? 'alpine-x86_64' : 'x86_64'
22
28
  ao_clib = "liboboe-1.0-#{ao_arch}.so.0.0.0"
23
29
  ao_item = File.join(ao_path, ao_clib)
24
30
  ao_checksum_item = "#{ao_item}.sha256"
25
- target = File.join(ao_lib_dir, ao_clib)
31
+ clib = File.join(ao_lib_dir, ao_clib)
26
32
 
27
33
  retries = 3
34
+ success = false
28
35
  while retries > 0
29
36
  begin
30
37
  # download
31
38
  download = open(ao_item, 'rb')
32
- IO.copy_stream(download, target)
39
+ IO.copy_stream(download, clib)
33
40
 
34
41
  checksum = open(ao_checksum_item, 'r').read.chomp
35
- target_checksum = Digest::SHA256.file(target).hexdigest
42
+ clib_checksum = Digest::SHA256.file(clib).hexdigest
36
43
 
37
44
  # verify_checksum
38
- if target_checksum != checksum
45
+ if clib_checksum != checksum
39
46
  $stderr.puts '== ERROR ================================================================='
40
47
  $stderr.puts 'Checksum Verification failed for the c-extension of the appoptics_apm gem.'
41
48
  $stderr.puts 'appoptics_apm will not instrument the code. No tracing will occur.'
@@ -48,7 +55,7 @@ while retries > 0
48
55
  retries = 0
49
56
  end
50
57
  rescue => e
51
- File.write(target, '')
58
+ File.write(clib, '')
52
59
  retries -= 1
53
60
  if retries == 0
54
61
  $stderr.puts '== ERROR =========================================================='
@@ -63,11 +70,13 @@ while retries > 0
63
70
  end
64
71
 
65
72
  if success
66
- # Create symlinks for the AppOpticsAPM library
67
- File.symlink(target, File.join(ao_lib_dir, 'liboboe.so'))
68
- File.symlink(target, File.join(ao_lib_dir, 'liboboe-1.0.so.0'))
73
+ # Create relative symlinks for the AppOpticsAPM library
74
+ Dir.chdir(ao_lib_dir) do
75
+ File.symlink(ao_clib, 'liboboe.so')
76
+ File.symlink(ao_clib, 'liboboe-1.0.so.0')
77
+ end
69
78
 
70
- dir_config('oboe', ao_include, ao_lib_dir)
79
+ dir_config('oboe', 'src', 'lib')
71
80
 
72
81
  if jruby || ENV.key?('APPOPTICS_URL')
73
82
  # Build the noop extension under JRuby and Heroku.
@@ -84,12 +93,8 @@ if success
84
93
  $CFLAGS << " #{ENV['CFLAGS']}"
85
94
  $CPPFLAGS << " #{ENV['CPPFLAGS']}"
86
95
  $LIBS << " #{ENV['LIBS']}"
87
- $LDFLAGS << " #{ENV['LDFLAGS']} -Wl,-rpath=#{ao_lib_dir}"
96
+ $LDFLAGS << " #{ENV['LDFLAGS']} '-Wl,-rpath=$$ORIGIN/../ext/oboe_metal/lib'"
88
97
 
89
- if RUBY_VERSION < '1.9'
90
- cpp_command('g++')
91
- $CPPFLAGS << '-I./src/'
92
- end
93
98
  create_makefile('oboe_metal', 'src')
94
99
 
95
100
  else
@@ -305,6 +305,7 @@ module AppOpticsAPM
305
305
 
306
306
  ##
307
307
  #:nodoc:
308
+ # @private
308
309
  # Internal: Report an event.
309
310
  #
310
311
  # ==== Arguments
@@ -8,7 +8,7 @@ module AppOpticsAPM
8
8
  module Version
9
9
  MAJOR = 4
10
10
  MINOR = 0
11
- PATCH = 5
11
+ PATCH = 6
12
12
 
13
13
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
14
14
  end
data/ruby_setup.sh CHANGED
@@ -7,8 +7,14 @@
7
7
 
8
8
  cd /code/ruby-appoptics_apm/
9
9
 
10
- rbenv local $1
10
+ rbenv global $1
11
+
12
+ rm gemfiles/*.lock
13
+
14
+ export RVM_TEST=$1
15
+ export BUNDLE_GEMFILE=$2
11
16
  bundle install
17
+
12
18
  bundle update
13
19
  bundle exec rake fetch_ext_deps
14
20
  bundle exec rake clean
@@ -26,15 +32,11 @@ service memcached start
26
32
  # mysql add table for tests
27
33
  mysql -e 'create database travis_ci_test;' -h$MYSQL_HOST -p$MYSQL_ROOT_PASSWORD
28
34
 
29
- bundle install --gemfile $2
30
-
31
- export RVM_TEST=$1
32
- export BUNDLE_GEMFILE=$2
33
-
34
35
  # replicate stdout of tests to file in local log directory
35
36
  export TEST_RUNS_TO_FILE=true
37
+ export $3
36
38
 
37
- if [ "$3" == "true" ]; then
39
+ if [ "$4" == "true" ]; then
38
40
  /bin/bash
39
41
  # now run tests either with:
40
42
  # bundle exec rake test TEST=test/instrumentation/curb_test.rb
@@ -0,0 +1,26 @@
1
+ # Welcome to the AppOpticsAPM Ruby Gem
2
+
3
+
4
+ The appoptics_apm gem provides automatic tracing and metrics for Ruby applications.
5
+ It requires an AppOptics account: sign up for a free trial at https://www.appoptics.com.
6
+
7
+ ![ruby_trace](https://docs.appoptics.com/_images/ruby_trace.png)
8
+
9
+ ## Documentation
10
+ https://docs.appoptics.com/kb/apm_tracing/ruby
11
+
12
+ ## Getting started
13
+ The gem instruments the ruby language and ruby on rails frameworks. It is hosted on RubyGems, making installation as
14
+ simple as: `gem install appoptics_apm`.
15
+
16
+ Our ruby extension gets detailed insights out-of-the-box without any code modification.
17
+ For a list of instrumented gems and components see https://docs.appoptics.com/kb/apm_tracing/ruby/support-matrix
18
+
19
+ Detailled installation instructions for Ruby and different frameworks like Rails, Sinatra, Padrino, and Grape can be
20
+ found here https://docs.appoptics.com/kb/apm_tracing/ruby/install
21
+
22
+ ## Custom instrumentation
23
+ If you have code or a library that is not on the platform support list, use our SDK (as documented here) to customize.
24
+
25
+
26
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appoptics_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 4.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maia Engeli
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-03-01 00:00:00.000000000 Z
13
+ date: 2018-03-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json
@@ -96,6 +96,7 @@ files:
96
96
  - ".gitignore"
97
97
  - ".rubocop.yml"
98
98
  - ".travis.yml"
99
+ - ".yardopts"
99
100
  - CHANGELOG.md
100
101
  - CONFIG.md
101
102
  - Dockerfile
@@ -207,6 +208,7 @@ files:
207
208
  - ruby_setup.sh
208
209
  - run_docker_build_gem_upload_to_packagecloud.sh
209
210
  - run_tests_docker.rb
211
+ - yardoc_frontpage.md
210
212
  homepage: https://www.appoptics.com/
211
213
  licenses:
212
214
  - Librato Open License, Version 1.0