appoptics_apm-zearn 4.13.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.
Files changed (145) hide show
  1. checksums.yaml +7 -0
  2. data/.dockerignore +5 -0
  3. data/.github/ISSUE_TEMPLATE/bug-or-feature-request.md +16 -0
  4. data/.github/workflows/build_and_release_gem.yml +103 -0
  5. data/.github/workflows/build_for_packagecloud.yml +70 -0
  6. data/.github/workflows/docker-images.yml +47 -0
  7. data/.github/workflows/run_cpluplus_tests.yml +73 -0
  8. data/.github/workflows/run_tests.yml +168 -0
  9. data/.github/workflows/scripts/test_install.rb +23 -0
  10. data/.github/workflows/swig/swig-v4.0.2.tar.gz +0 -0
  11. data/.github/workflows/test_on_4_linux.yml +159 -0
  12. data/.gitignore +36 -0
  13. data/.rubocop.yml +29 -0
  14. data/.travis.yml +130 -0
  15. data/.yardopts +6 -0
  16. data/CHANGELOG.md +769 -0
  17. data/CONFIG.md +33 -0
  18. data/Gemfile +14 -0
  19. data/LICENSE +202 -0
  20. data/README.md +393 -0
  21. data/appoptics_apm.gemspec +70 -0
  22. data/bin/appoptics_apm_config +15 -0
  23. data/examples/prepend.rb +13 -0
  24. data/examples/sdk_examples.rb +158 -0
  25. data/ext/oboe_metal/README.md +69 -0
  26. data/ext/oboe_metal/extconf.rb +151 -0
  27. data/ext/oboe_metal/lib/.keep +0 -0
  28. data/ext/oboe_metal/lib/liboboe-1.0-alpine-x86_64.so.0.0.0.sha256 +1 -0
  29. data/ext/oboe_metal/lib/liboboe-1.0-x86_64.so.0.0.0.sha256 +1 -0
  30. data/ext/oboe_metal/noop/noop.c +8 -0
  31. data/ext/oboe_metal/src/README.md +6 -0
  32. data/ext/oboe_metal/src/VERSION +2 -0
  33. data/ext/oboe_metal/src/bson/bson.h +220 -0
  34. data/ext/oboe_metal/src/bson/platform_hacks.h +91 -0
  35. data/ext/oboe_metal/src/frames.cc +246 -0
  36. data/ext/oboe_metal/src/frames.h +40 -0
  37. data/ext/oboe_metal/src/init_appoptics_apm.cc +21 -0
  38. data/ext/oboe_metal/src/logging.cc +95 -0
  39. data/ext/oboe_metal/src/logging.h +35 -0
  40. data/ext/oboe_metal/src/oboe.h +1156 -0
  41. data/ext/oboe_metal/src/oboe_api.cpp +652 -0
  42. data/ext/oboe_metal/src/oboe_api.hpp +431 -0
  43. data/ext/oboe_metal/src/oboe_debug.h +59 -0
  44. data/ext/oboe_metal/src/oboe_swig_wrap.cc +7329 -0
  45. data/ext/oboe_metal/src/profiling.cc +435 -0
  46. data/ext/oboe_metal/src/profiling.h +78 -0
  47. data/ext/oboe_metal/test/CMakeLists.txt +53 -0
  48. data/ext/oboe_metal/test/FindGMock.cmake +43 -0
  49. data/ext/oboe_metal/test/README.md +56 -0
  50. data/ext/oboe_metal/test/frames_test.cc +164 -0
  51. data/ext/oboe_metal/test/profiling_test.cc +93 -0
  52. data/ext/oboe_metal/test/ruby_inc_dir.rb +8 -0
  53. data/ext/oboe_metal/test/ruby_prefix.rb +8 -0
  54. data/ext/oboe_metal/test/ruby_test_helper.rb +67 -0
  55. data/ext/oboe_metal/test/test.h +11 -0
  56. data/ext/oboe_metal/test/test_main.cc +32 -0
  57. data/init.rb +4 -0
  58. data/lib/appoptics_apm/api/layerinit.rb +41 -0
  59. data/lib/appoptics_apm/api/logging.rb +381 -0
  60. data/lib/appoptics_apm/api/memcache.rb +37 -0
  61. data/lib/appoptics_apm/api/metrics.rb +63 -0
  62. data/lib/appoptics_apm/api/tracing.rb +57 -0
  63. data/lib/appoptics_apm/api/util.rb +120 -0
  64. data/lib/appoptics_apm/api.rb +21 -0
  65. data/lib/appoptics_apm/base.rb +231 -0
  66. data/lib/appoptics_apm/config.rb +299 -0
  67. data/lib/appoptics_apm/frameworks/grape.rb +98 -0
  68. data/lib/appoptics_apm/frameworks/padrino.rb +78 -0
  69. data/lib/appoptics_apm/frameworks/rails/inst/action_controller.rb +104 -0
  70. data/lib/appoptics_apm/frameworks/rails/inst/action_controller4.rb +48 -0
  71. data/lib/appoptics_apm/frameworks/rails/inst/action_controller5.rb +50 -0
  72. data/lib/appoptics_apm/frameworks/rails/inst/action_controller6.rb +50 -0
  73. data/lib/appoptics_apm/frameworks/rails/inst/action_controller_api.rb +50 -0
  74. data/lib/appoptics_apm/frameworks/rails/inst/action_view.rb +88 -0
  75. data/lib/appoptics_apm/frameworks/rails/inst/active_record.rb +27 -0
  76. data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/mysql.rb +43 -0
  77. data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/mysql2.rb +29 -0
  78. data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/postgresql.rb +31 -0
  79. data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/utils.rb +119 -0
  80. data/lib/appoptics_apm/frameworks/rails/inst/connection_adapters/utils5x.rb +114 -0
  81. data/lib/appoptics_apm/frameworks/rails/inst/logger_formatters.rb +27 -0
  82. data/lib/appoptics_apm/frameworks/rails.rb +100 -0
  83. data/lib/appoptics_apm/frameworks/sinatra.rb +96 -0
  84. data/lib/appoptics_apm/inst/bunny-client.rb +148 -0
  85. data/lib/appoptics_apm/inst/bunny-consumer.rb +89 -0
  86. data/lib/appoptics_apm/inst/curb.rb +332 -0
  87. data/lib/appoptics_apm/inst/dalli.rb +85 -0
  88. data/lib/appoptics_apm/inst/delayed_job.rb +92 -0
  89. data/lib/appoptics_apm/inst/em-http-request.rb +101 -0
  90. data/lib/appoptics_apm/inst/excon.rb +125 -0
  91. data/lib/appoptics_apm/inst/faraday.rb +106 -0
  92. data/lib/appoptics_apm/inst/graphql.rb +240 -0
  93. data/lib/appoptics_apm/inst/grpc_client.rb +159 -0
  94. data/lib/appoptics_apm/inst/grpc_server.rb +120 -0
  95. data/lib/appoptics_apm/inst/http.rb +81 -0
  96. data/lib/appoptics_apm/inst/httpclient.rb +174 -0
  97. data/lib/appoptics_apm/inst/logger_formatter.rb +50 -0
  98. data/lib/appoptics_apm/inst/logging_log_event.rb +28 -0
  99. data/lib/appoptics_apm/inst/lumberjack_formatter.rb +13 -0
  100. data/lib/appoptics_apm/inst/memcached.rb +86 -0
  101. data/lib/appoptics_apm/inst/mongo.rb +246 -0
  102. data/lib/appoptics_apm/inst/mongo2.rb +225 -0
  103. data/lib/appoptics_apm/inst/moped.rb +466 -0
  104. data/lib/appoptics_apm/inst/rack.rb +182 -0
  105. data/lib/appoptics_apm/inst/rack_cache.rb +35 -0
  106. data/lib/appoptics_apm/inst/redis.rb +274 -0
  107. data/lib/appoptics_apm/inst/resque.rb +151 -0
  108. data/lib/appoptics_apm/inst/rest-client.rb +48 -0
  109. data/lib/appoptics_apm/inst/sequel.rb +178 -0
  110. data/lib/appoptics_apm/inst/sidekiq-client.rb +55 -0
  111. data/lib/appoptics_apm/inst/sidekiq-worker.rb +66 -0
  112. data/lib/appoptics_apm/inst/twitter-cassandra.rb +294 -0
  113. data/lib/appoptics_apm/inst/typhoeus.rb +108 -0
  114. data/lib/appoptics_apm/instrumentation.rb +22 -0
  115. data/lib/appoptics_apm/loading.rb +65 -0
  116. data/lib/appoptics_apm/logger.rb +14 -0
  117. data/lib/appoptics_apm/noop/README.md +9 -0
  118. data/lib/appoptics_apm/noop/context.rb +27 -0
  119. data/lib/appoptics_apm/noop/metadata.rb +25 -0
  120. data/lib/appoptics_apm/noop/profiling.rb +21 -0
  121. data/lib/appoptics_apm/oboe_init_options.rb +211 -0
  122. data/lib/appoptics_apm/ruby.rb +35 -0
  123. data/lib/appoptics_apm/sdk/current_trace.rb +77 -0
  124. data/lib/appoptics_apm/sdk/custom_metrics.rb +94 -0
  125. data/lib/appoptics_apm/sdk/logging.rb +37 -0
  126. data/lib/appoptics_apm/sdk/tracing.rb +434 -0
  127. data/lib/appoptics_apm/support/profiling.rb +18 -0
  128. data/lib/appoptics_apm/support/transaction_metrics.rb +67 -0
  129. data/lib/appoptics_apm/support/transaction_settings.rb +219 -0
  130. data/lib/appoptics_apm/support/x_trace_options.rb +110 -0
  131. data/lib/appoptics_apm/support_report.rb +119 -0
  132. data/lib/appoptics_apm/test.rb +95 -0
  133. data/lib/appoptics_apm/thread_local.rb +26 -0
  134. data/lib/appoptics_apm/util.rb +326 -0
  135. data/lib/appoptics_apm/version.rb +16 -0
  136. data/lib/appoptics_apm/xtrace.rb +115 -0
  137. data/lib/appoptics_apm.rb +77 -0
  138. data/lib/joboe_metal.rb +212 -0
  139. data/lib/oboe.rb +7 -0
  140. data/lib/oboe_metal.rb +172 -0
  141. data/lib/rails/generators/appoptics_apm/install_generator.rb +47 -0
  142. data/lib/rails/generators/appoptics_apm/templates/appoptics_apm_initializer.rb +425 -0
  143. data/log/.keep +0 -0
  144. data/yardoc_frontpage.md +26 -0
  145. metadata +231 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c5c1af3c4b1cdc259690f809317be0bbb42d96a9c0f11db406c53f37436975af
4
+ data.tar.gz: 9e4b9e7648f478502dd8474107aeeff239a0dc1440b12d46c62262978fd26bd2
5
+ SHA512:
6
+ metadata.gz: 70625ee391bcab018b3813c892e3960f165d8d1f28307ec3a0ddd698b8039e816d32c1cb6eca9feb503aa1e85aca64f46d01734d685509c739e13d3fe4b89290
7
+ data.tar.gz: 4c0dae9c620d9e8242ae73d5353891958f9c988c8441e90447347a62b8703d738c5f97f1e80b1690db914457767d877d55f7451aca7fff01317687e91ed77df9
data/.dockerignore ADDED
@@ -0,0 +1,5 @@
1
+ # exclude everything by default
2
+ *
3
+
4
+ # add whitelist of includes via:
5
+ # !somefile.txt
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Bug or Feature request
3
+ about: general purpose template
4
+ title: "[Bug] or [Feature request]"
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ # Description
11
+
12
+ # How to reproduce or use case
13
+
14
+ # Code Sample (if available)
15
+
16
+ # OS, Ruby version, Gemfile, Gemfile.lock, log message ... (if relevant)
@@ -0,0 +1,103 @@
1
+ # Copyright (c) 2021 SolarWinds, LLC.
2
+ # All rights reserved.
3
+
4
+ name: BUILD, VERIFY, and RELEASE Ruby Gem to RubyGems
5
+
6
+ # This workflow relies on the following secrets
7
+ # - TRACE_BUILD_RUBY_ACTIONS_API_TOKEN (from the trace-build user in github)
8
+ # - RUBYGEMS_TOKEN (from the appoptics user on rubygems.org)
9
+ # - APPOPTICS_SERVICE_KEY
10
+ # - APPOPTICS_COLLECTOR
11
+ #
12
+ # The correct oboe version has to be in the file ext/oboe_metal/src/VERSION
13
+
14
+ on:
15
+ workflow_dispatch:
16
+
17
+ jobs:
18
+ build:
19
+ name: Build + Release Gem to RubyGems
20
+ runs-on: ubuntu-latest
21
+
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+
25
+ - name: Set up Ruby 2.7 and bundle
26
+ uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: 2.7
29
+
30
+ - name: Install gems
31
+ run: |
32
+ echo 'gem: --no-document' >> ~/.gemrc
33
+ bundle install --without development --without test
34
+
35
+ - name: Install swig 4.0.2
36
+ run: |
37
+ apt udate && apt install -y --no-install-recommends bison
38
+ curl -SL https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz | tar xzC /tmp
39
+ cd /tmp/swig-4.0.2
40
+ ./autogen.sh && ./configure && make && sudo make install
41
+ cd -
42
+
43
+ - name: Download files from files.appoptics.com and create swig wrapper
44
+ env:
45
+ TRACE_BUILD_TOKEN: ${{ secrets.TRACE_BUILD_RUBY_ACTIONS_API_TOKEN }}
46
+ run: |
47
+ bundle exec rake oboe_files_appoptics_fetch
48
+ bundle exec rake oboe_verify
49
+
50
+ - name: Build Gem and upload to Rubygems
51
+ id: build
52
+ env:
53
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_TOKEN }}
54
+ run: |
55
+ bundle exec rake build_and_publish_gem
56
+ checksum=`shasum -a256 *.gem | awk '{print $1;}'`
57
+ echo "checksum: $checksum"
58
+ echo ::set-output name=checksum::$checksum
59
+ echo ::set-output name=gem_version::`ruby -e 'require "./lib/appoptics_apm/version"; puts AppOpticsAPM::Version::STRING'`
60
+
61
+ - name: Get checksum from Rubygems
62
+ id: checksum
63
+ run: |
64
+ gem_version=${{ steps.build.outputs.gem_version }}
65
+ echo ::set-output name=geminfo::`curl https://rubygems.org/api/v2/rubygems/appoptics_apm/versions/$gem_version.json`
66
+
67
+ - name: Print checksums (in case some debugging is needed)
68
+ run: |
69
+ echo "local checksum: ${{ steps.build.outputs.checksum }}"
70
+ echo "Rubygems checksum: ${{ fromJson(steps.checksum.outputs.geminfo).sha }}"
71
+
72
+ - name: Fail if local and rubygems checksums don't match
73
+ if: fromJson(steps.checksum.outputs.geminfo).sha != steps.build.outputs.checksum
74
+ run: |
75
+ echo "local and rubygems checksum not matching, gem needs to be yanked from rubygems.org"
76
+ exit 1
77
+
78
+ - name: Create release draft that includes the checksum
79
+ uses: actions/github-script@v3
80
+ with:
81
+ github-token: ${{secrets.GITHUB_TOKEN}}
82
+ script: |
83
+ github.repos.createRelease({
84
+ owner: "appoptics",
85
+ repo: "appoptics-apm-ruby",
86
+ body: "SHA256 checksum: ${{ steps.build.outputs.checksum }}",
87
+ tag_name: "${{ steps.build.outputs.gem_version }}",
88
+ name: "${{ steps.build.outputs.gem_version }}",
89
+ draft: true
90
+ })
91
+
92
+ # may need a bit of time for the gem to become available (sleep 1)
93
+ - name: Download new Rubygem from rubygems.org and test
94
+ working-directory: .github/workflows/
95
+ env:
96
+ APPOPTICS_SERVICE_KEY: ${{ secrets.APPOPTICS_SERVICE_KEY }}
97
+ APPOPTICS_COLLECTOR: ${{ secrets.APPOPTICS_COLLECTOR}}
98
+ run: |
99
+ sleep 1
100
+ gem install appoptics_apm --version ${{ steps.build.outputs.gem_version }}
101
+ ruby ./scripts/test_install.rb
102
+
103
+
@@ -0,0 +1,70 @@
1
+ # Copyright (c) 2021 SolarWinds, LLC.
2
+ # All rights reserved.
3
+
4
+ name: Ruby Gem to PackageCloud
5
+
6
+ on:
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ name: Build + Publish to PackageCloud
12
+ runs-on: ubuntu-latest
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+
17
+ - name: Set up Ruby 2.6 and bundle
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: 2.6
21
+
22
+ - name: Install gems
23
+ run: |
24
+ echo 'gem: --no-document' >> ~/.gemrc
25
+ bundle install --without development --without test
26
+
27
+ - name: Install swig 4.0.2
28
+ run: |
29
+ apt udate && apt install -y --no-install-recommends bison
30
+ curl -SL https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz | tar xzC /tmp
31
+ cd /tmp/swig-4.0.2
32
+ ./autogen.sh && ./configure && make && sudo make install
33
+ cd -
34
+
35
+ - name: Download oboe staging files from S3, compile swig wrapper
36
+ run: |
37
+ bundle exec rake fetch
38
+ ls -l ext/oboe_metal/src
39
+
40
+ - name: Build Gem
41
+ id: gemstep
42
+ run: |
43
+ gem build appoptics_apm.gemspec
44
+ echo `shasum -a256 *.gem`
45
+ echo "::set-output name=GEM_VERSION::`ruby -e 'require "./lib/appoptics_apm/version"; puts AppOpticsAPM::Version::STRING'`"
46
+ cat ext/oboe_metal/src/VERSION
47
+
48
+ - name: Publish to PackageCloud
49
+ # PackageCloud is unreliable with regards to
50
+ # republishing after yanking a gem
51
+ # we are going to fail if republishing is attempted
52
+ run: |
53
+ gem install package_cloud
54
+ package_cloud push solarwinds/appoptics-apm-ruby *.gem
55
+ env:
56
+ PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
57
+
58
+ # Run this test manually, github is having problems reading the index at packagecloud
59
+ # TODO: AO-20355
60
+ # - name: Test install (give packagecloud 60 seconds to index)
61
+ # working-directory: .github/workflows/
62
+ # env:
63
+ # APPOPTICS_SERVICE_KEY: ${{ secrets.APPOPTICS_SERVICE_KEY }}
64
+ # APPOPTICS_COLLECTOR: ${{ secrets.APPOPTICS_COLLECTOR}}
65
+ # APPOPTICS_FROM_S3: true
66
+ # run: |
67
+ # sleep 60
68
+ # gem sources --add https://packagecloud.io/solarwinds/appoptics-apm-ruby
69
+ # gem install appoptics_apm --version ${{ steps.gemstep.outputs.GEM_VERSION }} --verbose
70
+ # ruby ./scripts/test_install.rb
@@ -0,0 +1,47 @@
1
+ name: Build docker images
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - 'test/run_tests/Dockerfile_*'
7
+ # Allows running this workflow manually from the Actions tab
8
+ workflow_dispatch:
9
+
10
+ env:
11
+ GHRC: ghcr.io/appoptics/appoptics-apm-ruby/apm_ruby
12
+ DOCKERFILE: test/run_tests/Dockerfile
13
+
14
+ jobs:
15
+
16
+ build_push:
17
+ name: Build docker images
18
+ runs-on: ubuntu-latest
19
+
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ os: [ubuntu, debian, centos, alpine]
24
+
25
+ steps:
26
+ - name: Checkout
27
+ uses: actions/checkout@v1
28
+
29
+ - name: ghcr.io login
30
+ uses: docker/login-action@v1
31
+ with:
32
+ registry: ghcr.io
33
+ username: ${{ github.actor }}
34
+ password: ${{ secrets.GITHUB_TOKEN }}
35
+
36
+ # - name: Build and push V2
37
+ # uses: docker/build-push-action@v2
38
+ # with:
39
+ # file: test/run_tests/Dockerfile_ubuntu
40
+ # tags: ghcr.io/appoptics/appoptics-apm-ruby/ao_ubuntu:latest
41
+ # push: true
42
+
43
+ - name: Build new Docker image
44
+ run: docker build -f ${{ env.DOCKERFILE }}_${{ matrix.os }} -t ${{ env.GHRC }}_${{ matrix.os }} .
45
+
46
+ - name: Publish updated Docker image
47
+ run: docker push ${{ env.GHRC }}_${{ matrix.os }}
@@ -0,0 +1,73 @@
1
+ # Copyright (c) 2021 SolarWinds, LLC.
2
+ # All rights reserved.
3
+
4
+ name: C++ Tests
5
+
6
+ on:
7
+ push:
8
+ paths:
9
+ - ext/oboe_metal/src/*.h
10
+ - ext/oboe_metal/src/*.cc
11
+ - ext/oboe_metal/test/*
12
+ # Allows you to run this workflow manually from the Actions tab
13
+ workflow_dispatch:
14
+
15
+ jobs:
16
+ tests:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ ruby: [3.0, 2.7, 2.6, 2.5, 2.4]
22
+
23
+ container:
24
+ image: ruby:${{ matrix.ruby }}
25
+
26
+ name: ${{ matrix.ruby }} - c++
27
+
28
+ env:
29
+ APPOPTICS_REPORTER: file
30
+ APPOPTICS_COLLECTOR: /tmp/appoptics_traces.bson
31
+ APPOPTICS_REPORTER_FILE_SINGLE: false
32
+ APPOPTICS_FROM_S3: true
33
+
34
+ steps:
35
+ - uses: actions/checkout@v2
36
+
37
+ - name: Install cmake
38
+ run: |
39
+ ls -lrt /usr/src
40
+ apt update && apt install -y --no-install-recommends build-essential libgtest-dev ruby
41
+ curl -OL https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5-SHA-256.txt
42
+ curl -OL https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5.tar.gz
43
+ sha256sum -c --ignore-missing cmake-3.20.5-SHA-256.txt
44
+ tar -zxvf cmake-3.20.5.tar.gz
45
+ cd cmake-3.20.5
46
+ ./bootstrap
47
+ make
48
+ make install
49
+
50
+ - name: Install swig 4.0.2
51
+ working-directory: .github/workflows/swig
52
+ run: |
53
+ apt update && apt install -y --no-install-recommends bison
54
+ tar -xf swig-v4.0.2.tar.gz -C /tmp
55
+ cd /tmp/swig-4.0.2
56
+ ./autogen.sh && ./configure && make && make install
57
+ cd -
58
+
59
+ - name: Bundle & download c-files
60
+ run: |
61
+ gem install bundler
62
+ bundle install
63
+ bundle exec rake clean fetch compile
64
+
65
+ - name: Compile and run tests
66
+ working-directory: ext/oboe_metal/test
67
+ run: |
68
+ export TEST_DIR=`pwd`
69
+ export RUBY_INC_DIR=$(ruby ruby_inc_dir.rb)
70
+ export RUBY_PREFIX=$(ruby ruby_prefix.rb)
71
+ cmake -S . -B build
72
+ cmake --build build
73
+ cd build && ctest
@@ -0,0 +1,168 @@
1
+ # Copyright (c) 2021 SolarWinds, LLC.
2
+ # All rights reserved.
3
+
4
+ name: Run Ruby Tests on Ubuntu
5
+
6
+ on:
7
+ # push:
8
+ # Allows you to run this workflow manually from the Actions tab
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ tests:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ matrix:
17
+ ruby: [3.0, 2.7, 2.6, 2.5, 2.4]
18
+ gemfile:
19
+ - libraries
20
+ - unit
21
+ - instrumentation_mocked
22
+ - instrumentation_mocked_oldgems
23
+ - frameworks
24
+ - rails61
25
+ - rails60
26
+ - rails52
27
+ - rails42
28
+ - delayed_job
29
+ - noop
30
+ dbtype: [postgresql, mysql2]
31
+ exclude:
32
+ - ruby: 3.0
33
+ gemfile: rails52
34
+ - ruby: 3.0
35
+ gemfile: rails42
36
+ - ruby: 2.7
37
+ gemfile: rails42
38
+ - ruby: 2.6
39
+ gemfile: rails42
40
+ - ruby: 2.4
41
+ gemfile: rails61
42
+ - ruby: 2.4
43
+ gemfile: rails60
44
+ - ruby: 2.4 # excluding because of new sprockets version (4.0.0)
45
+ gemfile: rails52
46
+
47
+ - gemfile: unit
48
+ dbtype: mysql2
49
+ - gemfile: noop
50
+ dbtype: mysql2
51
+ - gemfile: libraries
52
+ dbtype: mysql2
53
+ - gemfile: instrumentation_mocked
54
+ dbtype: mysql2
55
+ - gemfile: instrumentation_mocked_oldgems
56
+ dbtype: mysql2
57
+ - gemfile: frameworks
58
+ dbtype: mysql2
59
+ - gemfile: delayed_job
60
+ dbtype: mysql2
61
+
62
+ container:
63
+ image: ruby:${{ matrix.ruby }}
64
+
65
+ name: ${{ matrix.ruby }} - ${{ matrix.gemfile }}
66
+
67
+ env:
68
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
69
+ APPOPTICS_GEM_TEST: true
70
+ APPOPTICS_REPORTER: file
71
+ APPOPTICS_COLLECTOR: /tmp/appoptics_traces.bson
72
+ APPOPTICS_MONGO_SERVER: "mongo"
73
+ APPOPTICS_RABBITMQ_SERVER: "rabbitmq"
74
+ APPOPTICS_MEMCACHED_SERVER: "memcached"
75
+ APPOPTICS_REPORTER_FILE_SINGLE: false
76
+ APPOPTICS_FROM_S3: true
77
+ MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
78
+ MYSQL_ROOT_PASSWORD: "admin"
79
+ MYSQL_HOST: "mysql"
80
+ MYSQL_DATABASE: "travis_ci_test"
81
+ POSTGRES_DB: "travis_ci_test"
82
+ DOCKER_MYSQL_PASS: "admin"
83
+ DOCKER_PSQL_PASS: "postgres"
84
+ POSTGRES_USER: "postgres"
85
+ POSTGRES_PASSWORD: "postgres"
86
+ POSTGRES_HOST: "postgres"
87
+ REDIS_PASSWORD: "redis_pass"
88
+ services:
89
+ memcached:
90
+ image: memcached:latest
91
+ ports:
92
+ - 11211:11211
93
+ options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
94
+ rabbitmq:
95
+ image: rabbitmq:latest
96
+ ports:
97
+ - 5672:5672
98
+ options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
99
+ mongo:
100
+ image: mongo:latest
101
+ ports:
102
+ - 27017:27017
103
+ options: "--health-cmd \"mongo --quiet --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)'\" --health-interval 10s --health-timeout 5s --health-retries 5"
104
+ postgres:
105
+ image: postgres:10.8
106
+ env:
107
+ POSTGRES_DB: postgres
108
+ ports:
109
+ - 5432:5432
110
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
111
+ mysql:
112
+ image: mariadb:latest
113
+ env:
114
+ MYSQL_USER: user
115
+ MYSQL_PASSWORD: password
116
+ MYSQL_DATABASE: travis_ci_test
117
+ MYSQL_ROOT_PASSWORD: admin
118
+ ports:
119
+ - 3306:3306
120
+ options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
121
+
122
+ steps:
123
+ - uses: actions/checkout@v2
124
+
125
+ - name: Install dependencies
126
+ run: apt update && apt install -y --no-install-recommends bison libcurl4-gnutls-dev libsasl2-dev postgresql-client
127
+
128
+ - name: Set database type env var
129
+ run: export DBTYPE=${{ matrix.dbtype }}
130
+
131
+ - name: Add javascript runtime
132
+ uses: actions/setup-node@v2
133
+ with:
134
+ node-version: '14'
135
+
136
+ - name: Initialize services
137
+ run: |
138
+ export PGPASSWORD=$POSTGRES_PASSWORD; psql -c 'create database travis_ci_test;' -U postgres -h $POSTGRES_HOST
139
+ curl -SL http://download.redis.io/releases/redis-4.0.0.tar.gz | tar xzC /tmp && cd /tmp/redis-4.0.0/ && make && make install && cd -
140
+ redis-server --requirepass redis_pass --loglevel "warning" &
141
+
142
+ - name: Bundle with 1.17.3
143
+ if: matrix.gemfile == 'rails42' || matrix.gemfile == 'frameworks'
144
+ run: |
145
+ gem install bundler:1.17.3
146
+ export BUNDLE_GEMFILE=gemfiles/${{ matrix.gemfile }}.gemfile
147
+ bundle _1.17.3_ install --jobs 4 --retry 3
148
+ - name: Bundle
149
+ if: matrix.gemfile != 'rails42' && matrix.gemfile != 'frameworks'
150
+ run: |
151
+ gem install bundler
152
+ export BUNDLE_GEMFILE=gemfiles/${{ matrix.gemfile }}.gemfile
153
+ bundle install --jobs 4 --retry 3
154
+
155
+ - name: Install swig 4.0.2
156
+ working-directory: .github/workflows/swig
157
+ run: |
158
+ tar -xf swig-v4.0.2.tar.gz -C /tmp
159
+ cd /tmp/swig-4.0.2
160
+ ./autogen.sh && ./configure && make && make install
161
+ cd -
162
+
163
+ - name: Compile c-extension
164
+ run: |
165
+ bundle exec rake fetch compile
166
+
167
+ - name: Run tests
168
+ run: bundle exec rake test
@@ -0,0 +1,23 @@
1
+ # Copyright (c) 2021 SolarWinds, LLC.
2
+ # All rights reserved.
3
+
4
+ # Test script used to check if a newly created gem installs and connects to
5
+ # the collector
6
+ # requires env vars:
7
+ # - APPOPTICS_SERVICE_KEY
8
+ # - APPOPTICS_COLLECTOR (optional if the key is for production)
9
+
10
+ require 'appoptics_apm'
11
+ AppOpticsAPM.support_report
12
+ exit 1 unless AppOpticsAPM.reporter
13
+
14
+ AppOpticsAPM::Config[:profiling] = :enabled
15
+
16
+ AppOpticsAPM::SDK.start_trace("install_test_profiling") do
17
+ AppOpticsAPM::Profiling.run do
18
+ 10.times do
19
+ [9, 6, 12, 2, 7, 1, 9, 3, 4, 14, 5, 8].sort
20
+ sleep 0.2
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,159 @@
1
+ # Copyright (c) 2021 SolarWinds, LLC.
2
+ # All rights reserved.
3
+
4
+ name: Run Ruby Tests on 4 Linux
5
+
6
+ on:
7
+ push:
8
+ paths-ignore:
9
+ - 'test/run_tests/Dockerfile_*'
10
+ # Allows you to run this workflow manually from the Actions tab
11
+ workflow_dispatch:
12
+
13
+ env:
14
+ GHRC: ghcr.io/appoptics/appoptics-apm-ruby/apm_ruby
15
+ DOCKERFILE: test/run_tests/Dockerfile
16
+
17
+ jobs:
18
+
19
+ #-------------------------------------------------------------------------------
20
+ # TODO: figure out how to build images first if necessary
21
+ #
22
+ # ********* this is not working because we don't have a *************
23
+ # ********* reference to the commit of the previous GH run *************
24
+ #
25
+ # build_images:
26
+ # name: Build docker images if necessary
27
+ # runs-on: ubuntu-latest
28
+ #
29
+ # strategy:
30
+ # fail-fast: true
31
+ # matrix:
32
+ # os: [ ubuntu, debian, centos, alpine ]
33
+ #
34
+ # steps:
35
+ # - name: Checkout
36
+ # uses: actions/checkout@v2
37
+ #
38
+ #
39
+ # ## comment out to get a debug session
40
+ # ## only works with ubuntu and debian, because it uses apt:
41
+ ## - name: tmate debugging session
42
+ ## uses: mxschmitt/action-tmate@v3
43
+ ## with:
44
+ ## sudo: false
45
+ #
46
+ # - name: check modified files
47
+ # id: check_files
48
+ # run: |
49
+ # git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep Dockerfile_
50
+ # echo ::set-output name=check_dockerfiles::$?
51
+ ## git diff --name-only HEAD^ HEAD | grep [D]ockerfile_
52
+ ## echo ::set-output name=check_dockerfiles::$?
53
+ #
54
+ # - name: ghcr.io login ... build and publish images if needed
55
+ # uses: docker/login-action@v1
56
+ # if: ${{ steps.check_files.outputs.check_dockerfiles == 0}}
57
+ # with:
58
+ # registry: ghcr.io
59
+ # username: ${{ github.actor }}
60
+ # password: ${{ secrets.GITHUB_TOKEN }}
61
+ #
62
+ # - name: Build and publish new Docker image
63
+ # if: ${{ steps.check_files.outputs.check_dockerfiles == 0 }}
64
+ # run: |
65
+ # docker build -f ${{ env.DOCKERFILE }}_${{ matrix.os }} -t ${{ env.GHRC }}_${{ matrix.os }} .
66
+ # docker push ${{ env.GHRC }}_${{ matrix.os }}
67
+
68
+ #-------------------------------------------------------------------------------
69
+ all_linux_test:
70
+ name: ${{ matrix.os }} - ruby ${{ matrix.ruby }}
71
+ runs-on: ubuntu-latest
72
+ # needs: build_images
73
+
74
+ strategy:
75
+ fail-fast: false
76
+ matrix:
77
+ os: [ubuntu, debian, centos, alpine]
78
+ ruby: ['3.0', '2.7', '2.6', '2.5', '2.4']
79
+
80
+ container:
81
+ # maybe github.repository works
82
+ image: ghcr.io/${{ github.repository }}/apm_ruby_${{ matrix.os }}
83
+
84
+ env:
85
+ APPOPTICS_GEM_TEST: true
86
+ APPOPTICS_REPORTER: file
87
+ APPOPTICS_COLLECTOR: /tmp/appoptics_traces.bson
88
+ APPOPTICS_MONGO_SERVER: "mongo"
89
+ APPOPTICS_RABBITMQ_SERVER: "rabbitmq"
90
+ APPOPTICS_MEMCACHED_SERVER: "memcached"
91
+ APPOPTICS_REPORTER_FILE_SINGLE: false
92
+ APPOPTICS_FROM_S3: true
93
+ MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
94
+ MYSQL_ROOT_PASSWORD: "admin"
95
+ MYSQL_HOST: "mysql"
96
+ MYSQL_DATABASE: "travis_ci_test"
97
+ POSTGRES_DB: "travis_ci_test"
98
+ DOCKER_MYSQL_PASS: "admin"
99
+ DOCKER_PSQL_PASS: "postgres"
100
+ POSTGRES_USER: "postgres"
101
+ POSTGRES_PASSWORD: "postgres"
102
+ POSTGRES_HOST: "postgres"
103
+ REDIS_PASSWORD: "redis_pass"
104
+ TEST_RUNS_TO_FILE: "true"
105
+
106
+ services:
107
+ memcached:
108
+ image: memcached:latest
109
+ ports:
110
+ - 11211:11211
111
+ options: --health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'" --health-interval 10s --health-timeout 5s --health-retries 5
112
+ rabbitmq:
113
+ image: rabbitmq:latest
114
+ ports:
115
+ - 5672:5672
116
+ options: --health-cmd "rabbitmqctl node_health_check" --health-interval 10s --health-timeout 5s --health-retries 5
117
+ mongo:
118
+ image: mongo:latest
119
+ ports:
120
+ - 27017:27017
121
+ options: "--health-cmd \"mongo --quiet --eval 'quit(db.runCommand({ ping: 1 }).ok ? 0 : 2)'\" --health-interval 10s --health-timeout 5s --health-retries 5"
122
+ postgres:
123
+ image: postgres:10.8
124
+ env:
125
+ POSTGRES_DB: travis_ci_test
126
+ ports:
127
+ - 5432:5432
128
+ options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
129
+ mysql:
130
+ image: mariadb:latest
131
+ env:
132
+ MYSQL_USER: user
133
+ MYSQL_PASSWORD: password
134
+ MYSQL_DATABASE: travis_ci_test
135
+ MYSQL_ROOT_PASSWORD: admin
136
+ ports:
137
+ - 3306:3306
138
+ options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
139
+
140
+ steps:
141
+ - name: Checkout ${{ github.ref }}
142
+ uses: actions/checkout@v2
143
+
144
+ - name: print some info
145
+ run: |
146
+ user=`whoami`
147
+ pwd=`pwd`
148
+ echo "User: $user"
149
+ echo "Current dir: $pwd"
150
+ echo "Home dir: $HOME"
151
+ echo "Branch: ${GITHUB_REF#refs/*/}"
152
+
153
+ - name: ruby tests
154
+ run: |
155
+ export HOME=/root
156
+ test/run_tests/ruby_setup.sh
157
+ version=`rbenv versions --bare | grep ${{ matrix.ruby }}`
158
+ echo "testing with ruby version: $version"
159
+ test/run_tests/run_tests.sh -r $version