elastic-apm 3.4.0 → 3.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.jenkins_exclude.yml +39 -20
  3. data/.ci/.jenkins_framework.yml +2 -2
  4. data/.ci/Jenkinsfile +286 -170
  5. data/.ci/docker/jruby/11-jdk/Dockerfile +40 -0
  6. data/.ci/docker/jruby/12-jdk/Dockerfile +40 -0
  7. data/.ci/docker/jruby/13-jdk/Dockerfile +40 -0
  8. data/.ci/docker/jruby/7-jdk/Dockerfile +40 -0
  9. data/.ci/docker/jruby/8-jdk/Dockerfile +40 -0
  10. data/.ci/docker/jruby/README.md +31 -0
  11. data/.ci/docker/jruby/run.sh +73 -0
  12. data/.ci/docker/jruby/test.sh +13 -0
  13. data/.ci/jobs/defaults.yml +1 -1
  14. data/.ci/packer_cache.sh +16 -0
  15. data/.github/ISSUE_TEMPLATE/Bug_report.md +13 -11
  16. data/.github/ISSUE_TEMPLATE/Feature_request.md +8 -8
  17. data/.github/PULL_REQUEST_TEMPLATE.md +51 -5
  18. data/.gitignore +5 -0
  19. data/.rspec +0 -1
  20. data/.rubocop.yml +13 -1
  21. data/CHANGELOG.asciidoc +94 -1
  22. data/CONTRIBUTING.md +6 -48
  23. data/Gemfile +34 -9
  24. data/README.md +62 -13
  25. data/Rakefile +37 -5
  26. data/bin/run-tests +4 -1
  27. data/docker-compose.yml +7 -0
  28. data/docs/api.asciidoc +15 -3
  29. data/docs/configuration.asciidoc +164 -32
  30. data/docs/debugging.asciidoc +14 -0
  31. data/docs/getting-started-rails.asciidoc +2 -0
  32. data/docs/graphql.asciidoc +23 -0
  33. data/docs/images/dynamic-config.svg +1 -0
  34. data/docs/index.asciidoc +6 -1
  35. data/docs/introduction.asciidoc +2 -1
  36. data/docs/performance-tuning.asciidoc +106 -0
  37. data/docs/set-up.asciidoc +5 -2
  38. data/docs/supported-technologies.asciidoc +68 -1
  39. data/docs/upgrading.asciidoc +45 -0
  40. data/elastic-apm.gemspec +17 -0
  41. data/lib/elastic-apm.rb +17 -0
  42. data/lib/elastic_apm.rb +29 -0
  43. data/lib/elastic_apm/agent.rb +49 -2
  44. data/lib/elastic_apm/central_config.rb +27 -8
  45. data/lib/elastic_apm/central_config/cache_control.rb +17 -0
  46. data/lib/elastic_apm/child_durations.rb +17 -0
  47. data/lib/elastic_apm/config.rb +82 -7
  48. data/lib/elastic_apm/config/bytes.rb +17 -0
  49. data/lib/elastic_apm/config/duration.rb +17 -0
  50. data/lib/elastic_apm/config/options.rb +18 -1
  51. data/lib/elastic_apm/config/regexp_list.rb +17 -0
  52. data/lib/elastic_apm/config/wildcard_pattern_list.rb +20 -1
  53. data/lib/elastic_apm/context.rb +17 -0
  54. data/lib/elastic_apm/context/request.rb +17 -0
  55. data/lib/elastic_apm/context/request/socket.rb +17 -0
  56. data/lib/elastic_apm/context/request/url.rb +17 -0
  57. data/lib/elastic_apm/context/response.rb +18 -1
  58. data/lib/elastic_apm/context/user.rb +17 -0
  59. data/lib/elastic_apm/context_builder.rb +17 -0
  60. data/lib/elastic_apm/deprecations.rb +17 -0
  61. data/lib/elastic_apm/error.rb +17 -0
  62. data/lib/elastic_apm/error/exception.rb +17 -0
  63. data/lib/elastic_apm/error/log.rb +17 -0
  64. data/lib/elastic_apm/error_builder.rb +17 -0
  65. data/lib/elastic_apm/grape.rb +17 -0
  66. data/lib/elastic_apm/graphql.rb +91 -0
  67. data/lib/elastic_apm/grpc.rb +99 -0
  68. data/lib/elastic_apm/instrumenter.rb +29 -4
  69. data/lib/elastic_apm/internal_error.rb +17 -0
  70. data/lib/elastic_apm/logging.rb +17 -0
  71. data/lib/elastic_apm/metadata.rb +17 -0
  72. data/lib/elastic_apm/metadata/process_info.rb +17 -0
  73. data/lib/elastic_apm/metadata/service_info.rb +22 -2
  74. data/lib/elastic_apm/metadata/system_info.rb +17 -0
  75. data/lib/elastic_apm/metadata/system_info/container_info.rb +17 -0
  76. data/lib/elastic_apm/metrics.rb +33 -1
  77. data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
  78. data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
  79. data/lib/elastic_apm/metrics/metric.rb +23 -4
  80. data/lib/elastic_apm/metrics/set.rb +17 -0
  81. data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
  82. data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
  83. data/lib/elastic_apm/metrics/vm_set.rb +17 -0
  84. data/lib/elastic_apm/metricset.rb +17 -0
  85. data/lib/elastic_apm/middleware.rb +20 -4
  86. data/lib/elastic_apm/naively_hashable.rb +17 -0
  87. data/lib/elastic_apm/normalizers.rb +17 -0
  88. data/lib/elastic_apm/normalizers/grape.rb +17 -0
  89. data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
  90. data/lib/elastic_apm/normalizers/rails.rb +17 -0
  91. data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
  92. data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
  93. data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
  94. data/lib/elastic_apm/normalizers/rails/active_record.rb +17 -0
  95. data/lib/elastic_apm/opentracing.rb +66 -24
  96. data/lib/elastic_apm/rails.rb +17 -0
  97. data/lib/elastic_apm/railtie.rb +17 -0
  98. data/lib/elastic_apm/resque.rb +29 -0
  99. data/lib/elastic_apm/sinatra.rb +17 -0
  100. data/lib/elastic_apm/span.rb +17 -0
  101. data/lib/elastic_apm/span/context.rb +17 -0
  102. data/lib/elastic_apm/span/context/db.rb +26 -2
  103. data/lib/elastic_apm/span/context/destination.rb +37 -4
  104. data/lib/elastic_apm/span/context/http.rb +17 -0
  105. data/lib/elastic_apm/span_helpers.rb +17 -0
  106. data/lib/elastic_apm/spies.rb +33 -14
  107. data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
  108. data/lib/elastic_apm/spies/delayed_job.rb +17 -0
  109. data/lib/elastic_apm/spies/dynamo_db.rb +58 -0
  110. data/lib/elastic_apm/spies/elasticsearch.rb +37 -2
  111. data/lib/elastic_apm/spies/faraday.rb +18 -1
  112. data/lib/elastic_apm/spies/http.rb +19 -1
  113. data/lib/elastic_apm/spies/json.rb +17 -0
  114. data/lib/elastic_apm/spies/mongo.rb +18 -1
  115. data/lib/elastic_apm/spies/net_http.rb +25 -3
  116. data/lib/elastic_apm/spies/rake.rb +17 -0
  117. data/lib/elastic_apm/spies/redis.rb +17 -0
  118. data/lib/elastic_apm/spies/resque.rb +53 -0
  119. data/lib/elastic_apm/spies/sequel.rb +31 -4
  120. data/lib/elastic_apm/spies/shoryuken.rb +17 -0
  121. data/lib/elastic_apm/spies/sidekiq.rb +17 -0
  122. data/lib/elastic_apm/spies/sinatra.rb +17 -0
  123. data/lib/elastic_apm/spies/sneakers.rb +17 -0
  124. data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
  125. data/lib/elastic_apm/spies/tilt.rb +17 -0
  126. data/lib/elastic_apm/sql.rb +21 -4
  127. data/lib/elastic_apm/sql/signature.rb +17 -0
  128. data/lib/elastic_apm/sql/tokenizer.rb +17 -0
  129. data/lib/elastic_apm/sql/tokens.rb +17 -0
  130. data/lib/elastic_apm/sql_summarizer.rb +17 -0
  131. data/lib/elastic_apm/stacktrace.rb +17 -0
  132. data/lib/elastic_apm/stacktrace/frame.rb +17 -0
  133. data/lib/elastic_apm/stacktrace_builder.rb +23 -1
  134. data/lib/elastic_apm/subscriber.rb +17 -0
  135. data/lib/elastic_apm/trace_context.rb +85 -49
  136. data/lib/elastic_apm/trace_context/traceparent.rb +113 -0
  137. data/lib/elastic_apm/trace_context/tracestate.rb +43 -0
  138. data/lib/elastic_apm/transaction.rb +33 -5
  139. data/lib/elastic_apm/transport/base.rb +39 -23
  140. data/lib/elastic_apm/transport/connection.rb +17 -0
  141. data/lib/elastic_apm/transport/connection/http.rb +17 -0
  142. data/lib/elastic_apm/transport/connection/proxy_pipe.rb +22 -0
  143. data/lib/elastic_apm/transport/filters.rb +17 -0
  144. data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
  145. data/lib/elastic_apm/transport/filters/secrets_filter.rb +29 -53
  146. data/lib/elastic_apm/transport/headers.rb +17 -0
  147. data/lib/elastic_apm/transport/serializers.rb +17 -0
  148. data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
  149. data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
  150. data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
  151. data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
  152. data/lib/elastic_apm/transport/serializers/span_serializer.rb +22 -2
  153. data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
  154. data/lib/elastic_apm/transport/user_agent.rb +17 -0
  155. data/lib/elastic_apm/transport/worker.rb +17 -0
  156. data/lib/elastic_apm/util.rb +17 -0
  157. data/lib/elastic_apm/util/inflector.rb +17 -0
  158. data/lib/elastic_apm/util/lru_cache.rb +17 -0
  159. data/lib/elastic_apm/util/throttle.rb +17 -0
  160. data/lib/elastic_apm/version.rb +18 -1
  161. metadata +29 -12
  162. data/.ci/downstreamTests.groovy +0 -185
  163. data/.ci/prepare-git-context.sh +0 -27
  164. data/CHANGELOG.md +0 -1
  165. data/codecov.yml +0 -32
data/.gitignore CHANGED
@@ -20,3 +20,8 @@ vendor/
20
20
 
21
21
  .idea/
22
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
@@ -96,5 +98,15 @@ Style/SpecialGlobalVars:
96
98
  Style/MissingRespondToMissing:
97
99
  Enabled: false
98
100
 
99
- Style/BracesAroundHashParameters:
101
+ Style/HashEachMethods:
102
+ Enabled: true
103
+
104
+ Style/HashTransformKeys:
105
+ Enabled: true
106
+
107
+ Style/HashTransformValues:
108
+ Enabled: true
109
+
110
+ Style/FrozenStringLiteralComment:
100
111
  Enabled: false
112
+
@@ -35,6 +35,99 @@ endif::[]
35
35
  [[release-notes-3.x]]
36
36
  === Ruby Agent version 3.x
37
37
 
38
+ [[release-notes-3.9.0]]
39
+ ==== 3.9.0 (2020-08-04)
40
+
41
+ [float]
42
+ ===== Added
43
+
44
+ - Support for DynamoDB {pull}827[#827]
45
+
46
+ [float]
47
+ ===== Fixed
48
+
49
+ - Fix Rails Engine views' paths being reported as absolute {pull}839[#839]
50
+ - Fix an issue when using Elasticsearch spy without a running agent {pull}830[#830]
51
+
52
+ [[release-notes-3.8.0]]
53
+ ==== 3.8.0 (2020-06-18)
54
+
55
+ [float]
56
+ ===== Added
57
+
58
+ - Add the option `capture_elasticsearch_queries` {pull}789[#789]
59
+ - Add option to skip patching Kernal#require {pull}812[#812]
60
+ - Add option `service_node_name` {pull}820[#820]
61
+
62
+ [float]
63
+ ===== Fixed
64
+
65
+ - Allow underscores in hostnames in Net::HTTP spy {pull}804[#804]
66
+ - Don't change log level on logger object via remote config {pull}809[#809]
67
+ - Update and fix the Opentracing bridge {pull}791[#791]
68
+
69
+ [[release-notes-3.7.0]]
70
+ ==== 3.7.0 (2020-05-14)
71
+
72
+ [float]
73
+ ===== Changed
74
+
75
+ - Make config values dynamic so they can be changed via the remote config {pull}747[#747]
76
+ - Log the updated options from central config in addition to cumulative modifications {pull}758[#758]
77
+
78
+ [float]
79
+ ===== Fixed
80
+
81
+ - Ensure that the log level is updated for the config's logger when value is changed {pull}755[#755]
82
+ - Set config `false` values to `false`, not `nil` {pull}761[#761]
83
+ - Ensure that the previously running agent's config is used in `ElasticAPM.restart` {pull}763[#763]
84
+ - Handle the Resque spy's payload class value being a String or Class and update docs {pull}768[#768]
85
+ - Add finalizer on ProxyPipe::Write so Zlib::GzipWriter is properly closed {pull}787[#787]
86
+
87
+ [float]
88
+ ===== Added
89
+
90
+ - Add enabled config option, replacing active {pull}669[#669]
91
+ - Add recording config option {pull}765[#765]
92
+ - Add support for `SuckerPunch` {pull}775[#775]
93
+ - Support forking: Detect forking and restart agent tasks and background threads {pull}783[#783]
94
+
95
+ [[release-notes-3.6.0]]
96
+ ==== 3.6.0 (2020-03-10)
97
+
98
+ [float]
99
+ ===== Added
100
+
101
+ - Support for gRPC using the `grpc` gem (Experimental) {pull}669[#669]
102
+ - GraphQL support (experimental) {pull}721[#721]
103
+ - Add `span.context.destination.address` and `span.context.destination.port` when available. {pull}722[#722]
104
+ - Add support for Resque. {pull}729[#729]
105
+
106
+ [float]
107
+ ===== Changed
108
+
109
+ - The new SQL parser is used by default {pull}730[#730]
110
+
111
+ [[release-notes-3.5.0]]
112
+ ==== 3.5.0 (2020-02-12)
113
+
114
+ [float]
115
+ ===== Added
116
+
117
+ - Pass along tracestate headers and add prefixless Traceparent header {pull}694[#694]
118
+ - Add sanitize_field_names to replace custom_key_filters {pull}708[#708]
119
+ - Add `rows_affected` to database related spans (Sequel only for now) {pull}668[#668]
120
+
121
+ [float]
122
+ ===== Changed
123
+
124
+ - Rename disabled_instrumentations to disable_instrumentations {pull}695[#695]
125
+
126
+ [float]
127
+ ===== Fixed
128
+
129
+ - Fix thread race condition in metrics collection (JRuby) {pull}669[#669]
130
+
38
131
  [[release-notes-3.4.0]]
39
132
  ==== 3.4.0 (2020-01-10)
40
133
 
@@ -45,7 +138,7 @@ endif::[]
45
138
  - Add more precise (experimental) SQL summarizer {pull}640[#640]
46
139
  - Add support for Shoryuken (AWS SQS) {pull}674[#674]
47
140
  - Add support for Sneakers (Experimental) {pull}676[#676]
48
- - Add option `api_key` to specify an Api key to use with the apm server {pull}655[#655]
141
+ - Add option `api_key` (experimental) to specify an Api key to use with the apm server {pull}655[#655]
49
142
 
50
143
  [float]
51
144
  ===== Changed
@@ -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'
@@ -17,30 +34,29 @@ gem 'timecop'
17
34
  gem 'webmock'
18
35
 
19
36
  # Integrations
37
+ gem 'aws-sdk-dynamodb', require: nil
20
38
  gem 'aws-sdk-sqs', require: nil
21
39
  gem 'elasticsearch', require: nil
22
40
  gem 'fakeredis', require: nil
23
41
  gem 'faraday', require: nil
42
+ gem 'graphql', require: nil
43
+ gem 'google-protobuf', '< 3.12' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '2.5'
44
+ gem 'grpc' if !defined?(JRUBY_VERSION)
24
45
  gem 'json-schema', require: nil
25
46
  gem 'mongo', require: nil
26
47
  gem 'opentracing', require: nil
27
48
  gem 'rake', require: nil
49
+ gem 'resque', require: nil
28
50
  gem 'sequel', require: nil
29
51
  gem 'shoryuken', require: nil
30
52
  gem 'sidekiq', require: nil
31
- gem 'sneakers', '~> 2.12', require: nil
32
53
  gem 'simplecov', require: false
33
54
  gem 'simplecov-cobertura', require: false
55
+ gem 'sneakers', '~> 2.12', require: nil
56
+ gem 'sucker_punch', '~> 2.0', require: nil
34
57
  gem 'yard', require: nil
35
58
  gem 'yarjuf'
36
59
 
37
- if RUBY_PLATFORM == 'java'
38
- gem 'activerecord-jdbcsqlite3-adapter'
39
- gem 'jdbc-sqlite3'
40
- else
41
- gem 'sqlite3'
42
- end
43
-
44
60
  ## Install Framework
45
61
  GITHUB_REPOS = {
46
62
  'grape' => 'ruby-grape/grape',
@@ -59,7 +75,7 @@ end
59
75
  frameworks_versions.each do |framework, version|
60
76
  case version
61
77
  when 'master'
62
- gem framework, github: GITHUB_REPOS.fetch[framework]
78
+ gem framework, github: GITHUB_REPOS.fetch(framework)
63
79
  when /.+/
64
80
  gem framework, "~> #{version}.0"
65
81
  else
@@ -73,6 +89,15 @@ if frameworks_versions.key?('rails')
73
89
  end
74
90
  end
75
91
 
92
+ if RUBY_PLATFORM == 'java'
93
+ gem 'activerecord-jdbcsqlite3-adapter'
94
+ gem 'jdbc-sqlite3'
95
+ elsif frameworks_versions['rails'] =~ /^(4|5)/
96
+ gem 'sqlite3', '~> 1.3.6'
97
+ else
98
+ gem 'sqlite3' # rubocop:disable Bundler/DuplicatedGem
99
+ end
100
+
76
101
  group :bench do
77
102
  gem 'ruby-prof', require: nil, platforms: %i[ruby]
78
103
  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
@@ -8,7 +8,10 @@ runRspec(){
8
8
  if [ -n "${case}" ]; then
9
9
  bn="$(basename ${case} _spec.rb)/"
10
10
  fi
11
- bundle exec rspec -f progress -f JUnit -o spec/junit-reports/${bn}ruby-agent-junit.xml ${case}
11
+ bundle exec rspec \
12
+ -f progress \
13
+ -r yarjuf -f JUnit -o spec/junit-reports/${bn}ruby-agent-junit.xml \
14
+ ${case}
12
15
  }
13
16
  specific_spec=$1
14
17