elastic-apm 3.15.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.jenkins_exclude.yml +13 -0
  3. data/.ci/.jenkins_ruby.yml +0 -1
  4. data/.ci/Jenkinsfile +1 -0
  5. data/.github/dependabot.yml +16 -0
  6. data/.rubocop.yml +0 -7
  7. data/CHANGELOG.asciidoc +67 -0
  8. data/Gemfile +3 -1
  9. data/README.md +12 -0
  10. data/bench/report.rb +1 -1
  11. data/bin/run-bdd +17 -0
  12. data/bin/run-tests +1 -1
  13. data/docs/configuration.asciidoc +62 -147
  14. data/docs/release-notes.asciidoc +1 -0
  15. data/docs/upgrading.asciidoc +0 -27
  16. data/lib/elastic_apm.rb +11 -1
  17. data/lib/elastic_apm/agent.rb +6 -2
  18. data/lib/elastic_apm/central_config.rb +6 -5
  19. data/lib/elastic_apm/config.rb +1 -88
  20. data/lib/elastic_apm/config/regexp_list.rb +1 -1
  21. data/lib/elastic_apm/config/wildcard_pattern_list.rb +1 -1
  22. data/lib/elastic_apm/context/response.rb +1 -3
  23. data/lib/elastic_apm/grpc.rb +2 -4
  24. data/lib/elastic_apm/instrumenter.rb +1 -1
  25. data/lib/elastic_apm/metadata/cloud_info.rb +32 -5
  26. data/lib/elastic_apm/metadata/system_info.rb +14 -4
  27. data/lib/elastic_apm/metrics/cpu_mem_set.rb +1 -1
  28. data/lib/elastic_apm/normalizers.rb +2 -2
  29. data/lib/elastic_apm/normalizers/rails/active_record.rb +3 -3
  30. data/lib/elastic_apm/opentracing.rb +3 -2
  31. data/lib/elastic_apm/span.rb +8 -1
  32. data/lib/elastic_apm/span/context.rb +2 -1
  33. data/lib/elastic_apm/span/context/destination.rb +45 -13
  34. data/lib/elastic_apm/span_helpers.rb +6 -8
  35. data/lib/elastic_apm/spies/action_dispatch.rb +10 -9
  36. data/lib/elastic_apm/spies/dynamo_db.rb +15 -9
  37. data/lib/elastic_apm/spies/elasticsearch.rb +32 -29
  38. data/lib/elastic_apm/spies/faraday.rb +62 -56
  39. data/lib/elastic_apm/spies/http.rb +32 -32
  40. data/lib/elastic_apm/spies/mongo.rb +5 -3
  41. data/lib/elastic_apm/spies/net_http.rb +48 -52
  42. data/lib/elastic_apm/spies/rake.rb +28 -26
  43. data/lib/elastic_apm/spies/redis.rb +11 -10
  44. data/lib/elastic_apm/spies/resque.rb +18 -21
  45. data/lib/elastic_apm/spies/s3.rb +21 -22
  46. data/lib/elastic_apm/spies/sequel.rb +42 -48
  47. data/lib/elastic_apm/spies/sidekiq.rb +13 -15
  48. data/lib/elastic_apm/spies/sinatra.rb +20 -21
  49. data/lib/elastic_apm/spies/sns.rb +42 -41
  50. data/lib/elastic_apm/spies/sqs.rb +23 -25
  51. data/lib/elastic_apm/spies/tilt.rb +10 -9
  52. data/lib/elastic_apm/sql/tokenizer.rb +21 -5
  53. data/lib/elastic_apm/stacktrace_builder.rb +3 -1
  54. data/lib/elastic_apm/trace_context.rb +5 -13
  55. data/lib/elastic_apm/trace_context/traceparent.rb +5 -6
  56. data/lib/elastic_apm/transport/connection.rb +1 -1
  57. data/lib/elastic_apm/transport/connection/http.rb +1 -1
  58. data/lib/elastic_apm/transport/connection/proxy_pipe.rb +1 -2
  59. data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +5 -23
  60. data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +3 -2
  61. data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +2 -2
  62. data/lib/elastic_apm/transport/serializers/span_serializer.rb +13 -9
  63. data/lib/elastic_apm/transport/user_agent.rb +3 -2
  64. data/lib/elastic_apm/transport/worker.rb +1 -1
  65. data/lib/elastic_apm/util/deep_dup.rb +1 -1
  66. data/lib/elastic_apm/version.rb +1 -1
  67. metadata +5 -5
  68. data/lib/elastic_apm/sql.rb +0 -36
  69. data/lib/elastic_apm/sql_summarizer.rb +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ee845be05bcd6dbd56efb3f21372b0abfede8c37b4c7f9580b82ea6a24238fc5
4
- data.tar.gz: 46365fa74214843bc882163c917b429beba61d35f65032f45321ce0e128ecf38
3
+ metadata.gz: b9c57d8f754de9ab6d024f95f2822b0eae82f17a00cd3edae13d290c9b850393
4
+ data.tar.gz: 4d32a175d46dac86cabdf97de023a49e7e5eb155a21be11eb227bf61afdb8ffc
5
5
  SHA512:
6
- metadata.gz: 821287e4a80cdf707c6bcddb50ff1cf9592e5410c99e09b69dbebbcc4915a9aae968f8bc1704454ad06a964f173e49b8534a5923d059ef4a70417b74b2b285e8
7
- data.tar.gz: 5344fb235b378cff3610c0e49771737ba4c906343025110eb38e277f0cb27a6419e76834baf275ebfb2d59ea8e4b94298b65ebe757dcd7fd9cd0d63727a4fe77
6
+ metadata.gz: '09cddb89d0d5265c7c12e8838702cde336754e197d8f4e6647f3885ccde3f6fc806f91b22ab054cf8c5c465373e34bf0f46580a2ab01513da5246d9ea443bb2c'
7
+ data.tar.gz: 10732912f09d131204363dd0191e59f689d9560935af8df0b195cd4a145e9402c4a5f3cc3ed136399471f1a406efd7202a7d8384772bc6356b4a64752333cd03
@@ -34,6 +34,19 @@ exclude:
34
34
  FRAMEWORK: rails-4.2
35
35
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
36
36
  FRAMEWORK: rails-4.2
37
+ # sinatra-1.4 exclusions
38
+ - RUBY_VERSION: ruby:3.0
39
+ FRAMEWORK: sinatra-1.4
40
+ - RUBY_VERSION: ruby:2.7
41
+ FRAMEWORK: sinatra-1.4
42
+ - RUBY_VERSION: jruby:9.2
43
+ FRAMEWORK: sinatra-1.4
44
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
45
+ FRAMEWORK: sinatra-1.4
46
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
47
+ FRAMEWORK: sinatra-1.4
48
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
49
+ FRAMEWORK: sinatra-1.4
37
50
 
38
51
  # rails-6.0 and rails-6.1 exclusions
39
52
  # Don't test on ruby 2.4
@@ -4,7 +4,6 @@ RUBY_VERSION:
4
4
  - ruby:2.6
5
5
  - ruby:2.5
6
6
  - ruby:2.4
7
- - ruby:2.3
8
7
  - jruby:9.2
9
8
  - docker.elastic.co/observability-ci/jruby:9.2-13-jdk
10
9
  - docker.elastic.co/observability-ci/jruby:9.2-11-jdk
data/.ci/Jenkinsfile CHANGED
@@ -389,6 +389,7 @@ def runScript(Map params = [:]){
389
389
  dir("${BASE_DIR}"){
390
390
  sleep randomNumber(min:10, max: 30)
391
391
  dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
392
+ sh(label: "Run BDD tests", script: "./spec/scripts/features.sh ${ruby}")
392
393
  sh("./spec/scripts/spec.sh ${ruby} ${framework}")
393
394
  }
394
395
  }
@@ -0,0 +1,16 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ open-pull-requests-limit: 10
8
+ ignore:
9
+ - dependency-name: sucker_punch
10
+ versions:
11
+ - "> 2.0"
12
+ - dependency-name: i18n
13
+ versions:
14
+ - 1.8.10
15
+ - 1.8.8
16
+ - 1.8.9
data/.rubocop.yml CHANGED
@@ -132,10 +132,3 @@ Style/StringConcatenation:
132
132
 
133
133
  Style/DocumentDynamicEvalDefinition:
134
134
  Enabled: false
135
-
136
- # Applies to > ruby 2.3, enable when 2.3 support is dropped
137
- Performance/RegexpMatch:
138
- Enabled: false
139
-
140
- Style/HashTransformValues:
141
- Enabled: false
data/CHANGELOG.asciidoc CHANGED
@@ -32,6 +32,73 @@ endif::[]
32
32
  ==== Unreleased
33
33
  ////
34
34
 
35
+ [[release-notes-4.x]]
36
+ === Ruby Agent version 4.x
37
+
38
+ [[release-notes-4.1.0]]
39
+ ==== 4.1.0
40
+
41
+ [float]
42
+ ===== Added
43
+
44
+ - Azure App Services instance metadata {pull}1007[#1007]
45
+
46
+ [float]
47
+ ===== Changed
48
+
49
+ - `hostname` is now reported split by `configured_hostname` and `detected_hostname` {pull}1009[#1009]
50
+
51
+ [float]
52
+ ===== Fixed
53
+ - `service_node_name` is now correctly reported as `service.node.configured_name` {pull}1009[#1009]
54
+ - Fix JSON parsing when using yajl-ruby {pull}1012[#1012]
55
+ - Fix SpanHelpers when methods take blocks {pull}1013[#1013]
56
+ - Fix missing `environment` param when fetching from Central Config {pull}1014[#1014]
57
+
58
+ [[release-notes-4.0.0]]
59
+ ==== 4.0.0
60
+
61
+ [float]
62
+ ===== Upgrading
63
+
64
+ Be aware that this release changes the agent's general approach to instrumenting third
65
+ party libraries.
66
+ It now uses `Module#prepend` over alias method chaining.
67
+
68
+ This doesn't necessarily impact your application but it could if you are using other gems
69
+ that use the old approach to patch the same method.
70
+ Mixing the two approaches can lead to infinite recursion.
71
+
72
+ [float]
73
+ ===== Removed
74
+
75
+ - Removed support for Ruby 2.3 and JRuby 9.1 {pull}901[#901]
76
+ - Config option `active`, see `enabled` {pull}900[#900]
77
+ - Config option `custom_key_filters`, see `sanitize_field_names` {pull}900[#900]
78
+ - Config option `default_tags`, see `global_labels` {pull}900[#900]
79
+ - Config option `default_labels`, see `global_labels` {pull}900[#900]
80
+ - Config option `ignore_url_patterns`, see `transaction_ignore_urls` {pull}900[#900]
81
+ - Config option `use_legacy_sql_parser`, legacy parser no longer included {pull}900[#900]
82
+
83
+ [float]
84
+ ===== Changed
85
+
86
+ - Integrations (Spies) use Module#prepend over class_eval {pull}890[#890]
87
+ - The secrets filter no longer filters based on values, see `sanitize_field_names` {pull}900[#900]
88
+ - The secrets filter is aligned with other agents, see `sanitize_field_names` {pull}900[#900]
89
+
90
+ [float]
91
+ ===== Added
92
+
93
+ - Added `set_service` API {pull}1006[#1006]
94
+
95
+ [float]
96
+ ===== Fixed
97
+
98
+ - AWS S3 spy accepts symbol bucket names {pull}998[#998]
99
+ - AWS S3 spy passing on blocks {pull}998[#998]
100
+ - SQL scanner now recognizes CQL style comments {pull}1004[#1004]
101
+
35
102
  [[release-notes-3.x]]
36
103
  === Ruby Agent version 3.x
37
104
 
data/Gemfile CHANGED
@@ -26,6 +26,8 @@ gem 'cucumber', require: false
26
26
  gem 'rack-test'
27
27
  gem 'rspec', '~> 3'
28
28
  gem 'rspec-its'
29
+ gem 'rubocop', require: false
30
+ gem 'rubocop-performance', require: false
29
31
  gem 'timecop'
30
32
  gem 'webmock'
31
33
 
@@ -91,7 +93,7 @@ frameworks_versions.each do |framework, version|
91
93
  end
92
94
 
93
95
  if frameworks_versions.key?('rails')
94
- unless frameworks_versions['rails'] =~ /^(main|6)/
96
+ unless /^(main|6)/.match?(frameworks_versions['rails'])
95
97
  gem 'delayed_job', require: nil
96
98
  end
97
99
  end
data/README.md CHANGED
@@ -52,15 +52,27 @@ The official Rubygem for [Elastic][] [APM][].
52
52
  <li>
53
53
  <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/opentracing.html">OpenTracing API</a>
54
54
  </li>
55
+ <li>
56
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/graphql.html">GraphQL</a>
57
+ </li>
55
58
  <li>
56
59
  <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/log-correlation.html">Log correlation</a>
57
60
  </li>
61
+ <li>
62
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/tuning-and-overhead.html">Performance tuning</a>
63
+ </li>
58
64
  <li>
59
65
  <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/debugging.html">Troubleshooting</a>
60
66
  </li>
67
+ <li>
68
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/upgrading.html">Upgrading</a>
69
+ </li>
61
70
  <li class="collapsible">
62
71
  <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes.html">Release notes</a>
63
72
  <ul>
73
+ <li>
74
+ <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-4.x.html">Ruby Agent version 4.x</a>
75
+ </li>
64
76
  <li>
65
77
  <a href="https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-3.x.html">Ruby Agent version 3.x</a>
66
78
  </li>
data/bench/report.rb CHANGED
@@ -18,7 +18,7 @@ end
18
18
  meta = {
19
19
  executed_at: Time.new.iso8601,
20
20
  'git.commit' => git_sha,
21
- 'git.date' => String(git_date).strip != '' && Time.parse(git_date).iso8601,
21
+ 'git.date' => (String(git_date).strip != '' && Time.parse(git_date).iso8601) || Time.now.iso8601,
22
22
  'git.subject' => git_msg,
23
23
  hostname: `hostname`.chomp,
24
24
  engine: RUBY_ENGINE,
data/bin/run-bdd ADDED
@@ -0,0 +1,17 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ specific_feature=$1
5
+
6
+ export CUCUMBER_PUBLISH_QUIET=true
7
+
8
+ if [[ $specific_feature = '' ]]; then
9
+ echo 'Running all features'
10
+
11
+ echo "========================================"
12
+ cucumber
13
+ else
14
+ echo "Running only $specific_feature"
15
+
16
+ cucumber $specific_feature
17
+ fi
data/bin/run-tests CHANGED
@@ -29,5 +29,5 @@ if [[ $specific_spec = '' ]]; then
29
29
  else
30
30
  echo "Running only $specific_spec"
31
31
 
32
- runRspec $1
32
+ runRspec $specific_spec
33
33
  fi
@@ -1,14 +1,14 @@
1
1
  ifdef::env-github[]
2
2
  NOTE: For the best reading experience,
3
3
  please view this documentation at
4
- https://www.elastic.co/guide/en/apm/agent/ruby/current/introduction.html[elastic.co]
4
+ https://www.elastic.co/guide/en/apm/agent/ruby/current/introduction.html[elastic.co].
5
5
  endif::[]
6
6
 
7
7
  [[configuration]]
8
8
  == Configuration
9
9
 
10
10
  There are several ways to configure how Elastic APM behaves.
11
- The recommended way is to specify options in a `config/elastic_apm.yml` file:
11
+ We recommend using a `config/elastic_apm.yml` file:
12
12
 
13
13
  [source,yaml]
14
14
  ----
@@ -24,7 +24,7 @@ When using this method, strings are split by comma, e.g.,
24
24
  [[configuration-precedence]]
25
25
  === Configuration precedence
26
26
 
27
- Options are applied in the following order (last one wins):
27
+ Options are applied in the following order (last one wins):
28
28
 
29
29
  1. Defaults
30
30
  2. Arguments to `ElasticAPM.start` / `Config.new`
@@ -71,7 +71,7 @@ ElasticAPM.start(
71
71
  )
72
72
  ----
73
73
 
74
- Alternatively, you can use the `ElasticAPM::Sinatra.start` API:
74
+ Alternatively, use the `ElasticAPM::Sinatra.start` API:
75
75
 
76
76
  [source,ruby]
77
77
  ----
@@ -87,7 +87,7 @@ See <<getting-started-rack>>.
87
87
  [float]
88
88
  === Grape and Rack
89
89
 
90
- When using Grape and Rack (without Rails), you can configure when starting
90
+ When using Grape and Rack (without Rails), configure when starting
91
91
  the agent:
92
92
 
93
93
  [source,ruby]
@@ -114,7 +114,7 @@ See <<getting-started-rack>>.
114
114
  | `ELASTIC_APM_CONFIG_FILE` | `config_file` | `config/elastic_apm.yml`
115
115
  |============
116
116
 
117
- Path to the configuration YAML-file.
117
+ The path to the configuration YAML-file.
118
118
  Elastic APM will load config options from this if the file exists.
119
119
  The file will be evaluated as ERB, so you can include `ENV` variables like in
120
120
  your `database.yml`, eg:
@@ -150,7 +150,7 @@ and port.
150
150
 
151
151
  This string is used to ensure that only your agents can send data to your APM server.
152
152
  Both the agents and the APM server have to be configured with the same secret token.
153
- One example to generate a secure secret token is:
153
+ Here's an example that generates a secure secret token:
154
154
 
155
155
  [source,bash]
156
156
  ----
@@ -170,24 +170,9 @@ WARNING: Secret tokens only provide any real security if your APM server uses TL
170
170
  |============
171
171
 
172
172
  This base64-encoded string is used to ensure that only your agents can send data to your APM server.
173
- You must have created the api key using the APM server command line tool. Please see the APM server
174
- documentation for details on how to do that. Please note that this feature is experimental in the
175
- APM server in version 7.6.
173
+ The API key must be created using the {apm-server-ref-v}/api-key.html[APM server command-line tool].
176
174
 
177
- WARNING: Api keys only provide any real security if your APM server uses TLS.
178
-
179
- [float]
180
- [[config-active]]
181
- ==== `active` deprecated:[3.7.0,See <<config-enabled>> instead.]
182
- |============
183
- | Environment | `Config` key | Default
184
- | `ELASTIC_APM_ACTIVE` | `active` | `true`
185
- |============
186
-
187
- Whether or not to start the agent.
188
- If `active` is `false`, `ElasticAPM.start` will do nothing and all calls to the root API will return `nil`.
189
-
190
- NOTE: This option is being removed. See <<config-enabled>> instead.
175
+ WARNING: API keys only provide any real security if your APM server uses TLS.
191
176
 
192
177
  [float]
193
178
  [[config-api-buffer-size]]
@@ -197,12 +182,11 @@ NOTE: This option is being removed. See <<config-enabled>> instead.
197
182
  | `ELASTIC_APM_API_BUFFER_SIZE` | `api_buffer_size` | `256`
198
183
  |============
199
184
 
200
- Maximum amount of objects kept in queue, before sending to APM Server.
185
+ The maximum amount of objects kept in queue before sending to APM Server.
201
186
 
202
- If you hit this limit you either have to increase the agent's
203
- <<config-pool-size,worker pool size>> or it could mean the agent has trouble
204
- connecting to APM Server. The <<config-log-path,logs>> should tell you what
205
- went wrong.
187
+ If you hit the limit, consider increasing the agent's <<config-pool-size,worker pool size>>.
188
+ If you don't, the agent may have trouble connecting to APM Server.
189
+ The <<config-log-path,logs>> should tell you what went wrong.
206
190
 
207
191
  [float]
208
192
  [[config-api-request-size]]
@@ -215,10 +199,9 @@ went wrong.
215
199
  | `ELASTIC_APM_API_REQUEST_SIZE` | `api_request_size` | `"750kb"`
216
200
  |============
217
201
 
218
- Maximum amount of bytes sent over one request to APM Server. When reached the agent
219
- will open a new request.
202
+ The maximum amount of bytes sent over one request to APM Server. The agent will open a new request when this limit is reached.
220
203
 
221
- It has to be provided in *<<config-format-size, size format>>*.
204
+ This must be provided in *<<config-format-size, size format>>*.
222
205
 
223
206
  [float]
224
207
  [[config-api-request-time]]
@@ -231,12 +214,11 @@ It has to be provided in *<<config-format-size, size format>>*.
231
214
  | `ELASTIC_APM_API_REQUEST_TIME` | `api_request_time` | `"10s"`
232
215
  |============
233
216
 
234
- Maximum duration of a single streaming request to APM Server before opening
217
+ The maximum duration of a single streaming request to APM Server before opening
235
218
  a new one.
236
219
 
237
- APM Server has its own limit of 30 seconds before it will close requests.
238
-
239
- It has to be provided in *<<config-format-duration, duration format>>*.
220
+ The APM Server has its own limit of 30 seconds before it will close requests.
221
+ This must be provided in *<<config-format-duration, duration format>>*.
240
222
 
241
223
  [float]
242
224
  [[config-breakdown-metrics]]
@@ -246,8 +228,8 @@ It has to be provided in *<<config-format-duration, duration format>>*.
246
228
  | `ELASTIC_APM_BREAKDOWN_METRICS` | `breakdown_metrics` | `true`
247
229
  |============
248
230
 
249
- Enable/disable the tracking and collection of breakdown metrics.
250
- By setting this to `False`, tracking this metric is completely disabled, which can reduce the overhead of the agent.
231
+ Enable or disable the tracking and collection of breakdown metrics.
232
+ Setting this to `False` disables the tracking of breakdown metrics, which can reduce the overhead of the agent.
251
233
 
252
234
  NOTE: This feature requires APM Server and Kibana >= 7.3.
253
235
 
@@ -262,14 +244,13 @@ NOTE: This feature requires APM Server and Kibana >= 7.3.
262
244
  | `ELASTIC_APM_CAPTURE_BODY` | `capture_body` | `"off"` | `"all"`
263
245
  |============
264
246
 
265
- For transactions that are HTTP requests,
266
- the Ruby agent can optionally capture the request body (e.g. `POST` variables or JSON data).
247
+ The Ruby agent can optionally capture the request body (e.g. `POST` variables or JSON data) for transactions that are HTTP requests.
267
248
 
268
249
  Possible values: `"errors"`, `"transactions"`, `"all"`, `"off"`.
269
250
 
270
251
  If the request has a body and this setting is disabled, the body will be shown as `[SKIPPED]`.
271
252
 
272
- WARNING: request bodies often contain sensitive values like passwords, credit card numbers etc.
253
+ WARNING: Request bodies often contain sensitive values like passwords and credit card numbers.
273
254
  We try to strip sensitive looking data from form bodies but don't touch text bodies like JSON.
274
255
  If your service handles data like this, we advise to only enable this feature with care.
275
256
 
@@ -285,7 +266,7 @@ If your service handles data like this, we advise to only enable this feature wi
285
266
  | `ELASTIC_APM_CAPTURE_HEADERS` | `capture_headers` | `true`
286
267
  |============
287
268
 
288
- Whether or not to attach the request headers to transactions and errors.
269
+ This indicates whether or not to attach the request headers to transactions and errors.
289
270
 
290
271
  [float]
291
272
  [[config-capture-elasticsearch-queries]]
@@ -295,7 +276,7 @@ Whether or not to attach the request headers to transactions and errors.
295
276
  | `ELASTIC_APM_CAPTURE_ELASTICSEARCH_QUERIES` | `capture_elasticsearch_queries` | `false`
296
277
  |============
297
278
 
298
- Whether or not to capture the body from requests in Elasticsearch.
279
+ This indicates whether or not to capture the body from requests in Elasticsearch.
299
280
 
300
281
  [float]
301
282
  [[config-capture-env]]
@@ -305,7 +286,7 @@ Whether or not to capture the body from requests in Elasticsearch.
305
286
  | `ELASTIC_APM_CAPTURE_ENV` | `capture_env` | `true`
306
287
  |============
307
288
 
308
- Whether or not to attach `ENV` from Rack to transactions and errors.
289
+ This indicates whether or not to attach `ENV` from Rack to transactions and errors.
309
290
 
310
291
  [float]
311
292
  [[config-central-config]]
@@ -315,10 +296,10 @@ Whether or not to attach `ENV` from Rack to transactions and errors.
315
296
  | `ELASTIC_APM_CENTRAL_CONFIG` | `central_config` | `true`
316
297
  |============
317
298
 
318
- Enables {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
299
+ This enables {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
319
300
  If set to `true`, the client will poll the APM Server regularly for new agent configuration.
320
301
 
321
- Usually APM Server determines how often to poll, but if not the default interval is 5 minutes.
302
+ Usually APM Server determines how often to poll, but if not, set the default interval is 5 minutes.
322
303
 
323
304
  NOTE: This feature requires APM Server v7.3 or later and that the APM Server is configured with `kibana.enabled: true`.
324
305
 
@@ -331,7 +312,7 @@ NOTE: This feature requires APM Server v7.3 or later and that the APM Server is
331
312
  |============
332
313
 
333
314
  Specify the cloud provider for metadata collection.
334
- Defaults to `"auto"`, which means the agent uses trial and
315
+ This defaults to `"auto"`, which means the agent uses trial and
335
316
  error to collect metadata from all supported cloud providers.
336
317
 
337
318
  Valid options are `"auto"`, `"aws"`, `"gcp"`, `"azure"`, and `"none"`.
@@ -339,57 +320,6 @@ If set to `"none"`, no cloud metadata will be collected.
339
320
  If set to any of `"aws"`, `"gcp"`, or `"azure"`,
340
321
  attempts to collect metadata will only be performed from the chosen provider.
341
322
 
342
- [float]
343
- [[config-custom-key-filters]]
344
- ==== `custom_key_filters` deprecated:[3.5.0,See <<config-sanitize-field-names>> instead.]
345
- [options="header"]
346
- |============
347
- | Environment | `Config` key | Default | Example
348
- | `ELASTIC_APM_CUSTOM_KEY_FILTERS` | `custom_key_filters` | `[]` | `['MyAuthHeader']`
349
- |============
350
-
351
- Elastic APM strips
352
- https://github.com/elastic/apm-agent-ruby/blob/1.x/lib/elastic_apm/filters/secrets_filter.rb[
353
- what looks like confidential information] from the request/response headers.
354
- Use this option to add your own custom header keys to the list of filtered keys.
355
-
356
- When setting this option via `ENV`, use a comma separated string.
357
- Eg. `ELASTIC_APM_CUSTOM_KEY_FILTERS="a,b" # => [/a/, /b/]`
358
-
359
- NOTE: This option is being removed. See <<config-sanitize-field-names>> instead.
360
-
361
- [float]
362
- [[config-default-tags]]
363
- ==== `default_tags`
364
-
365
- [options="header"]
366
- |============
367
- | Environment | `Config` key | Default | Example
368
- | `ELASTIC_APM_DEFAULT_LABELS` | `default_labels` | `{}` | `region=us1`
369
- |============
370
-
371
- Add default labels to every transaction. Note that this will eventually be deprecated in favor of `global_labels`.
372
-
373
- WARNING: Be aware that labels are indexed in Elasticsearch. Using too many unique keys will result in *https://www.elastic.co/blog/found-crash-elasticsearch#mapping-explosion[Mapping explosion]*.
374
-
375
- NOTE: `global_labels` are supported as of APM server version 7.2. `default_tags` and `default_labels` will eventually be
376
- deprecated so please transition to using `global_labels` instead. In the meantime, any `default_labels`
377
- that are set will override `global_labels`.
378
-
379
- [options="header"]
380
- |============
381
- | Environment | `Config` key | Default | Example
382
- | `ELASTIC_APM_DEFAULT_TAGS` | `default_tags` | `{}` | `region=us1`
383
- |============
384
-
385
- Add default tags to add to every transaction. Note that this option has been deprecated in favor of `default_labels`.
386
-
387
- WARNING: Be aware that tags are indexed in Elasticsearch. Using too many unique keys will result in *https://www.elastic.co/blog/found-crash-elasticsearch#mapping-explosion[Mapping explosion]*.
388
-
389
- NOTE: `global_labels` are supported as of APM server version 7.2. `default_tags` and `default_labels` will eventually be
390
- deprecated so please transition to using `global_labels` instead. In the meantime, any `default_tags`
391
- that are set will override `global_labels`.
392
-
393
323
  [float]
394
324
  [[config-disable_metrics]]
395
325
  ==== `disable_metrics`
@@ -400,7 +330,7 @@ that are set will override `global_labels`.
400
330
 
401
331
  A comma-separated list of dotted metrics names that should not be sent to the APM Server.
402
332
  You can use `*` to match multiple metrics.
403
- Matching is case-insensitive.
333
+ Matching is not case sensitive.
404
334
 
405
335
  [float]
406
336
  [[config-disable-send]]
@@ -410,7 +340,7 @@ Matching is case-insensitive.
410
340
  | `ELASTIC_APM_DISABLE_SEND` | `disable_send` | `false`
411
341
  |============
412
342
 
413
- Disables sending payloads to APM Server.
343
+ This disables sending payloads to APM Server.
414
344
 
415
345
  [float]
416
346
  [[config-disable-start-message]]
@@ -420,7 +350,7 @@ Disables sending payloads to APM Server.
420
350
  | `ELASTIC_APM_DISABLE_START_MESSAGE` | `disable_start_message` | `false`
421
351
  |============
422
352
 
423
- Disables the agent's startup message announcing itself.
353
+ This disables the agents startup message announcing itself.
424
354
 
425
355
  [float]
426
356
  [[config-disabled-instrumentations]]
@@ -432,7 +362,7 @@ Disables the agent's startup message announcing itself.
432
362
  | `ELASTIC_APM_DISABLE_INSTRUMENTATIONS` | `disable_instrumentations` | `['json']`
433
363
  |============
434
364
 
435
- Elastic APM automatically instruments select third party libraries.
365
+ Elastic APM automatically instruments select third-party libraries.
436
366
  Use this option to disable any of these.
437
367
 
438
368
  Get an array of enabled instrumentations with `ElasticAPM.agent.config.enabled_instrumentations`.
@@ -446,7 +376,7 @@ Get an array of enabled instrumentations with `ElasticAPM.agent.config.enabled_i
446
376
  | `ELASTIC_APM_ENABLED` | `enabled` | `true`
447
377
  |============
448
378
 
449
- Whether or not to start the agent.
379
+ Indicates whether or not to start the agent.
450
380
  If `enabled` is `false`, `ElasticAPM.start` will do nothing and all calls to the root API will return `nil`.
451
381
 
452
382
  [float]
@@ -463,7 +393,7 @@ The name of the environment this service is deployed in,
463
393
  e.g. "production" or "staging".
464
394
 
465
395
  Environments allow you to easily filter data on a global level in the APM app.
466
- It's important to be consistent when naming environments across agents.
396
+ Be consistent when naming environments across agents.
467
397
  See {apm-app-ref}/filters.html#environment-selector[environment selector] in the APM app for more information.
468
398
 
469
399
  Defaults to `ENV['RAILS_ENV'] || ENV['RACK_ENV']`.
@@ -490,7 +420,7 @@ Use this to filter error tracking for specific error constants.
490
420
  | `ELASTIC_APM_FRAMEWORK_NAME` | `framework_name` | Depending on framework
491
421
  |============
492
422
 
493
- Name of the used framework.
423
+ The name of the used framework.
494
424
  For Rails or Sinatra, this defaults to `Ruby on Rails` and `Sinatra` respectively,
495
425
  otherwise defaults to `nil`.
496
426
 
@@ -503,7 +433,7 @@ otherwise defaults to `nil`.
503
433
  | `ELASTIC_APM_FRAMEWORK_VERSION` | `framework_version` | Depending on framework
504
434
  |============
505
435
 
506
- Version number of the used framework.
436
+ The version number of the used framework.
507
437
  For Ruby on Rails and Sinatra, this defaults to the used version of the framework,
508
438
  otherwise, the default is `nil`.
509
439
 
@@ -520,9 +450,7 @@ otherwise, the default is `nil`.
520
450
  Labels added to all events, with the format key=value[,key=value[,...]].
521
451
 
522
452
  NOTE: This option requires APM Server 7.2 or greater, and will have no effect when using older
523
- server versions. `default_tags` will eventually be deprecated but in the meantime, their value
524
- will override any `global_labels`. Please transition to using `global_labels` instead of
525
- `default_tags` in light of this deprecation.
453
+ server versions.
526
454
 
527
455
  [float]
528
456
  [[config-hostname]]
@@ -545,12 +473,12 @@ The host name to use when sending error and transaction data to the APM server.
545
473
  | `ELASTIC_APM_IGNORE_URL_PATTERNS` | `ignore_url_patterns` | `[]` | `['^/ping', %r{^/admin}]`
546
474
  |============
547
475
 
548
- Use this option to ignore certain URL patterns eg. healthchecks or admin sections.
476
+ Use this option to ignore certain URL patterns such as healthchecks or admin sections.
549
477
 
550
478
  _Ignoring_ in this context means _don't wrap in a <<api-transaction,Transaction>>_.
551
479
  Errors will still be reported.
552
480
 
553
- When setting this option via `ENV`, use a comma separated string.
481
+ Use a comma separated string when setting this option via `ENV`.
554
482
  Eg. `ELASTIC_APM_IGNORE_URL_PATTERNS="a,b" # => [/a/, /b/]`
555
483
 
556
484
  [float]
@@ -562,7 +490,7 @@ Eg. `ELASTIC_APM_IGNORE_URL_PATTERNS="a,b" # => [/a/, /b/]`
562
490
  | `ELASTIC_APM_INSTRUMENT` | `instrument` | `true` | `0`
563
491
  |============
564
492
 
565
- Use this option to ignore certain URL patterns eg. healthchecks or admin sections.
493
+ Use this option to ignore certain URL patterns such as healthchecks or admin sections.
566
494
 
567
495
  [float]
568
496
  [[config-instrumented-rake-tasks]]
@@ -574,7 +502,7 @@ Use this option to ignore certain URL patterns eg. healthchecks or admin section
574
502
  | `ELASTIC_APM_INSTRUMENTED_RAKE_TASKS` | `instrumented_rake_tasks` | `[]` | `['my_task']`
575
503
  |============
576
504
 
577
- Elastic APM can instrument your Rake tasks but given that they are used for a multitude of sometimes very different and not always relevant things, this is opt in.
505
+ Elastic APM can instrument your Rake tasks. Theis is an opt-in field, as they are used are for a multitude of things.
578
506
 
579
507
  [float]
580
508
  [[config-log-level]]
@@ -604,7 +532,7 @@ A path to a log file.
604
532
 
605
533
  By default Elastic APM logs to `stdout` or uses `Rails.log` when used with Rails.
606
534
 
607
- Should support both absolute and relative paths. Just make sure the directory exists.
535
+ This should support both absolute and relative paths. Please be sure the directory exists.
608
536
 
609
537
  [float]
610
538
  [[config-logger]]
@@ -618,7 +546,7 @@ Should support both absolute and relative paths. Just make sure the directory ex
618
546
 
619
547
  By default Elastic APM logs to `stdout` or uses `Rails.log` when used with Rails.
620
548
 
621
- Use this to provide another logger. Expected to have the same API as Ruby's built-in `Logger`.
549
+ Use this to provide another logger. This is expected to have the same API as Ruby's built-in `Logger`.
622
550
 
623
551
  [float]
624
552
  [[config-metrics-interval]]
@@ -632,7 +560,7 @@ Use this to provide another logger. Expected to have the same API as Ruby's buil
632
560
 
633
561
  Specify the interval for reporting metrics to APM Server.
634
562
  The interval should be in seconds,
635
- or should include a time suffix.
563
+ or include a time suffix.
636
564
 
637
565
  To disable metrics reporting,
638
566
  set the interval to `0`.
@@ -691,7 +619,7 @@ See https://github.com/httprb/http/wiki/Proxy-Support[Http.rb's docs].
691
619
  |============
692
620
 
693
621
  Enable or disable the recording of events.
694
- If set to false, then the agent does not create or send any events to the Elastic APM server,
622
+ If set to `false`, then the agent does not create or send any events to the Elastic APM server,
695
623
  and instrumentation overhead is minimized. The agent continues to poll the server for configuration changes
696
624
  when this option is false.
697
625
 
@@ -701,13 +629,13 @@ when this option is false.
701
629
 
702
630
  [options="header"]
703
631
  |============
704
- | Environment | `Config` key | Default | Example
705
- | `ELASTIC_APM_SANITIZE_FIELD_NAMES` | `sanitize_field_names` | `[]` | `Auth*tion,abc*,*xyz`
632
+ | Environment | `Config` key | Default | Example
633
+ | `ELASTIC_APM_SANITIZE_FIELD_NAMES` | `sanitize_field_names` | `"password,passwd,pwd,secret,*key,*token*,*session*,*credit*,*card*,authorization,set-cookie"` | `Auth*tion,abc*,*xyz`
706
634
  |============
707
635
 
708
- Sometimes it is necessary to sanitize the data sent to Elastic APM, e.g. remove sensitive data.
636
+ Sometimes it is necessary to sanitize the data sent to Elastic APM to remove sensitive values.
709
637
 
710
- Configure a list of wildcard patterns of field names which should be sanitized. These apply to HTTP headers and bodies (if you're capturing those.)
638
+ Configure a list of wildcard patterns of field names which should be sanitized. These apply to HTTP headers and bodies, if they're being captured.
711
639
 
712
640
  Supports the wildcard `*`, which matches zero or more characters.
713
641
  Examples: `/foo/*/bar/*/baz*`, `*foo*`.
@@ -723,16 +651,15 @@ Matching is case insensitive.
723
651
  | `ELASTIC_APM_SERVICE_NAME` | `service_name` | App's name | `MyApp`
724
652
  |============
725
653
 
726
- The name of your service.
727
- This is used to keep all the errors and transactions of your service together and is
654
+ The name of your service. This is used to group the errors and transactions of your service and is
728
655
  the primary filter in the Elastic APM user interface.
729
656
 
730
657
  If you're using Ruby on Rails this will default to your app's name.
731
658
  If you're using Sinatra it will default to the name of your app's class.
732
659
 
733
660
  NOTE: The service name must conform to this regular expression: `^[a-zA-Z0-9 _-]+$`.
734
- In layman's terms: Your service name must only contain characters from the ASCII
735
- alphabet, numbers, dashes, underscores and spaces.
661
+ In other words, it must only contain characters from the ASCII
662
+ alphabet, numbers, dashes, underscores, and spaces.
736
663
 
737
664
  [float]
738
665
  [[config-service-node-name]]
@@ -745,11 +672,10 @@ alphabet, numbers, dashes, underscores and spaces.
745
672
  |============
746
673
 
747
674
  The name of the given service node. This is optional, and if omitted, the APM
748
- Server will fall back on `system.container.id` if available, and finally
675
+ Server will fall back on `system.container.id` if available, and
749
676
  `host.name` if necessary.
750
677
 
751
- This option allows you to set the node name manually to ensure uniqueness and
752
- meaningfulness.
678
+ This option allows you to set the node name manually to ensure it's unique and meaningful.
753
679
 
754
680
  [float]
755
681
  [[config-service-version]]
@@ -760,8 +686,8 @@ meaningfulness.
760
686
  | `ELASTIC_APM_SERVICE_VERSION` | `service_version` | `git` sha | A string indicating the version of the deployed service
761
687
  |============
762
688
 
763
- Deployed version of your service.
764
- Defaults to `git rev-parse --verify HEAD`.
689
+ The deployed version of your service.
690
+ This defaults to `git rev-parse --verify HEAD`.
765
691
 
766
692
  [float]
767
693
  [[config-source-lines-error-app-frames]]
@@ -785,7 +711,7 @@ Defaults to `git rev-parse --verify HEAD`.
785
711
  |============
786
712
 
787
713
  By default, the APM agent collects source code snippets for errors.
788
- With the above settings, you can modify how many lines of source code is collected.
714
+ Use the above settings to modify how many lines of source code are collected.
789
715
 
790
716
  We differ between errors and spans, as well as library frames and app frames.
791
717
 
@@ -803,7 +729,7 @@ storage use in your Elasticsearch cluster.
803
729
  | `ELASTIC_APM_SPAN_FRAMES_MIN_DURATION` | `span_frames_min_duration` | `"5ms"`
804
730
  |============
805
731
 
806
- Use this to disable stacktrace frame collection for spans with a duration shorter
732
+ Use this to disable stack trace frame collection for spans with a duration shorter
807
733
  than or equal to the given amount of milleseconds.
808
734
 
809
735
  The default is `"5ms"`.
@@ -870,18 +796,7 @@ To reduce overhead and storage requirements, you can set the sample rate to a va
870
796
  between `0.0` and `1.0`.
871
797
  We still record overall time and the result for unsampled transactions, but no
872
798
  context information, tags, or spans.
873
- Note that the sample rate will be rounded to 4 digits of precision.
874
-
875
- [float]
876
- [[config-use-experimental-sql-parser]]
877
- ==== `use_legacy_sql_parser`
878
- |============
879
- | Environment | `Config` key | Default
880
- | `ELASTIC_APM_USE_LEGACY_SQL_PARSER` | `use_legacy_sql_parser` | `false`
881
- |============
882
-
883
- Use the older, less precise approach to generating summaries of your app's SQL statements.
884
- Try this if you're experiencing trouble using the new default.
799
+ The sample rate will be rounded to 4 digits of precision.
885
800
 
886
801
  [float]
887
802
  [[config-verify-server-cert]]
@@ -934,14 +849,14 @@ The unit is provided as suffix directly after the number, without any separation
934
849
  * `mb` (megabytes)
935
850
  * `gb` (gigabytes)
936
851
 
937
- NOTE: we use the power-of-two sizing convention, e.g. `1 kilobyte == 1024 bytes`
852
+ NOTE: We use the power-of-two sizing convention, e.g. `1 kilobyte == 1024 bytes`.
938
853
 
939
854
  [float]
940
855
  [[special-configuration]]
941
856
  === Special configuration
942
857
 
943
- Elastic APM patches `Kernel#require` to auto-detect and instrument supported third party libraries. It does so with the utmost care but in rare cases it can conflict with some libraries.
858
+ Elastic APM patches `Kernel#require` to auto-detect and instrument supported third-party libraries. It does so with the utmost care but in rare cases, it can conflict with some libraries.
944
859
 
945
860
  To get around this patch, set the environment variable `ELASTIC_APM_SKIP_REQUIRE_PATCH` to `"1"`.
946
861
 
947
- If you choose to do so, the agent might need some additional tweaking to make sure the third party libraries are picked up and instrumented. Make sure you require the agent _after_ you require your other dependencies.
862
+ The agent might need some additional tweaking to make sure the third-party libraries are picked up and instrumented. Make sure you require the agent _after_ you require your other dependencies.