elastic-apm 3.3.0 → 3.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.jenkins_exclude.yml +43 -24
  3. data/.ci/.jenkins_framework.yml +2 -2
  4. data/.ci/.jenkins_ruby.yml +1 -1
  5. data/.ci/Jenkinsfile +288 -170
  6. data/.ci/docker/jruby/11-jdk/Dockerfile +40 -0
  7. data/.ci/docker/jruby/12-jdk/Dockerfile +40 -0
  8. data/.ci/docker/jruby/13-jdk/Dockerfile +40 -0
  9. data/.ci/docker/jruby/7-jdk/Dockerfile +40 -0
  10. data/.ci/docker/jruby/8-jdk/Dockerfile +40 -0
  11. data/.ci/docker/jruby/README.md +31 -0
  12. data/.ci/docker/jruby/run.sh +73 -0
  13. data/.ci/docker/jruby/test.sh +13 -0
  14. data/.ci/jobs/apm-agent-ruby-downstream.yml +1 -0
  15. data/.ci/jobs/apm-agent-ruby-linting-mbp.yml +1 -0
  16. data/.ci/jobs/apm-agent-ruby-mbp.yml +1 -0
  17. data/.ci/jobs/defaults.yml +1 -1
  18. data/.ci/packer_cache.sh +16 -0
  19. data/.github/ISSUE_TEMPLATE/Bug_report.md +40 -0
  20. data/.github/ISSUE_TEMPLATE/Feature_request.md +17 -0
  21. data/.github/PULL_REQUEST_TEMPLATE.md +60 -0
  22. data/.gitignore +8 -0
  23. data/.rspec +0 -1
  24. data/.rubocop.yml +18 -0
  25. data/CHANGELOG.asciidoc +104 -1
  26. data/CONTRIBUTING.md +6 -48
  27. data/Gemfile +38 -10
  28. data/README.md +62 -13
  29. data/Rakefile +37 -5
  30. data/bench/sql.rb +49 -0
  31. data/bin/build_docs +1 -1
  32. data/bin/run-tests +4 -1
  33. data/docker-compose.yml +7 -0
  34. data/docs/api.asciidoc +52 -3
  35. data/docs/configuration.asciidoc +171 -22
  36. data/docs/getting-started-rails.asciidoc +2 -0
  37. data/docs/graphql.asciidoc +23 -0
  38. data/docs/images/dynamic-config.svg +1 -0
  39. data/docs/index.asciidoc +6 -1
  40. data/docs/introduction.asciidoc +2 -1
  41. data/docs/performance-tuning.asciidoc +106 -0
  42. data/docs/set-up.asciidoc +5 -2
  43. data/docs/supported-technologies.asciidoc +86 -1
  44. data/docs/upgrading.asciidoc +45 -0
  45. data/elastic-apm.gemspec +17 -0
  46. data/lib/elastic-apm.rb +17 -0
  47. data/lib/elastic_apm.rb +58 -5
  48. data/lib/elastic_apm/agent.rb +55 -4
  49. data/lib/elastic_apm/central_config.rb +27 -8
  50. data/lib/elastic_apm/central_config/cache_control.rb +17 -0
  51. data/lib/elastic_apm/child_durations.rb +26 -4
  52. data/lib/elastic_apm/config.rb +86 -5
  53. data/lib/elastic_apm/config/bytes.rb +17 -0
  54. data/lib/elastic_apm/config/duration.rb +17 -0
  55. data/lib/elastic_apm/config/options.rb +21 -5
  56. data/lib/elastic_apm/config/regexp_list.rb +17 -0
  57. data/lib/elastic_apm/config/wildcard_pattern_list.rb +20 -1
  58. data/lib/elastic_apm/context.rb +17 -0
  59. data/lib/elastic_apm/context/request.rb +17 -0
  60. data/lib/elastic_apm/context/request/socket.rb +17 -0
  61. data/lib/elastic_apm/context/request/url.rb +17 -0
  62. data/lib/elastic_apm/context/response.rb +27 -2
  63. data/lib/elastic_apm/context/user.rb +17 -0
  64. data/lib/elastic_apm/context_builder.rb +17 -0
  65. data/lib/elastic_apm/deprecations.rb +17 -0
  66. data/lib/elastic_apm/error.rb +17 -0
  67. data/lib/elastic_apm/error/exception.rb +17 -0
  68. data/lib/elastic_apm/error/log.rb +17 -0
  69. data/lib/elastic_apm/error_builder.rb +17 -0
  70. data/lib/elastic_apm/grape.rb +17 -0
  71. data/lib/elastic_apm/graphql.rb +91 -0
  72. data/lib/elastic_apm/grpc.rb +99 -0
  73. data/lib/elastic_apm/instrumenter.rb +49 -15
  74. data/lib/elastic_apm/internal_error.rb +17 -0
  75. data/lib/elastic_apm/logging.rb +17 -0
  76. data/lib/elastic_apm/metadata.rb +17 -0
  77. data/lib/elastic_apm/metadata/process_info.rb +17 -0
  78. data/lib/elastic_apm/metadata/service_info.rb +22 -2
  79. data/lib/elastic_apm/metadata/system_info.rb +17 -0
  80. data/lib/elastic_apm/metadata/system_info/container_info.rb +17 -0
  81. data/lib/elastic_apm/metrics.rb +33 -1
  82. data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
  83. data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
  84. data/lib/elastic_apm/metrics/metric.rb +23 -4
  85. data/lib/elastic_apm/metrics/set.rb +17 -0
  86. data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
  87. data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
  88. data/lib/elastic_apm/metrics/vm_set.rb +17 -0
  89. data/lib/elastic_apm/metricset.rb +17 -0
  90. data/lib/elastic_apm/middleware.rb +20 -4
  91. data/lib/elastic_apm/naively_hashable.rb +17 -0
  92. data/lib/elastic_apm/normalizers.rb +17 -0
  93. data/lib/elastic_apm/normalizers/grape.rb +17 -0
  94. data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
  95. data/lib/elastic_apm/normalizers/rails.rb +17 -0
  96. data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
  97. data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
  98. data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
  99. data/lib/elastic_apm/normalizers/rails/active_record.rb +29 -5
  100. data/lib/elastic_apm/opentracing.rb +66 -24
  101. data/lib/elastic_apm/rails.rb +18 -10
  102. data/lib/elastic_apm/railtie.rb +18 -1
  103. data/lib/elastic_apm/resque.rb +29 -0
  104. data/lib/elastic_apm/sinatra.rb +17 -0
  105. data/lib/elastic_apm/span.rb +20 -2
  106. data/lib/elastic_apm/span/context.rb +43 -44
  107. data/lib/elastic_apm/span/context/db.rb +43 -0
  108. data/lib/elastic_apm/span/context/destination.rb +77 -0
  109. data/lib/elastic_apm/span/context/http.rb +43 -0
  110. data/lib/elastic_apm/span_helpers.rb +17 -0
  111. data/lib/elastic_apm/spies.rb +33 -14
  112. data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
  113. data/lib/elastic_apm/spies/delayed_job.rb +17 -0
  114. data/lib/elastic_apm/spies/elasticsearch.rb +49 -5
  115. data/lib/elastic_apm/spies/faraday.rb +53 -18
  116. data/lib/elastic_apm/spies/http.rb +35 -3
  117. data/lib/elastic_apm/spies/json.rb +17 -0
  118. data/lib/elastic_apm/spies/mongo.rb +23 -1
  119. data/lib/elastic_apm/spies/net_http.rb +50 -8
  120. data/lib/elastic_apm/spies/rake.rb +17 -0
  121. data/lib/elastic_apm/spies/redis.rb +17 -0
  122. data/lib/elastic_apm/spies/resque.rb +53 -0
  123. data/lib/elastic_apm/spies/sequel.rb +52 -15
  124. data/lib/elastic_apm/spies/shoryuken.rb +65 -0
  125. data/lib/elastic_apm/spies/sidekiq.rb +17 -0
  126. data/lib/elastic_apm/spies/sinatra.rb +17 -0
  127. data/lib/elastic_apm/spies/sneakers.rb +74 -0
  128. data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
  129. data/lib/elastic_apm/spies/tilt.rb +17 -0
  130. data/lib/elastic_apm/sql.rb +36 -0
  131. data/lib/elastic_apm/sql/signature.rb +169 -0
  132. data/lib/elastic_apm/sql/tokenizer.rb +264 -0
  133. data/lib/elastic_apm/sql/tokens.rb +63 -0
  134. data/lib/elastic_apm/sql_summarizer.rb +18 -2
  135. data/lib/elastic_apm/stacktrace.rb +17 -0
  136. data/lib/elastic_apm/stacktrace/frame.rb +17 -0
  137. data/lib/elastic_apm/stacktrace_builder.rb +23 -1
  138. data/lib/elastic_apm/subscriber.rb +17 -0
  139. data/lib/elastic_apm/trace_context.rb +85 -49
  140. data/lib/elastic_apm/trace_context/traceparent.rb +113 -0
  141. data/lib/elastic_apm/trace_context/tracestate.rb +43 -0
  142. data/lib/elastic_apm/transaction.rb +43 -15
  143. data/lib/elastic_apm/transport/base.rb +39 -23
  144. data/lib/elastic_apm/transport/connection.rb +17 -0
  145. data/lib/elastic_apm/transport/connection/http.rb +17 -0
  146. data/lib/elastic_apm/transport/connection/proxy_pipe.rb +24 -2
  147. data/lib/elastic_apm/transport/filters.rb +17 -0
  148. data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
  149. data/lib/elastic_apm/transport/filters/secrets_filter.rb +29 -53
  150. data/lib/elastic_apm/transport/headers.rb +21 -0
  151. data/lib/elastic_apm/transport/serializers.rb +17 -0
  152. data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
  153. data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
  154. data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
  155. data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
  156. data/lib/elastic_apm/transport/serializers/span_serializer.rb +45 -8
  157. data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
  158. data/lib/elastic_apm/transport/user_agent.rb +17 -0
  159. data/lib/elastic_apm/transport/worker.rb +17 -0
  160. data/lib/elastic_apm/util.rb +17 -0
  161. data/lib/elastic_apm/util/inflector.rb +17 -0
  162. data/lib/elastic_apm/util/lru_cache.rb +17 -0
  163. data/lib/elastic_apm/util/throttle.rb +17 -0
  164. data/lib/elastic_apm/version.rb +18 -1
  165. metadata +36 -7
  166. data/.ci/downstreamTests.groovy +0 -185
  167. data/.ci/prepare-git-context.sh +0 -24
  168. data/.github/workflows/main.yml +0 -14
  169. data/CHANGELOG.md +0 -1
data/.gitignore CHANGED
@@ -17,3 +17,11 @@ spec/junit-reports
17
17
  .gem
18
18
  *.bulk
19
19
  vendor/
20
+
21
+ .idea/
22
+ log/
23
+
24
+ benchmark-*.error
25
+ benchmark-*.raw
26
+
27
+ .ci/docker/jruby/output.log
data/.rspec CHANGED
@@ -1,3 +1,2 @@
1
1
  --color
2
- --require spec_helper
3
2
  --exclude-pattern spec/integration/**/*_spec.rb
@@ -4,6 +4,8 @@ AllCops:
4
4
  - 'elastic-apm.gemspec'
5
5
  - 'vendor/**/*'
6
6
  - 'bench/*'
7
+ - 'spec/support/helloworld_pb.rb'
8
+ - 'spec/support/helloworld_services_pb.rb'
7
9
 
8
10
  require:
9
11
  - rubocop-performance
@@ -44,6 +46,9 @@ Metrics/ModuleLength:
44
46
  Metrics/BlockLength:
45
47
  Enabled: false
46
48
 
49
+ Metrics/BlockNesting:
50
+ Enabled: false
51
+
47
52
  Metrics/MethodLength:
48
53
  Enabled: false
49
54
 
@@ -92,3 +97,16 @@ Style/SpecialGlobalVars:
92
97
 
93
98
  Style/MissingRespondToMissing:
94
99
  Enabled: false
100
+
101
+ Style/HashEachMethods:
102
+ Enabled: true
103
+
104
+ Style/HashTransformKeys:
105
+ Enabled: true
106
+
107
+ Style/HashTransformValues:
108
+ Enabled: true
109
+
110
+ Style/FrozenStringLiteralComment:
111
+ Enabled: false
112
+
@@ -35,8 +35,111 @@ endif::[]
35
35
  [[release-notes-3.x]]
36
36
  === Ruby Agent version 3.x
37
37
 
38
+ [[release-notes-3.8.0]]
39
+ ==== 3.8.0 (2020-06-18)
40
+
41
+ [float]
42
+ ===== Added
43
+
44
+ - Add the option `capture_elasticsearch_queries` {pull}789[#789]
45
+ - Add option to skip patching Kernal#require {pull}812[#812]
46
+ - Add option `service_node_name` {pull}820[#820]
47
+
48
+ [float]
49
+ ===== Fixed
50
+
51
+ - Allow underscores in hostnames in Net::HTTP spy {pull}804[#804]
52
+ - Don't change log level on logger object via remote config {pull}809[#809]
53
+ - Update and fix the Opentracing bridge {pull}791[#791]
54
+
55
+ [[release-notes-3.7.0]]
56
+ ==== 3.7.0 (2020-05-14)
57
+
58
+ [float]
59
+ ===== Changed
60
+
61
+ - Make config values dynamic so they can be changed via the remote config {pull}747[#747]
62
+ - Log the updated options from central config in addition to cumulative modifications {pull}758[#758]
63
+
64
+ [float]
65
+ ===== Fixed
66
+
67
+ - Ensure that the log level is updated for the config's logger when value is changed {pull}755[#755]
68
+ - Set config `false` values to `false`, not `nil` {pull}761[#761]
69
+ - Ensure that the previously running agent's config is used in `ElasticAPM.restart` {pull}763[#763]
70
+ - Handle the Resque spy's payload class value being a String or Class and update docs {pull}768[#768]
71
+ - Add finalizer on ProxyPipe::Write so Zlib::GzipWriter is properly closed {pull}787[#787]
72
+
73
+ [float]
74
+ ===== Added
75
+
76
+ - Add enabled config option, replacing active {pull}669[#669]
77
+ - Add recording config option {pull}765[#765]
78
+ - Add support for `SuckerPunch` {pull}775[#775]
79
+ - Support forking: Detect forking and restart agent tasks and background threads {pull}783[#783]
80
+
81
+ [[release-notes-3.6.0]]
82
+ ==== 3.6.0 (2020-03-10)
83
+
84
+ [float]
85
+ ===== Added
86
+
87
+ - Support for gRPC using the `grpc` gem (Experimental) {pull}669[#669]
88
+ - GraphQL support (experimental) {pull}721[#721]
89
+ - Add `span.context.destination.address` and `span.context.destination.port` when available. {pull}722[#722]
90
+ - Add support for Resque. {pull}729[#729]
91
+
92
+ [float]
93
+ ===== Changed
94
+
95
+ - The new SQL parser is used by default {pull}730[#730]
96
+
97
+ [[release-notes-3.5.0]]
98
+ ==== 3.5.0 (2020-02-12)
99
+
100
+ [float]
101
+ ===== Added
102
+
103
+ - Pass along tracestate headers and add prefixless Traceparent header {pull}694[#694]
104
+ - Add sanitize_field_names to replace custom_key_filters {pull}708[#708]
105
+ - Add `rows_affected` to database related spans (Sequel only for now) {pull}668[#668]
106
+
107
+ [float]
108
+ ===== Changed
109
+
110
+ - Rename disabled_instrumentations to disable_instrumentations {pull}695[#695]
111
+
112
+ [float]
113
+ ===== Fixed
114
+
115
+ - Fix thread race condition in metrics collection (JRuby) {pull}669[#669]
116
+
117
+ [[release-notes-3.4.0]]
118
+ ==== 3.4.0 (2020-01-10)
119
+
120
+ [float]
121
+ ===== Added
122
+
123
+ - Add `span.context.destination` fields {pull}647[#647]
124
+ - Add more precise (experimental) SQL summarizer {pull}640[#640]
125
+ - Add support for Shoryuken (AWS SQS) {pull}674[#674]
126
+ - Add support for Sneakers (Experimental) {pull}676[#676]
127
+ - Add option `api_key` (experimental) to specify an Api key to use with the apm server {pull}655[#655]
128
+
129
+ [float]
130
+ ===== Changed
131
+
132
+ - Allow action dispatch spy to be disabled via `disabled_instrumentations` {pull}657[#657]
133
+
134
+ [float]
135
+ ===== Fixed
136
+
137
+ - Fix Rails Console detection when top-level `Console` constant defined {pull}664[#664]
138
+ - Fix Ruby 2.7 related deprecation warnings {pull}667[#667]
139
+ - Fix HTTP response header values not being converted to strings {pull}675[#675]
140
+
38
141
  [[release-notes-3.3.0]]
39
- ==== 3.2.0 (2019-12-05)
142
+ ==== 3.3.0 (2019-12-05)
40
143
 
41
144
  [float]
42
145
  ===== Added
@@ -18,50 +18,6 @@ Talk about what you would like to do.
18
18
  It may be that somebody is already working on it,
19
19
  or that there are particular issues that you should know about before implementing the change.
20
20
 
21
- ### Submitting your changes
22
-
23
- Generally, we require that you test any code you are adding or modifying.
24
- Once your changes are ready to submit for review:
25
-
26
- 1. Sign the Contributor License Agreement
27
-
28
- Please make sure you have signed our [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).
29
- We are not asking you to assign copyright to us,
30
- but to give us the right to distribute your code without restriction.
31
- We ask this of all contributors in order to assure our users of the origin and continuing existence of the code.
32
- You only need to sign the CLA once.
33
-
34
- 2. Test your changes
35
-
36
- Run the test suite to make sure that nothing is broken.
37
- See [testing](#testing) for details.
38
-
39
- 3. Rebase your changes
40
-
41
- Update your local repository with the most recent code from the main repo,
42
- and rebase your branch on top of the latest master branch.
43
- We prefer your initial changes to be squashed into a single commit.
44
- Later,
45
- if we ask you to make changes,
46
- add them as separate commits.
47
- This makes them easier to review.
48
- As a final step before merging we will either ask you to squash all commits yourself or we'll do it for you.
49
-
50
- 4. Submit a pull request
51
-
52
- Push your local changes to your forked copy of the repository and [submit a pull request](https://help.github.com/articles/using-pull-requests).
53
- In the pull request,
54
- choose a title which sums up the changes that you have made,
55
- and in the body provide more details about what your changes do.
56
- Also mention the number of the issue where discussion has taken place,
57
- eg "Closes #123".
58
-
59
- 5. Be patient
60
-
61
- We might not be able to review your code as fast as we would like to,
62
- but we'll do our best to dedicate it the attention it deserves.
63
- Your effort is much appreciated!
64
-
65
21
  ### Workflow
66
22
 
67
23
  All feature development and most bug fixes hit the master branch first.
@@ -85,10 +41,12 @@ $ spec/scripts/spec.sh ruby:2.6 rails-5.2
85
41
  To release a new version:
86
42
 
87
43
  1. Update `VERSION` in `lib/elastic_apm/version.rb` according to the changes (major, minor, patch).
88
- 2. Update `CHANGELOG.md` to reflect the new version – change _Unreleased_ section to _Version (release date)_.
89
- 3. Make a new commit with the changes above, with a message in the style of `vX.X.X`.
90
- 4. Run `rake release`. This will...
44
+ 1. Update `CHANGELOG.md` to reflect the new version – change _Unreleased_ section to _Version (release date)_.
45
+ 1. For Majors: Add a new row to the EOL table in `docs/upgrading.asciidoc`. The EOL date is the release date plus 18 months.
46
+ 1. Make a new commit with the changes above, with a message in the style of `vX.X.X`.
47
+ 1. Run `rake release`. This will...
91
48
  1. Tag the current commit as new version.
92
49
  2. Push the tag to GitHub.
93
50
  3. Build the gem and upload to Rubygems (local user needs to be signed in and authorized.)
94
- 4. Update `2.x` branch to be at released commit and push it to GitHub.
51
+ 1. Run `rake release:update_branch`. This will...
52
+ 1. Update `3.x` branch to be at released commit and push it to GitHub.
data/Gemfile CHANGED
@@ -1,3 +1,20 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  # frozen_string_literal: true
2
19
 
3
20
  source 'https://rubygems.org'
@@ -6,6 +23,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
23
 
7
24
  # Tools
8
25
  gem 'bootsnap', require: false
26
+ gem 'cucumber', require: false
9
27
  gem 'pry'
10
28
  gem 'rack-test'
11
29
  gem 'rspec', '~> 3'
@@ -16,27 +34,28 @@ gem 'timecop'
16
34
  gem 'webmock'
17
35
 
18
36
  # Integrations
37
+ gem 'aws-sdk-sqs', require: nil
19
38
  gem 'elasticsearch', require: nil
20
39
  gem 'fakeredis', require: nil
21
40
  gem 'faraday', require: nil
41
+ gem 'graphql', require: nil
42
+ gem 'google-protobuf', '< 3.12' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '2.5'
43
+ gem 'grpc' if !defined?(JRUBY_VERSION)
22
44
  gem 'json-schema', require: nil
23
45
  gem 'mongo', require: nil
24
46
  gem 'opentracing', require: nil
25
47
  gem 'rake', require: nil
48
+ gem 'resque', require: nil
26
49
  gem 'sequel', require: nil
50
+ gem 'shoryuken', require: nil
27
51
  gem 'sidekiq', require: nil
28
- gem 'simplecov', require: false, group: :test
29
- gem 'simplecov-cobertura', require: false, group: :test
52
+ gem 'simplecov', require: false
53
+ gem 'simplecov-cobertura', require: false
54
+ gem 'sneakers', '~> 2.12', require: nil
55
+ gem 'sucker_punch', '~> 2.0', require: nil
30
56
  gem 'yard', require: nil
31
57
  gem 'yarjuf'
32
58
 
33
- if RUBY_PLATFORM == 'java'
34
- gem 'activerecord-jdbcsqlite3-adapter'
35
- gem 'jdbc-sqlite3'
36
- else
37
- gem 'sqlite3'
38
- end
39
-
40
59
  ## Install Framework
41
60
  GITHUB_REPOS = {
42
61
  'grape' => 'ruby-grape/grape',
@@ -55,7 +74,7 @@ end
55
74
  frameworks_versions.each do |framework, version|
56
75
  case version
57
76
  when 'master'
58
- gem framework, github: GITHUB_REPOS.fetch[framework]
77
+ gem framework, github: GITHUB_REPOS.fetch(framework)
59
78
  when /.+/
60
79
  gem framework, "~> #{version}.0"
61
80
  else
@@ -69,6 +88,15 @@ if frameworks_versions.key?('rails')
69
88
  end
70
89
  end
71
90
 
91
+ if RUBY_PLATFORM == 'java'
92
+ gem 'activerecord-jdbcsqlite3-adapter'
93
+ gem 'jdbc-sqlite3'
94
+ elsif frameworks_versions['rails'] =~ /^(4|5)/
95
+ gem 'sqlite3', '~> 1.3.6'
96
+ else
97
+ gem 'sqlite3' # rubocop:disable Bundler/DuplicatedGem
98
+ end
99
+
72
100
  group :bench do
73
101
  gem 'ruby-prof', require: nil, platforms: %i[ruby]
74
102
  gem 'stackprof', require: nil, platforms: %i[ruby]
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  # elastic-apm
2
+
2
3
  ## Elastic APM agent for Ruby
3
4
 
4
5
  [![Jenkins](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-ruby/apm-agent-ruby-mbp/master)](https://apm-ci.elastic.co/job/apm-agent-ruby/job/apm-agent-ruby-mbp/job/master/) [![Gem](https://img.shields.io/gem/v/elastic-apm.svg)](https://rubygems.org/gems/elastic-apm)
@@ -11,21 +12,69 @@ The official Rubygem for [Elastic][] [APM][].
11
12
 
12
13
  ## Documentation
13
14
 
14
- [Full documentation at elastic.co](https://www.elastic.co/guide/en/apm/agent/ruby/2.x/index.html).
15
+ [Full documentation at elastic.co](https://www.elastic.co/guide/en/apm/agent/ruby/current/index.html).
15
16
 
16
17
  <ul>
17
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/introduction.html">Introduction</a></li>
18
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/getting-started-rails.html">Getting started with Rails</a></li>
19
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/getting-started-rack.html">Getting started with Rack</a></li>
20
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/configuration.html">Configuration</a></li>
21
- <li>
22
- <a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/advanced.html">Advanced Topics</a>
23
- <ul>
24
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/custom-instrumentation.html">Custom instrumentation</a></li>
25
- </ul>
26
- </li>
27
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/supported-technologies.html">Supported Technologies</a></li>
28
- <li><a href="https://www.elastic.co/guide/en/apm/agent/ruby/2.x/api.html">Public API</a></li>
18
+ <li>
19
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/set-up.html">Set up the Agent</a>
20
+ <ul>
21
+ <li>
22
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rails.html">Getting started with Rails</a>
23
+ </li>
24
+ <li>
25
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/getting-started-rack.html">Getting started with Rack</a>
26
+ </li>
27
+ </ul>
28
+ </li>
29
+ <li>
30
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/supported-technologies.html">Supported technologies</a>
31
+ </li>
32
+ <li>
33
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/configuration.html">Configuration</a>
34
+ </li>
35
+ <li>
36
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/advanced.html">Advanced Topics</a>
37
+ <ul>
38
+ <li>
39
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/context.html">Adding additional context</a>
40
+ </li>
41
+ <li>
42
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/custom-instrumentation.html">Custom instrumentation</a>
43
+ </li>
44
+ </ul>
45
+ </li>
46
+ <li>
47
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/api.html">API reference</a>
48
+ </li>
49
+ <li>
50
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/metrics.html">Metrics</a>
51
+ </li>
52
+ <li>
53
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/opentracing.html">OpenTracing API</a>
54
+ </li>
55
+ <li>
56
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/log-correlation.html">Log correlation</a>
57
+ </li>
58
+ <li>
59
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/debugging.html">Troubleshooting</a>
60
+ </li>
61
+ <li class="collapsible">
62
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes.html">Release notes</a>
63
+ <ul>
64
+ <li>
65
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-3.x.html">Ruby Agent version 3.x</a>
66
+ </li>
67
+ <li>
68
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-2.x.html">Ruby Agent version 2.x</a>
69
+ </li>
70
+ <li>
71
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-1.x.html">Ruby Agent version 1.x</a>
72
+ </li>
73
+ <li>
74
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-0.x.html">Ruby Agent version 0.x</a>
75
+ </li>
76
+ </ul>
77
+ </li>
29
78
  </ul>
30
79
 
31
80
  ---
data/Rakefile CHANGED
@@ -1,12 +1,34 @@
1
+ # Licensed to Elasticsearch B.V. under one or more contributor
2
+ # license agreements. See the NOTICE file distributed with
3
+ # this work for additional information regarding copyright
4
+ # ownership. Elasticsearch B.V. licenses this file to you under
5
+ # the Apache License, Version 2.0 (the "License"); you may
6
+ # not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing,
12
+ # software distributed under the License is distributed on an
13
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ # KIND, either express or implied. See the License for the
15
+ # specific language governing permissions and limitations
16
+ # under the License.
17
+
1
18
  # frozen_string_literal: true
2
19
 
3
20
  require 'bundler/gem_tasks'
4
21
 
5
- Rake::Task[:release].enhance do
6
- `git checkout 3.x &&
7
- git rebase master &&
8
- git push origin 3.x &&
9
- git checkout master`
22
+ desc """Post release action:
23
+ Update `3.x` branch to be at released commit and push it to GitHub.
24
+ """
25
+ namespace :release do
26
+ task :update_branch do
27
+ `git checkout 3.x &&
28
+ git rebase master &&
29
+ git push origin 3.x &&
30
+ git checkout master`
31
+ end
10
32
  end
11
33
 
12
34
  require 'rspec/core/rake_task'
@@ -17,3 +39,13 @@ YARD::Rake::YardocTask.new
17
39
  task docs: :yard
18
40
 
19
41
  task default: :spec
42
+
43
+ namespace :coverage do
44
+ desc "Collates all result sets generated by the different test runners"
45
+ task :report do
46
+ require 'simplecov'
47
+ require 'simplecov-cobertura'
48
+ SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
49
+ SimpleCov.collate Dir["coverage/matrix_results/**/.resultset.json"]
50
+ end
51
+ end