elastic-apm 4.9.0 → 4.10.0
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 +4 -4
- data/.pre-commit-config.yaml +1 -1
- data/CONTRIBUTING.md +13 -9
- data/Gemfile +43 -6
- data/docs/reference/getting-started-rails.md +14 -0
- data/docs/reference/graphql.md +1 -1
- data/docs/reference/supported-technologies.md +3 -3
- data/docs/release-notes/index.md +36 -4
- data/elastic-apm.gemspec +6 -3
- data/lib/elastic_apm/config.rb +1 -0
- data/lib/elastic_apm/error_builder.rb +1 -0
- data/lib/elastic_apm/graphql.rb +8 -0
- data/lib/elastic_apm/spies/sidekiq.rb +36 -1
- data/lib/elastic_apm/spies/sneakers.rb +4 -1
- data/lib/elastic_apm/spies/solid_queue.rb +80 -0
- data/lib/elastic_apm/stacktrace_builder.rb +1 -1
- data/lib/elastic_apm/transport/connection/proxy_pipe.rb +11 -1
- data/lib/elastic_apm/transport/connection.rb +1 -1
- data/lib/elastic_apm/transport/worker.rb +1 -1
- data/lib/elastic_apm/version.rb +1 -1
- data/updatecli-compose.yaml +4 -4
- metadata +6 -56
- data/.ci/.codecov.yml +0 -5
- data/.ci/.exclude.yml +0 -138
- data/.ci/.framework.yml +0 -10
- data/.ci/.main_framework.yml +0 -4
- data/.ci/.ruby.yml +0 -10
- data/.ci/docker/jruby/11-jdk/Dockerfile +0 -46
- data/.ci/docker/jruby/12-jdk/Dockerfile +0 -44
- data/.ci/docker/jruby/13-jdk/Dockerfile +0 -44
- data/.ci/docker/jruby/7-jdk/Dockerfile +0 -44
- data/.ci/docker/jruby/8-jdk/Dockerfile +0 -46
- data/.ci/docker/jruby/README.md +0 -31
- data/.ci/docker/jruby/run.sh +0 -97
- data/.ci/docker/jruby/test.sh +0 -28
- data/.ci/scripts/bench.sh +0 -52
- data/.ci/scripts/install-build-system.sh +0 -5
- data/.ci/updatecli/values.d/apm-data-spec.yml +0 -1
- data/.ci/updatecli/values.d/apm-gherkin.yml +0 -1
- data/.ci/updatecli/values.d/apm-json-specs.yml +0 -1
- data/.ci/updatecli/values.d/scm.yml +0 -10
- data/.ci/updatecli/values.d/update-compose.yml +0 -3
- data/.github/CODEOWNERS +0 -1
- data/.github/ISSUE_TEMPLATE/Bug_report.md +0 -40
- data/.github/ISSUE_TEMPLATE/Feature_request.md +0 -17
- data/.github/PULL_REQUEST_TEMPLATE.md +0 -60
- data/.github/dependabot.yml +0 -35
- data/.github/labeler-config.yml +0 -3
- data/.github/workflows/README.md +0 -57
- data/.github/workflows/addToProject.yml +0 -63
- data/.github/workflows/ci-docs.yml +0 -20
- data/.github/workflows/ci.yml +0 -70
- data/.github/workflows/docs-build.yml +0 -16
- data/.github/workflows/docs-deploy.yml +0 -16
- data/.github/workflows/docs-preview-cleanup.yml +0 -12
- data/.github/workflows/github-commands-comment.yml +0 -18
- data/.github/workflows/labeler.yml +0 -21
- data/.github/workflows/microbenchmark.yml +0 -31
- data/.github/workflows/release.yml +0 -87
- data/.github/workflows/run-matrix.yml +0 -68
- data/.github/workflows/test-reporter.yml +0 -25
- data/.github/workflows/updatecli.yml +0 -61
- data/bench/.gitignore +0 -2
- data/bench/app.rb +0 -53
- data/bench/benchmark.rb +0 -36
- data/bench/report.rb +0 -55
- data/bench/rubyprof.rb +0 -40
- data/bench/sql.rb +0 -49
- data/bench/stackprof.rb +0 -23
- data/bench/tmp/.gitkeep +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3002b08c3e06f6a3576f584359c0a12b5ec7367652997828272eca739d813c44
|
|
4
|
+
data.tar.gz: 8a71fd1a5c065245cdaf3f651c49bc08047f7947c8c1e3e48b8ac79ec2921388
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b7f1b6c1e9db918d4d15867bfdea3c0a27ea44259f6b942aeeea946e6165d0afe4f504a27c32582d40324300b8a872c160ec676ee2c96b890c7592bd351dffde
|
|
7
|
+
data.tar.gz: 9910a4b82cc51906d20f290931554a5fef08da11e35385c37c10a544050f60f9ff363a797f9a330b39098d796fd7d08d160414d8430f044e968bb78bda1929f7
|
data/.pre-commit-config.yaml
CHANGED
data/CONTRIBUTING.md
CHANGED
|
@@ -41,12 +41,16 @@ $ spec/scripts/spec.sh ruby:2.6 rails-5.2
|
|
|
41
41
|
To release a new version:
|
|
42
42
|
|
|
43
43
|
1. Update `VERSION` in `lib/elastic_apm/version.rb` according to the changes (major, minor, patch).
|
|
44
|
-
1.
|
|
45
|
-
1. For Majors: Add a new row to the EOL table in `docs/upgrading.
|
|
46
|
-
1.
|
|
47
|
-
1.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
1. Add a section for the new version to `docs/release-notes/index.md`, including the release date and links to notable PRs.
|
|
45
|
+
1. For Majors: Add a new row to the EOL table in `docs/reference/upgrading.md`. The EOL date is the release date plus 18 months.
|
|
46
|
+
1. Open a PR with the changes above, with a title in the style of `vX.X.X`, and merge it once green.
|
|
47
|
+
1. Tag the merged commit and push the tag to GitHub:
|
|
48
|
+
```sh
|
|
49
|
+
git tag vX.X.X
|
|
50
|
+
git push upstream vX.X.X
|
|
51
|
+
```
|
|
52
|
+
1. The tag triggers the `release` workflow, which will...
|
|
53
|
+
1. Build the gem and publish it to RubyGems using [trusted publishing](https://guides.rubygems.org/trusted-publishing/) (no API key involved).
|
|
54
|
+
1. Generate build provenance attestation.
|
|
55
|
+
1. Create a GitHub release with auto-generated notes.
|
|
56
|
+
1. Update the `4.x` branch to be at the released commit and push it to GitHub.
|
data/Gemfile
CHANGED
|
@@ -22,7 +22,8 @@ source 'https://rubygems.org'
|
|
|
22
22
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
23
23
|
|
|
24
24
|
# Tools
|
|
25
|
-
|
|
25
|
+
# Cucumber 12 fails on undefined steps; the synced gherkin specs have many.
|
|
26
|
+
gem 'cucumber', '< 12', require: false
|
|
26
27
|
gem 'rack-test'
|
|
27
28
|
gem 'rspec', '~> 3'
|
|
28
29
|
gem 'rspec-its'
|
|
@@ -51,7 +52,10 @@ if !defined?(JRUBY_VERSION)
|
|
|
51
52
|
gem 'google-protobuf', '< 3.23' if RUBY_VERSION < '2.7' && RUBY_VERSION > '2.5'
|
|
52
53
|
end
|
|
53
54
|
gem 'grpc' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '3.0'
|
|
54
|
-
|
|
55
|
+
# json 3.x removes JSON.generate's quirks_mode option (used by
|
|
56
|
+
# activesupport <= 7.2) and JSON.parse's positional options hash (used by
|
|
57
|
+
# multi_json <= 1.19, pulled in by resque on ruby < 3.2).
|
|
58
|
+
gem 'json', '< 3'
|
|
55
59
|
gem 'json-schema', require: nil
|
|
56
60
|
gem 'mongo', require: nil
|
|
57
61
|
gem 'opentracing', require: nil
|
|
@@ -106,18 +110,34 @@ frameworks_versions.each do |framework, version|
|
|
|
106
110
|
when /.+/
|
|
107
111
|
gem framework, "~> #{version}.0"
|
|
108
112
|
else
|
|
109
|
-
|
|
113
|
+
if framework == 'sinatra' && frameworks_versions.key?('grape')
|
|
114
|
+
# grape >= 3.3 requires mustermann >= 4.0 while sinatra requires
|
|
115
|
+
# mustermann <= 3.x. With sinatra unconstrained, bundler resolves the
|
|
116
|
+
# conflict by downgrading sinatra all the way to 1.0, which breaks on
|
|
117
|
+
# modern rack (`require 'rack/showexceptions'`). A floor forces bundler
|
|
118
|
+
# to backtrack grape/mustermann instead.
|
|
119
|
+
gem 'sinatra', '>= 2'
|
|
120
|
+
else
|
|
121
|
+
gem framework
|
|
122
|
+
end
|
|
110
123
|
end
|
|
111
124
|
end
|
|
112
125
|
|
|
113
|
-
#
|
|
126
|
+
# Rack::Auth::Digest was removed in rack 3.1 and grape < 2.1 still requires
|
|
127
|
+
# it, while grape master requires rack >= 3.1.
|
|
114
128
|
# Sinatra 2.x depends on rack 2.x, so use a compatible rack line when both are present.
|
|
115
129
|
if frameworks_versions.key?('grape')
|
|
116
130
|
sinatra_version = frameworks_versions['sinatra']
|
|
131
|
+
grape_version = frameworks_versions['grape']
|
|
117
132
|
if sinatra_version&.start_with?('2.')
|
|
118
133
|
gem 'rack', '~> 2.2.0'
|
|
119
|
-
|
|
134
|
+
elsif grape_version.match?(/\A(0\.|1\.|2\.0)/)
|
|
120
135
|
gem 'rack', '~> 3.0.0'
|
|
136
|
+
else
|
|
137
|
+
# Keep rack on the 3.x line so bundler doesn't resolve the
|
|
138
|
+
# grape/sinatra mustermann conflict by downgrading sinatra to 2.x/3.x
|
|
139
|
+
# (which depend on rack 2.x).
|
|
140
|
+
gem 'rack', '>= 3.0'
|
|
121
141
|
end
|
|
122
142
|
end
|
|
123
143
|
|
|
@@ -140,6 +160,17 @@ else
|
|
|
140
160
|
gem 'shoryuken', require: nil
|
|
141
161
|
end
|
|
142
162
|
|
|
163
|
+
# Solid Queue requires Rails 7.1+ (Active Record + Active Job).
|
|
164
|
+
if frameworks_versions.key?('rails')
|
|
165
|
+
rails_version = frameworks_versions['rails']
|
|
166
|
+
solid_queue_compatible =
|
|
167
|
+
rails_version == 'main' ||
|
|
168
|
+
rails_version.to_s.empty? ||
|
|
169
|
+
(rails_version =~ /\A\d+(\.\d+)?\z/ &&
|
|
170
|
+
Gem::Version.new(rails_version) >= Gem::Version.new('7.1'))
|
|
171
|
+
gem 'solid_queue', require: nil if solid_queue_compatible
|
|
172
|
+
end
|
|
173
|
+
|
|
143
174
|
if RUBY_PLATFORM == 'java'
|
|
144
175
|
# See issue #6547 in the JRuby repo. It is fixed in JRuby 9.3
|
|
145
176
|
gem 'i18n', '< 1.8.8' if JRUBY_VERSION < '9.3'
|
|
@@ -168,7 +199,13 @@ end
|
|
|
168
199
|
|
|
169
200
|
# sneakers main only supports >=2.5.0
|
|
170
201
|
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.5.0') && !defined?(JRUBY_VERSION)
|
|
171
|
-
|
|
202
|
+
# The sneakers gem was renamed to kicks, which SneakersSpy also instruments.
|
|
203
|
+
# Set SNEAKERS_GEM=kicks to run the suite against it instead.
|
|
204
|
+
if ENV['SNEAKERS_GEM'] == 'kicks'
|
|
205
|
+
gem 'kicks', '>= 2.12.0', require: nil
|
|
206
|
+
else
|
|
207
|
+
gem 'sneakers', github: 'jondot/sneakers', ref: 'd761dfe1493', require: nil
|
|
208
|
+
end
|
|
172
209
|
end
|
|
173
210
|
|
|
174
211
|
if Gem::Version.create(RUBY_VERSION) <= Gem::Version.create('2.5.0')
|
|
@@ -31,3 +31,17 @@ Or if you prefer environment variables, skip the file and set `ELASTIC_APM_SERVE
|
|
|
31
31
|
|
|
32
32
|
This automatically sets up error logging and performance tracking but of course there are knobs to turn if you’d like to. See [*Configuration*](/reference/configuration.md).
|
|
33
33
|
|
|
34
|
+
To load the gem without starting the agent in a particular Rails environment,
|
|
35
|
+
set [`enabled`](/reference/configuration.md#config-enabled) to `false`.
|
|
36
|
+
For example, to start the agent only in production, use ERB in
|
|
37
|
+
`config/elastic_apm.yml`:
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
enabled: <%= Rails.env.production? %>
|
|
41
|
+
server_url: http://localhost:8200
|
|
42
|
+
secret_token: ''
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
You can also set `ELASTIC_APM_ENABLED=false` in an environment where the agent
|
|
46
|
+
should not start. The `ElasticAPM` API remains available when the agent is
|
|
47
|
+
disabled, but calls that collect data return `nil`.
|
data/docs/reference/graphql.md
CHANGED
|
@@ -16,7 +16,7 @@ The Elastic APM Ruby Agent has built-in support for many frameworks and librarie
|
|
|
16
16
|
|
|
17
17
|
## Ruby [supported-technologies-ruby]
|
|
18
18
|
|
|
19
|
-
We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/) <
|
|
19
|
+
We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/) < 5.0.
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
## Web Frameworks and Libraries [supported-technologies-web]
|
|
@@ -28,7 +28,7 @@ We test against all supported minor versions of Rails, Sinatra, and Grape.
|
|
|
28
28
|
|
|
29
29
|
### Ruby on Rails [supported-technologies-rails]
|
|
30
30
|
|
|
31
|
-
We currently support Rails >= 4.2 <=
|
|
31
|
+
We currently support Rails >= 4.2 <= 8.1. This follows Rails' own [Security policy](https://rubyonrails.org/security/).
|
|
32
32
|
|
|
33
33
|
See [Getting started with Rails](/reference/getting-started-rails.md).
|
|
34
34
|
|
|
@@ -80,6 +80,7 @@ We automatically instrument background processing using:
|
|
|
80
80
|
* Sneakers (2.12.0) (Experimental, see [#676](https://github.com/elastic/apm-agent-ruby/pull/676))
|
|
81
81
|
* Resque (>= 2.0.0 <= 2.7.0)
|
|
82
82
|
* SuckerPunch (>= 2.0.0 <= 3.3.0)
|
|
83
|
+
* Solid Queue (>= 1.0.0)
|
|
83
84
|
|
|
84
85
|
|
|
85
86
|
## Resque [supported-technologies-resque]
|
|
@@ -131,4 +132,3 @@ To instrument a server, add the `ElasticAPM::GRPC::ServerInterceptor`.
|
|
|
131
132
|
```ruby
|
|
132
133
|
GRPC::RpcServer.new(interceptors: [ElasticAPM::GRPC::ServerInterceptor.new])
|
|
133
134
|
```
|
|
134
|
-
|
data/docs/release-notes/index.md
CHANGED
|
@@ -28,7 +28,25 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
28
28
|
|
|
29
29
|
% ### Fixes [elastic-apm-ruby-agent-versionext-fixes]
|
|
30
30
|
|
|
31
|
+
## 4.10.0 [elastic-apm-ruby-agent-4100-release-notes]
|
|
32
|
+
**Release date:** November 20, 2026
|
|
33
|
+
|
|
34
|
+
### Features and enhancements [elastic-apm-ruby-agent-4100-features-enhancements]
|
|
35
|
+
* Add support for Solid Queue [#1623](https://github.com/elastic/apm-agent-ruby/pull/1623)
|
|
36
|
+
* Add trace context in Sidekiq to connect request transaction and worker in the one trace [#1456](https://github.com/elastic/apm-agent-ruby/pull/1456)
|
|
37
|
+
* Add compatibility for `.trace_with` in graphql-ruby 2.3+ [#1446](https://github.com/elastic/apm-agent-ruby/pull/1446)
|
|
38
|
+
* Relax required ruby version to support Ruby 4 [#1650](https://github.com/elastic/apm-agent-ruby/pull/1650)
|
|
39
|
+
* Add changelog_uri to gemspec [#1462](https://github.com/elastic/apm-agent-ruby/pull/1462)
|
|
40
|
+
|
|
41
|
+
### Fixes [elastic-apm-ruby-agent-4100-fixes]
|
|
42
|
+
* Include user context in newly built Error [#1644](https://github.com/elastic/apm-agent-ruby/pull/1644)
|
|
43
|
+
* Fix deprecated `JSON.fast_generate` [#1552](https://github.com/elastic/apm-agent-ruby/pull/1552)
|
|
44
|
+
* Fallback to kicks gem for version check in SneakersSpy [#1655](https://github.com/elastic/apm-agent-ruby/pull/1655)
|
|
45
|
+
* Check for default gemfile instead of bundler directory when looking for bundler path [#1477](https://github.com/elastic/apm-agent-ruby/pull/1477)
|
|
46
|
+
* Exclude .ci, .github, and bench directories from gem package [#1657](https://github.com/elastic/apm-agent-ruby/pull/1657)
|
|
47
|
+
|
|
31
48
|
## 4.9.0 [elastic-apm-ruby-agent-490-release-notes]
|
|
49
|
+
**Release date:** June 19, 2026
|
|
32
50
|
|
|
33
51
|
### Features and enhancements [elastic-apm-ruby-agent-490-features-enhancements]
|
|
34
52
|
* Add ability to configure sampling rate based on transaction span name [#1531](https://github.com/elastic/apm-agent-ruby/pull/1531)
|
|
@@ -39,21 +57,25 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
39
57
|
* Use headers method directly for compatibility with all versions of http [#1629](https://github.com/elastic/apm-agent-ruby/pull/1629)
|
|
40
58
|
|
|
41
59
|
## 4.8.0 [elastic-apm-ruby-agent-480-release-notes]
|
|
60
|
+
**Release date:** May 7, 2025
|
|
42
61
|
|
|
43
62
|
### Features and enhancements [elastic-apm-ruby-agent-480-features-enhancements]
|
|
44
63
|
* Support ruby 3.4 [#1510](https://github.com/elastic/apm-agent-ruby/pull/1510)
|
|
45
64
|
|
|
46
65
|
## 4.7.3 [elastic-apm-ruby-agent-473-release-notes]
|
|
66
|
+
**Release date:** April 8, 2024
|
|
47
67
|
|
|
48
68
|
### Fixes [elastic-apm-ruby-agent-473-fixes]
|
|
49
69
|
* Address a bug where if `capture_headers` is false, `ContextBuilder` will raise `"undefined method 'has_key?' for nil:NilClass"` [#1449](https://github.com/elastic/apm-agent-ruby/pull/1449)
|
|
50
70
|
|
|
51
71
|
## 4.7.2 [elastic-apm-ruby-agent-472-release-notes]
|
|
72
|
+
**Release date:** January 23, 2024
|
|
52
73
|
|
|
53
74
|
### Fixes [elastic-apm-ruby-agent-472-fixes]
|
|
54
75
|
* Address machineType not being returned in GCP metadata [#1435](https://github.com/elastic/apm-agent-ruby/pull/1435)
|
|
55
76
|
|
|
56
77
|
## 4.7.1 [elastic-apm-ruby-agent-471-release-notes]
|
|
78
|
+
**Release date:** January 11, 2024
|
|
57
79
|
|
|
58
80
|
### Fixes [elastic-apm-ruby-agent-471-fixes]
|
|
59
81
|
* Skip capturing cookie header when it’s set separately [#1405](https://github.com/elastic/apm-agent-ruby/pull/1405)
|
|
@@ -65,6 +87,7 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
65
87
|
* Guard against various Faraday exception response formats [#1428](https://github.com/elastic/apm-agent-ruby/pull/1428)
|
|
66
88
|
|
|
67
89
|
## 4.7.0 [elastic-apm-ruby-agent-470-release-notes]
|
|
90
|
+
**Release date:** August 17, 2023
|
|
68
91
|
|
|
69
92
|
### Features and enhancements [elastic-apm-ruby-agent-470-features-enhancements]
|
|
70
93
|
* Add keyword args for span_method helper [#1395](https://github.com/elastic/apm-agent-ruby/pull/1395)
|
|
@@ -74,11 +97,13 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
74
97
|
* Fix error with invalid %-encoding [#1400](https://github.com/elastic/apm-agent-ruby/pull/1400)
|
|
75
98
|
|
|
76
99
|
## 4.6.2 [elastic-apm-ruby-agent-462-release-notes]
|
|
100
|
+
**Release date:** March 22, 2023
|
|
77
101
|
|
|
78
102
|
### Fixes [elastic-apm-ruby-agent-462-fixes]
|
|
79
103
|
* Fix Faraday::RackBuilder::StackLocked [#1371](https://github.com/elastic/apm-agent-ruby/pull/1371)
|
|
80
104
|
|
|
81
105
|
## 4.6.1 [elastic-apm-ruby-agent-461-release-notes]
|
|
106
|
+
**Release date:** March 1, 2023
|
|
82
107
|
|
|
83
108
|
### Fixes [elastic-apm-ruby-agent-461-fixes]
|
|
84
109
|
* Fix growing number of open file descriptors when HTTP request to APM is never sent [#1351](https://github.com/elastic/apm-agent-ruby/pull/1351)
|
|
@@ -86,6 +111,7 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
86
111
|
* Handle whitespace when splitting tracestate entries [#1353](https://github.com/elastic/apm-agent-ruby/pull/1353)
|
|
87
112
|
|
|
88
113
|
## 4.6.0 [elastic-apm-ruby-agent-460-release-notes]
|
|
114
|
+
**Release date:** January 11, 2023
|
|
89
115
|
|
|
90
116
|
### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
|
|
91
117
|
* Added transaction_name to reported error to allow grouping by transaction name [#1267](https://github.com/elastic/apm-agent-ruby/pull/1267)
|
|
@@ -103,8 +129,9 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
103
129
|
* Don’t send unsampled transactions to APM server >= 8.0 [#1341](https://github.com/elastic/apm-agent-ruby/pull/1341)
|
|
104
130
|
|
|
105
131
|
## 4.5.1 [elastic-apm-ruby-agent-451-release-notes]
|
|
132
|
+
**Release date:** May 17, 2022
|
|
106
133
|
|
|
107
|
-
### Features and enhancements [elastic-apm-ruby-agent-
|
|
134
|
+
### Features and enhancements [elastic-apm-ruby-agent-451-features-enhancements]
|
|
108
135
|
* Update elasticsearch spy to use new transport gem name [#1257](https://github.com/elastic/apm-agent-ruby/pull/1257)
|
|
109
136
|
* Standardize placeholder for phone numbers as [PHONENUMBER] per [https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-aws.md](https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-aws.md) [#1246](https://github.com/elastic/apm-agent-ruby/pull/1246)
|
|
110
137
|
|
|
@@ -113,8 +140,9 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
113
140
|
* Fixed warnings related to TimeTask timeouts [#1255](https://github.com/elastic/apm-agent-ruby/pull/1255)
|
|
114
141
|
|
|
115
142
|
## 4.5.0 [elastic-apm-ruby-agent-450-release-notes]
|
|
143
|
+
**Release date:** December 3, 2021
|
|
116
144
|
|
|
117
|
-
### Features and enhancements [elastic-apm-ruby-agent-
|
|
145
|
+
### Features and enhancements [elastic-apm-ruby-agent-450-features-enhancements]
|
|
118
146
|
* Stop collecting the field `http.request.socket.encrypted` [#1181](https://github.com/elastic/apm-agent-ruby/pull/1181)
|
|
119
147
|
|
|
120
148
|
### Fixes [elastic-apm-ruby-agent-450-fixes]
|
|
@@ -124,8 +152,9 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
124
152
|
* Update user agent info to match spec [#1182](https://github.com/elastic/apm-agent-ruby/pull/1182)
|
|
125
153
|
|
|
126
154
|
## 4.4.0 [elastic-apm-ruby-agent-440-release-notes]
|
|
155
|
+
**Release date:** October 25, 2021
|
|
127
156
|
|
|
128
|
-
### Features and enhancements [elastic-apm-ruby-agent-
|
|
157
|
+
### Features and enhancements [elastic-apm-ruby-agent-440-features-enhancements]
|
|
129
158
|
* Optional span to be ended instead of current span [#1039](https://github.com/elastic/apm-agent-ruby/pull/1039)
|
|
130
159
|
* Config option `log_ecs_formatting` [#1053](https://github.com/elastic/apm-agent-ruby/pull/1053)
|
|
131
160
|
|
|
@@ -133,11 +162,13 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
133
162
|
* Fixed detecting Linux on Alpine for CPU/MEM metrics [#1057](https://github.com/elastic/apm-agent-ruby/pull/1057)
|
|
134
163
|
|
|
135
164
|
## 4.3.0 [elastic-apm-ruby-agent-430-release-notes]
|
|
165
|
+
**Release date:** July 26, 2021
|
|
136
166
|
|
|
137
167
|
### Features and enhancements [elastic-apm-ruby-agent-430-features-enhancements]
|
|
138
168
|
* Add JVM memory metrics [#1040](https://github.com/elastic/apm-agent-ruby/pull/1040)
|
|
139
169
|
|
|
140
170
|
## 4.2.0 [elastic-apm-ruby-agent-420-release-notes]
|
|
171
|
+
**Release date:** July 7, 2021
|
|
141
172
|
|
|
142
173
|
### Features and enhancements [elastic-apm-ruby-agent-420-features-enhancements]
|
|
143
174
|
* Add support for AWS Storage Table/CosmosDB [#999](https://github.com/elastic/apm-agent-ruby/pull/999)
|
|
@@ -148,6 +179,7 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
148
179
|
* Fix growing number of open file descriptors [#1033](https://github.com/elastic/apm-agent-ruby/pull/1033)
|
|
149
180
|
|
|
150
181
|
## 4.1.0 [elastic-apm-ruby-agent-410-release-notes]
|
|
182
|
+
**Release date:** May 27, 2021
|
|
151
183
|
|
|
152
184
|
### Features and enhancements [elastic-apm-ruby-agent-410-features-enhancements]
|
|
153
185
|
* Azure App Services instance metadata [#1007](https://github.com/elastic/apm-agent-ruby/pull/1007)
|
|
@@ -160,6 +192,7 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
160
192
|
* Fix missing `environment` param when fetching from Central Config [#1014](https://github.com/elastic/apm-agent-ruby/pull/1014)
|
|
161
193
|
|
|
162
194
|
## 4.0.0 [elastic-apm-ruby-agent-400-release-notes]
|
|
195
|
+
**Release date:** April 27, 2021
|
|
163
196
|
|
|
164
197
|
### Features and enhancements [elastic-apm-ruby-agent-400-features-enhancements]
|
|
165
198
|
* Be aware that this release changes the agent’s general approach to instrumenting third party libraries. It now uses `Module#prepend` over alias method chaining. This doesn’t necessarily impact your application but it could if you are using other gems that use the old approach to patch the same method. Mixing the two approaches can lead to infinite recursion.
|
|
@@ -179,4 +212,3 @@ All notable changes to this project will be documented here. This project adhere
|
|
|
179
212
|
* AWS S3 spy accepts symbol bucket names [#998](https://github.com/elastic/apm-agent-ruby/pull/998)
|
|
180
213
|
* AWS S3 spy passing on blocks [#998](https://github.com/elastic/apm-agent-ruby/pull/998)
|
|
181
214
|
* SQL scanner now recognizes CQL style comments [#1004](https://github.com/elastic/apm-agent-ruby/pull/1004)
|
|
182
|
-
|
data/elastic-apm.gemspec
CHANGED
|
@@ -27,12 +27,15 @@ Gem::Specification.new do |spec|
|
|
|
27
27
|
|
|
28
28
|
spec.summary = 'The official Elastic APM agent for Ruby'
|
|
29
29
|
spec.homepage = 'https://github.com/elastic/apm-agent-ruby'
|
|
30
|
-
spec.metadata = {
|
|
30
|
+
spec.metadata = {
|
|
31
|
+
'source_code_uri' => 'https://github.com/elastic/apm-agent-ruby',
|
|
32
|
+
'changelog_uri' => 'https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes.html'
|
|
33
|
+
}
|
|
31
34
|
spec.license = 'Apache-2.0'
|
|
32
|
-
spec.required_ruby_version = ">= 2.3.0", "<
|
|
35
|
+
spec.required_ruby_version = ">= 2.3.0", "< 5.0"
|
|
33
36
|
|
|
34
37
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
35
|
-
f.match(%r{^(test|spec|features)/})
|
|
38
|
+
f.match(%r{^(test|spec|features|bench|\.ci|\.github)/})
|
|
36
39
|
end
|
|
37
40
|
|
|
38
41
|
spec.add_dependency('concurrent-ruby', '~> 1.0')
|
data/lib/elastic_apm/config.rb
CHANGED
|
@@ -86,6 +86,7 @@ module ElasticAPM
|
|
|
86
86
|
|
|
87
87
|
Util.reverse_merge!(error.context.labels, transaction.context.labels)
|
|
88
88
|
Util.reverse_merge!(error.context.custom, transaction.context.custom)
|
|
89
|
+
error.context.user = transaction.context.user if error.context.user.empty?
|
|
89
90
|
end
|
|
90
91
|
end
|
|
91
92
|
end
|
data/lib/elastic_apm/graphql.rb
CHANGED
|
@@ -48,6 +48,14 @@ module ElasticAPM
|
|
|
48
48
|
# "authorized" => "graphql.authorized",
|
|
49
49
|
}.freeze
|
|
50
50
|
|
|
51
|
+
KEYS_TO_NAME.each_key do |trace_method|
|
|
52
|
+
module_eval <<-RUBY, __FILE__, __LINE__
|
|
53
|
+
def #{trace_method}(**data)
|
|
54
|
+
::ElasticAPM::GraphQL.trace("#{trace_method}", data) { super }
|
|
55
|
+
end
|
|
56
|
+
RUBY
|
|
57
|
+
end
|
|
58
|
+
|
|
51
59
|
# rubocop:disable Style/ExplicitBlockArgument
|
|
52
60
|
def self.trace(key, data)
|
|
53
61
|
return yield unless KEYS_TO_NAME.key?(key)
|
|
@@ -30,7 +30,7 @@ module ElasticAPM
|
|
|
30
30
|
class Middleware
|
|
31
31
|
def call(_worker, job, queue)
|
|
32
32
|
name = SidekiqSpy.name_for(job)
|
|
33
|
-
transaction = ElasticAPM.start_transaction(name, 'Sidekiq')
|
|
33
|
+
transaction = ElasticAPM.start_transaction(name, 'Sidekiq', trace_context: get_trace_context_from(job))
|
|
34
34
|
ElasticAPM.set_label(:queue, queue)
|
|
35
35
|
|
|
36
36
|
yield
|
|
@@ -45,6 +45,35 @@ module ElasticAPM
|
|
|
45
45
|
ensure
|
|
46
46
|
ElasticAPM.end_transaction
|
|
47
47
|
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
def get_trace_context_from(job)
|
|
52
|
+
return unless job['elastic_trace_context']
|
|
53
|
+
|
|
54
|
+
ElasticAPM::TraceContext.parse(metadata: job['elastic_trace_context'])
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# @api private
|
|
59
|
+
class ClientMiddleware
|
|
60
|
+
def call(_worker_class, job, _queue, _redis_pool)
|
|
61
|
+
job['elastic_trace_context'] = elastic_trace_context
|
|
62
|
+
yield
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
private
|
|
66
|
+
|
|
67
|
+
def elastic_trace_context
|
|
68
|
+
return unless ElasticAPM.current_transaction
|
|
69
|
+
|
|
70
|
+
trace_context = ElasticAPM.current_transaction.trace_context
|
|
71
|
+
|
|
72
|
+
{
|
|
73
|
+
'traceparent' => trace_context.traceparent.to_header,
|
|
74
|
+
'tracestate' => trace_context.tracestate.to_header
|
|
75
|
+
}
|
|
76
|
+
end
|
|
48
77
|
end
|
|
49
78
|
|
|
50
79
|
def self.name_for(job)
|
|
@@ -64,6 +93,12 @@ module ElasticAPM
|
|
|
64
93
|
chain.add Middleware
|
|
65
94
|
end
|
|
66
95
|
end
|
|
96
|
+
|
|
97
|
+
Sidekiq.configure_client do |config|
|
|
98
|
+
config.server_middleware do |chain|
|
|
99
|
+
chain.add ClientMiddleware
|
|
100
|
+
end
|
|
101
|
+
end
|
|
67
102
|
end
|
|
68
103
|
|
|
69
104
|
# @api private
|
|
@@ -24,8 +24,11 @@ module ElasticAPM
|
|
|
24
24
|
class SneakersSpy
|
|
25
25
|
include Logging
|
|
26
26
|
|
|
27
|
+
# The sneakers gem was renamed to kicks, which still ships
|
|
28
|
+
# `lib/sneakers.rb` but registers under a different gem name.
|
|
27
29
|
def self.supported_version?
|
|
28
|
-
Gem.loaded_specs['sneakers']
|
|
30
|
+
spec = Gem.loaded_specs['sneakers'] || Gem.loaded_specs['kicks']
|
|
31
|
+
spec && spec.version >= Gem::Version.create('2.12.0')
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
def install
|
|
@@ -0,0 +1,80 @@
|
|
|
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
|
+
|
|
18
|
+
# frozen_string_literal: true
|
|
19
|
+
|
|
20
|
+
module ElasticAPM
|
|
21
|
+
# @api private
|
|
22
|
+
module Spies
|
|
23
|
+
# @api private
|
|
24
|
+
class SolidQueueSpy
|
|
25
|
+
TYPE = 'SolidQueue'
|
|
26
|
+
|
|
27
|
+
# @api private
|
|
28
|
+
module Ext
|
|
29
|
+
def perform
|
|
30
|
+
name = job&.class_name
|
|
31
|
+
transaction = ElasticAPM.start_transaction(name, TYPE)
|
|
32
|
+
ElasticAPM.set_label(:queue, job.queue_name) if job&.queue_name
|
|
33
|
+
|
|
34
|
+
super
|
|
35
|
+
|
|
36
|
+
transaction&.done 'success'
|
|
37
|
+
transaction&.outcome = Transaction::Outcome::SUCCESS
|
|
38
|
+
rescue ::Exception => e
|
|
39
|
+
ElasticAPM.report(e, handled: false)
|
|
40
|
+
transaction&.done 'error'
|
|
41
|
+
transaction&.outcome = Transaction::Outcome::FAILURE
|
|
42
|
+
raise
|
|
43
|
+
ensure
|
|
44
|
+
ElasticAPM.end_transaction
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def install
|
|
49
|
+
# +SolidQueue::ClaimedExecution+ lives under +app/models+ and is
|
|
50
|
+
# autoloaded via Zeitwerk by the Rails engine.
|
|
51
|
+
#
|
|
52
|
+
# Two hooks are needed:
|
|
53
|
+
# - +after_initialize+ fires after eager loading in production, which
|
|
54
|
+
# is when +ClaimedExecution+ is first defined. +to_prepare+ alone is
|
|
55
|
+
# not enough because Rails runs +to_prepare+ *before* eager loading.
|
|
56
|
+
# - +to_prepare+ handles code reloads in development so the patch
|
|
57
|
+
# survives class unloading between reloads.
|
|
58
|
+
#
|
|
59
|
+
# Fork mode (the default solid_queue supervisor) is handled by the agent
|
|
60
|
+
# itself via +Agent#detect_forking!+ on each +start_transaction+, so no
|
|
61
|
+
# extra lifecycle hook wiring is needed here.
|
|
62
|
+
if defined?(::Rails) && ::Rails.respond_to?(:application) && ::Rails.application
|
|
63
|
+
::Rails.application.config.after_initialize { SolidQueueSpy.prepend_ext }
|
|
64
|
+
::Rails.application.reloader.to_prepare { SolidQueueSpy.prepend_ext }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
SolidQueueSpy.prepend_ext
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def self.prepend_ext
|
|
71
|
+
return unless defined?(::SolidQueue::ClaimedExecution)
|
|
72
|
+
return if ::SolidQueue::ClaimedExecution.include?(Ext)
|
|
73
|
+
|
|
74
|
+
::SolidQueue::ClaimedExecution.prepend(Ext)
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
register 'SolidQueue', 'solid_queue', SolidQueueSpy.new
|
|
79
|
+
end
|
|
80
|
+
end
|
|
@@ -52,7 +52,17 @@ module ElasticAPM
|
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
def self.finalize(io)
|
|
55
|
-
proc
|
|
55
|
+
proc do
|
|
56
|
+
begin
|
|
57
|
+
io.close
|
|
58
|
+
rescue ThreadError
|
|
59
|
+
# io.close is forbidden inside a signal trap context (Ruby raises
|
|
60
|
+
# ThreadError). SolidQueue and other job backends install
|
|
61
|
+
# persistent Signal.trap handlers; GC triggered while a trap is
|
|
62
|
+
# active will fire this finalizer in that context. The OS closes
|
|
63
|
+
# the fd on process exit, so silently skipping here is safe.
|
|
64
|
+
end
|
|
65
|
+
end
|
|
56
66
|
end
|
|
57
67
|
|
|
58
68
|
attr_reader :io
|
|
@@ -87,7 +87,7 @@ module ElasticAPM
|
|
|
87
87
|
# if a filter returns nil, it means skip the event
|
|
88
88
|
return nil if @filters.apply!(serialized) == Filters::SKIP
|
|
89
89
|
|
|
90
|
-
JSON.
|
|
90
|
+
JSON.generate(serialized)
|
|
91
91
|
rescue Exception
|
|
92
92
|
error format('Failed converting event to JSON: %s', resource.inspect)
|
|
93
93
|
error serialized.inspect
|
data/lib/elastic_apm/version.rb
CHANGED
data/updatecli-compose.yaml
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
# https://www.updatecli.io/docs/core/compose/
|
|
3
3
|
policies:
|
|
4
4
|
- name: Handle apm-data server specs
|
|
5
|
-
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-data-spec:0.
|
|
5
|
+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-data-spec:0.7.0@sha256:96dcd9662b92047bc8ea2c5b52f9dc555980aa9135410f221110ef02c62d552c
|
|
6
6
|
values:
|
|
7
7
|
- .ci/updatecli/values.d/scm.yml
|
|
8
8
|
- .ci/updatecli/values.d/apm-data-spec.yml
|
|
9
9
|
- name: Handle apm gherkin specs
|
|
10
|
-
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-gherkin:0.
|
|
10
|
+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-gherkin:0.7.0@sha256:2a33de27ed741acbb8f9fa22360261fe51f2d8e565c09770e3487fc0e3c765d7
|
|
11
11
|
values:
|
|
12
12
|
- .ci/updatecli/values.d/scm.yml
|
|
13
13
|
- .ci/updatecli/values.d/apm-gherkin.yml
|
|
14
14
|
- name: Handle apm json specs
|
|
15
|
-
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-json-specs:0.
|
|
15
|
+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-json-specs:0.7.0@sha256:561aedcc49503da1448759d6b6fcf8f1d08331380de0b70d186ff849020b802a
|
|
16
16
|
values:
|
|
17
17
|
- .ci/updatecli/values.d/scm.yml
|
|
18
18
|
- .ci/updatecli/values.d/apm-json-specs.yml
|
|
19
19
|
- name: Update Updatecli policies
|
|
20
|
-
policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.
|
|
20
|
+
policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.12.0@sha256:6b53297d62350862ce1205fc183539c985464b97678404f7da9c133a442b0576
|
|
21
21
|
values:
|
|
22
22
|
- .ci/updatecli/values.d/scm.yml
|
|
23
23
|
- .ci/updatecli/values.d/update-compose.yml
|