elastic-apm 3.6.0 → 3.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/Jenkinsfile +183 -100
  3. data/.ci/jobs/defaults.yml +1 -1
  4. data/.ci/packer_cache.sh +12 -10
  5. data/.rspec +0 -1
  6. data/.rubocop.yml +3 -0
  7. data/CHANGELOG.asciidoc +84 -0
  8. data/Gemfile +22 -1
  9. data/Rakefile +28 -1
  10. data/bin/run-tests +4 -1
  11. data/docker-compose.yml +2 -0
  12. data/docs/configuration.asciidoc +117 -16
  13. data/docs/debugging.asciidoc +14 -0
  14. data/docs/getting-started-rails.asciidoc +2 -0
  15. data/docs/images/dynamic-config.svg +1 -0
  16. data/docs/index.asciidoc +2 -1
  17. data/docs/introduction.asciidoc +2 -1
  18. data/docs/performance-tuning.asciidoc +106 -0
  19. data/docs/set-up.asciidoc +5 -2
  20. data/docs/supported-technologies.asciidoc +18 -1
  21. data/elastic-apm.gemspec +17 -0
  22. data/lib/elastic-apm.rb +17 -0
  23. data/lib/elastic_apm.rb +18 -1
  24. data/lib/elastic_apm/agent.rb +48 -2
  25. data/lib/elastic_apm/central_config.rb +27 -8
  26. data/lib/elastic_apm/central_config/cache_control.rb +17 -0
  27. data/lib/elastic_apm/child_durations.rb +17 -0
  28. data/lib/elastic_apm/config.rb +52 -2
  29. data/lib/elastic_apm/config/bytes.rb +17 -0
  30. data/lib/elastic_apm/config/duration.rb +17 -0
  31. data/lib/elastic_apm/config/options.rb +18 -1
  32. data/lib/elastic_apm/config/regexp_list.rb +17 -0
  33. data/lib/elastic_apm/config/wildcard_pattern_list.rb +28 -1
  34. data/lib/elastic_apm/context.rb +17 -0
  35. data/lib/elastic_apm/context/request.rb +17 -0
  36. data/lib/elastic_apm/context/request/socket.rb +17 -0
  37. data/lib/elastic_apm/context/request/url.rb +17 -0
  38. data/lib/elastic_apm/context/response.rb +17 -0
  39. data/lib/elastic_apm/context/user.rb +17 -0
  40. data/lib/elastic_apm/context_builder.rb +18 -1
  41. data/lib/elastic_apm/deprecations.rb +17 -0
  42. data/lib/elastic_apm/error.rb +17 -0
  43. data/lib/elastic_apm/error/exception.rb +17 -0
  44. data/lib/elastic_apm/error/log.rb +17 -0
  45. data/lib/elastic_apm/error_builder.rb +17 -0
  46. data/lib/elastic_apm/grape.rb +17 -0
  47. data/lib/elastic_apm/graphql.rb +17 -0
  48. data/lib/elastic_apm/grpc.rb +19 -2
  49. data/lib/elastic_apm/instrumenter.rb +29 -4
  50. data/lib/elastic_apm/internal_error.rb +17 -0
  51. data/lib/elastic_apm/logging.rb +17 -0
  52. data/lib/elastic_apm/metadata.rb +17 -0
  53. data/lib/elastic_apm/metadata/process_info.rb +17 -0
  54. data/lib/elastic_apm/metadata/service_info.rb +22 -2
  55. data/lib/elastic_apm/metadata/system_info.rb +22 -3
  56. data/lib/elastic_apm/metadata/system_info/container_info.rb +45 -4
  57. data/lib/elastic_apm/metrics.rb +33 -1
  58. data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
  59. data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
  60. data/lib/elastic_apm/metrics/metric.rb +17 -0
  61. data/lib/elastic_apm/metrics/set.rb +17 -0
  62. data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
  63. data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
  64. data/lib/elastic_apm/metrics/vm_set.rb +17 -0
  65. data/lib/elastic_apm/metricset.rb +17 -0
  66. data/lib/elastic_apm/middleware.rb +25 -2
  67. data/lib/elastic_apm/naively_hashable.rb +17 -0
  68. data/lib/elastic_apm/normalizers.rb +17 -0
  69. data/lib/elastic_apm/normalizers/grape.rb +17 -0
  70. data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
  71. data/lib/elastic_apm/normalizers/rails.rb +17 -0
  72. data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
  73. data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
  74. data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
  75. data/lib/elastic_apm/normalizers/rails/active_record.rb +17 -0
  76. data/lib/elastic_apm/opentracing.rb +64 -23
  77. data/lib/elastic_apm/rails.rb +17 -0
  78. data/lib/elastic_apm/railtie.rb +17 -0
  79. data/lib/elastic_apm/resque.rb +17 -0
  80. data/lib/elastic_apm/sinatra.rb +17 -0
  81. data/lib/elastic_apm/span.rb +20 -2
  82. data/lib/elastic_apm/span/context.rb +17 -0
  83. data/lib/elastic_apm/span/context/db.rb +17 -0
  84. data/lib/elastic_apm/span/context/destination.rb +17 -0
  85. data/lib/elastic_apm/span/context/http.rb +17 -0
  86. data/lib/elastic_apm/span_helpers.rb +17 -0
  87. data/lib/elastic_apm/spies.rb +33 -14
  88. data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
  89. data/lib/elastic_apm/spies/delayed_job.rb +17 -0
  90. data/lib/elastic_apm/spies/dynamo_db.rb +58 -0
  91. data/lib/elastic_apm/spies/elasticsearch.rb +37 -2
  92. data/lib/elastic_apm/spies/faraday.rb +17 -0
  93. data/lib/elastic_apm/spies/http.rb +17 -0
  94. data/lib/elastic_apm/spies/json.rb +17 -0
  95. data/lib/elastic_apm/spies/mongo.rb +18 -1
  96. data/lib/elastic_apm/spies/net_http.rb +23 -2
  97. data/lib/elastic_apm/spies/rake.rb +17 -0
  98. data/lib/elastic_apm/spies/redis.rb +17 -0
  99. data/lib/elastic_apm/spies/resque.rb +19 -9
  100. data/lib/elastic_apm/spies/sequel.rb +18 -1
  101. data/lib/elastic_apm/spies/shoryuken.rb +17 -0
  102. data/lib/elastic_apm/spies/sidekiq.rb +17 -0
  103. data/lib/elastic_apm/spies/sinatra.rb +17 -0
  104. data/lib/elastic_apm/spies/sneakers.rb +17 -0
  105. data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
  106. data/lib/elastic_apm/spies/tilt.rb +17 -0
  107. data/lib/elastic_apm/sql.rb +17 -0
  108. data/lib/elastic_apm/sql/signature.rb +17 -0
  109. data/lib/elastic_apm/sql/tokenizer.rb +17 -0
  110. data/lib/elastic_apm/sql/tokens.rb +17 -0
  111. data/lib/elastic_apm/sql_summarizer.rb +17 -0
  112. data/lib/elastic_apm/stacktrace.rb +17 -0
  113. data/lib/elastic_apm/stacktrace/frame.rb +17 -0
  114. data/lib/elastic_apm/stacktrace_builder.rb +17 -0
  115. data/lib/elastic_apm/subscriber.rb +17 -0
  116. data/lib/elastic_apm/trace_context.rb +17 -0
  117. data/lib/elastic_apm/trace_context/traceparent.rb +17 -0
  118. data/lib/elastic_apm/trace_context/tracestate.rb +17 -0
  119. data/lib/elastic_apm/transaction.rb +33 -5
  120. data/lib/elastic_apm/transport/base.rb +39 -23
  121. data/lib/elastic_apm/transport/connection.rb +17 -0
  122. data/lib/elastic_apm/transport/connection/http.rb +17 -0
  123. data/lib/elastic_apm/transport/connection/proxy_pipe.rb +22 -0
  124. data/lib/elastic_apm/transport/filters.rb +17 -0
  125. data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
  126. data/lib/elastic_apm/transport/filters/secrets_filter.rb +30 -56
  127. data/lib/elastic_apm/transport/headers.rb +17 -0
  128. data/lib/elastic_apm/transport/serializers.rb +17 -0
  129. data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
  130. data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
  131. data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
  132. data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
  133. data/lib/elastic_apm/transport/serializers/span_serializer.rb +17 -0
  134. data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
  135. data/lib/elastic_apm/transport/user_agent.rb +17 -0
  136. data/lib/elastic_apm/transport/worker.rb +21 -0
  137. data/lib/elastic_apm/util.rb +17 -0
  138. data/lib/elastic_apm/util/inflector.rb +17 -0
  139. data/lib/elastic_apm/util/lru_cache.rb +17 -0
  140. data/lib/elastic_apm/util/throttle.rb +17 -0
  141. data/lib/elastic_apm/version.rb +18 -1
  142. metadata +12 -11
  143. data/.ci/downstreamTests.groovy +0 -185
  144. data/.ci/prepare-git-context.sh +0 -27
  145. data/codecov.yml +0 -32
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,12 +34,15 @@ 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
24
42
  gem 'graphql', require: nil
25
- gem 'grpc' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '2.7'
43
+ gem 'google-protobuf', '< 3.12' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '2.5'
44
+ gem 'grpc' if !defined?(JRUBY_VERSION)
45
+ gem 'json'
26
46
  gem 'json-schema', require: nil
27
47
  gem 'mongo', require: nil
28
48
  gem 'opentracing', require: nil
@@ -34,6 +54,7 @@ gem 'sidekiq', require: nil
34
54
  gem 'simplecov', require: false
35
55
  gem 'simplecov-cobertura', require: false
36
56
  gem 'sneakers', '~> 2.12', require: nil
57
+ gem 'sucker_punch', '~> 2.0', require: nil
37
58
  gem 'yard', require: nil
38
59
  gem 'yarjuf'
39
60
 
data/Rakefile 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
  require 'bundler/gem_tasks'
@@ -7,7 +24,7 @@ Update `3.x` branch to be at released commit and push it to GitHub.
7
24
  """
8
25
  namespace :release do
9
26
  task :update_branch do
10
- `echo hi && false && git checkout 3.x &&
27
+ `git checkout 3.x &&
11
28
  git rebase master &&
12
29
  git push origin 3.x &&
13
30
  git checkout master`
@@ -22,3 +39,13 @@ YARD::Rake::YardocTask.new
22
39
  task docs: :yard
23
40
 
24
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
 
@@ -26,11 +26,13 @@ services:
26
26
  - /tmp:exec,mode=1777
27
27
  depends_on:
28
28
  - mongodb
29
+ user: ${USER_ID}
29
30
 
30
31
  ruby_rspec:
31
32
  image: apm-agent-ruby:${RUBY_VERSION}
32
33
  environment:
33
34
  MONGODB_URL: 'mongodb:27017'
35
+ user: ${USER_ID}
34
36
 
35
37
  volumes:
36
38
  vendor:
@@ -8,9 +8,7 @@ endif::[]
8
8
  == Configuration
9
9
 
10
10
  There are several ways to configure how Elastic APM behaves.
11
-
12
- The recommended way to configure Elastic APM is to create a file
13
- `config/elastic_apm.yml` and specify options in there:
11
+ The recommended way is to specify options in a `config/elastic_apm.yml` file:
14
12
 
15
13
  [source,yaml]
16
14
  ----
@@ -18,17 +16,38 @@ server_url: 'http://localhost:8200'
18
16
  secret_token: <%= ENV["VERY_SECRET_TOKEN"] %>
19
17
  ----
20
18
 
19
+ Some options can be set with `ENV` variables.
20
+ When using this method, strings are split by comma, e.g.,
21
+ `ELASTIC_APM_SANITIZE_FIELD_NAMES="a,b" # => [/a/, /b/]`.
22
+
23
+ [float]
24
+ [[configuration-precedence]]
25
+ === Configuration precedence
26
+
21
27
  Options are applied in the following order (last one wins):
22
28
 
23
29
  1. Defaults
24
30
  2. Arguments to `ElasticAPM.start` / `Config.new`
25
- 3. Config file eg. `config/elastic_apm.yml`
31
+ 3. Config file, e.g., `config/elastic_apm.yml`
26
32
  4. Environment variables
33
+ 5. {apm-app-ref}/agent-configuration.html[Central configuration]
34
+ (supported options are marked with <<dynamic-configuration, image:./images/dynamic-config.svg[] >>)
35
+
36
+ [float]
37
+ [[dynamic-configuration]]
38
+ === Dynamic configuration
39
+
40
+ Configuration options marked with the image:./images/dynamic-config.svg[] badge can be changed at runtime
41
+ when set from a supported source.
42
+
43
+ The Agent supports {apm-app-ref}/agent-configuration.html[Central configuration],
44
+ which allows you to fine-tune certain configurations via the APM app.
45
+ This feature is enabled in the Agent by default, with <<config-central-config>>.
27
46
 
28
47
  [float]
29
48
  === Ruby on Rails
30
49
 
31
- When using Rails it's also possible to specify options inside
50
+ When using Rails, it's possible to specify options inside
32
51
  `config/application.rb`:
33
52
 
34
53
  [source,ruby]
@@ -40,7 +59,7 @@ config.elastic_apm.service_name = 'MyApp'
40
59
  [float]
41
60
  === Sinatra and Rack
42
61
 
43
- When using APM with Sinatra and Rack you can configure it when starting
62
+ When using Sinatra and Rack, you can configure when starting
44
63
  the agent:
45
64
 
46
65
  [source,ruby]
@@ -52,7 +71,7 @@ ElasticAPM.start(
52
71
  )
53
72
  ----
54
73
 
55
- Alternatively, you can use the `ElasticAPM::Sinatra.start` API.
74
+ Alternatively, you can use the `ElasticAPM::Sinatra.start` API:
56
75
 
57
76
  [source,ruby]
58
77
  ----
@@ -68,7 +87,7 @@ See <<getting-started-rack>>.
68
87
  [float]
69
88
  === Grape and Rack
70
89
 
71
- When using APM with Grape and Rack (without Rails), you can configure it when starting
90
+ When using Grape and Rack (without Rails), you can configure when starting
72
91
  the agent:
73
92
 
74
93
  [source,ruby]
@@ -85,12 +104,6 @@ See <<getting-started-rack>>.
85
104
  [float]
86
105
  === Options
87
106
 
88
- Some options can be set with `ENV` variables and all of them may be set in
89
- your source code.
90
-
91
- When setting values for lists using `ENV` variables, strings are split by comma
92
- eg `ELASTIC_APM_SANITIZE_FIELD_NAMES="a,b" # => [/a/, /b/]`.
93
-
94
107
  [float]
95
108
  [[config-config-file]]
96
109
  ==== `config_file`
@@ -165,7 +178,7 @@ WARNING: Api keys only provide any real security if your APM server uses TLS.
165
178
 
166
179
  [float]
167
180
  [[config-active]]
168
- ==== `active`
181
+ ==== `active` deprecated:[3.7.0,See <<config-enabled>> instead.]
169
182
  |============
170
183
  | Environment | `Config` key | Default
171
184
  | `ELASTIC_APM_ACTIVE` | `active` | `true`
@@ -174,6 +187,8 @@ WARNING: Api keys only provide any real security if your APM server uses TLS.
174
187
  Whether or not to start the agent.
175
188
  If `active` is `false`, `ElasticAPM.start` will do nothing and all calls to the root API will return `nil`.
176
189
 
190
+ NOTE: This option is being removed. See <<config-enabled>> instead.
191
+
177
192
  [float]
178
193
  [[config-api-buffer-size]]
179
194
  ==== `api_buffer_size`
@@ -192,6 +207,9 @@ went wrong.
192
207
  [float]
193
208
  [[config-api-request-size]]
194
209
  ==== `api_request_size`
210
+
211
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
212
+
195
213
  |============
196
214
  | Environment | `Config` key | Default
197
215
  | `ELASTIC_APM_API_REQUEST_SIZE` | `api_request_size` | `"750kb"`
@@ -205,6 +223,9 @@ It has to be provided in *<<config-format-size, size format>>*.
205
223
  [float]
206
224
  [[config-api-request-time]]
207
225
  ==== `api_request_time`
226
+
227
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
228
+
208
229
  |============
209
230
  | Environment | `Config` key | Default
210
231
  | `ELASTIC_APM_API_REQUEST_TIME` | `api_request_time` | `"10s"`
@@ -233,6 +254,9 @@ NOTE: This feature requires APM Server and Kibana >= 7.3.
233
254
  [float]
234
255
  [[config-capture-body]]
235
256
  ==== `capture_body`
257
+
258
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
259
+
236
260
  |============
237
261
  | Environment | `Config` key | Default | Example |
238
262
  | `ELASTIC_APM_CAPTURE_BODY` | `capture_body` | `"off"` | `"all"`
@@ -253,6 +277,9 @@ If your service handles data like this, we advise to only enable this feature wi
253
277
  [float]
254
278
  [[config-capture-headers]]
255
279
  ==== `capture_headers`
280
+
281
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
282
+
256
283
  |============
257
284
  | Environment | `Config` key | Default
258
285
  | `ELASTIC_APM_CAPTURE_HEADERS` | `capture_headers` | `true`
@@ -260,6 +287,16 @@ If your service handles data like this, we advise to only enable this feature wi
260
287
 
261
288
  Whether or not to attach the request headers to transactions and errors.
262
289
 
290
+ [float]
291
+ [[config-capture-elasticsearch-queries]]
292
+ ==== `capture_elasticsearch_queries`
293
+ |============
294
+ | Environment | `Config` key | Default
295
+ | `ELASTIC_APM_CAPTURE_ELASTICSEARCH_QUERIES` | `capture_elasticsearch_queries` | `false`
296
+ |============
297
+
298
+ Whether or not to capture the body from requests in Elasticsearch.
299
+
263
300
  [float]
264
301
  [[config-capture-env]]
265
302
  ==== `capture_env`
@@ -278,7 +315,7 @@ Whether or not to attach `ENV` from Rack to transactions and errors.
278
315
  | `ELASTIC_APM_CENTRAL_CONFIG` | `central_config` | `true`
279
316
  |============
280
317
 
281
- Enable {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
318
+ Enables {apm-app-ref}/agent-configuration.html[APM Agent Configuration via Kibana].
282
319
  If set to `true`, the client will poll the APM Server regularly for new agent configuration.
283
320
 
284
321
  Usually APM Server determines how often to poll, but if not the default interval is 5 minutes.
@@ -383,6 +420,18 @@ Use this option to disable any of these.
383
420
 
384
421
  Get an array of enabled instrumentations with `ElasticAPM.agent.config.enabled_instrumentations`.
385
422
 
423
+ [float]
424
+ [[config-enabled]]
425
+ ==== `enabled`
426
+ [options="header"]
427
+ |============
428
+ | Environment | `Config` key | Default
429
+ | `ELASTIC_APM_ENABLED` | `enabled` | `true`
430
+ |============
431
+
432
+ Whether or not to start the agent.
433
+ If `enabled` is `false`, `ElasticAPM.start` will do nothing and all calls to the root API will return `nil`.
434
+
386
435
  [float]
387
436
  [[config-environment]]
388
437
  ==== `environment`
@@ -514,6 +563,8 @@ Elastic APM can instrument your Rake tasks but given that they are used for a mu
514
563
  [[config-log-level]]
515
564
  ==== `log_level`
516
565
 
566
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
567
+
517
568
  [options="header"]
518
569
  |============
519
570
  | Environment | `Config` key | Default
@@ -610,6 +661,23 @@ There are also `ENV` version of these following the same pattern of putting `ELA
610
661
 
611
662
  See https://github.com/httprb/http/wiki/Proxy-Support[Http.rb's docs].
612
663
 
664
+ [float]
665
+ [[config-recording]]
666
+ ==== `recording`
667
+
668
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
669
+
670
+ [options="header"]
671
+ |============
672
+ | Environment | `Config` key | Default
673
+ | `ELASTIC_APM_RECORDING` | `recording` | `true`
674
+ |============
675
+
676
+ Enable or disable the recording of events.
677
+ If set to false, then the agent does not create or send any events to the Elastic APM server,
678
+ and instrumentation overhead is minimized. The agent continues to poll the server for configuration changes
679
+ when this option is false.
680
+
613
681
  [float]
614
682
  [[config-sanitize-field-names]]
615
683
  ==== `sanitize_field_names`
@@ -649,6 +717,23 @@ NOTE: The service name must conform to this regular expression: `^[a-zA-Z0-9 _-]
649
717
  In layman's terms: Your service name must only contain characters from the ASCII
650
718
  alphabet, numbers, dashes, underscores and spaces.
651
719
 
720
+ [float]
721
+ [[config-service-node-name]]
722
+ ==== `service_node_name`
723
+
724
+ [options="header"]
725
+ |============
726
+ | Environment | `Config` key | Default | Example
727
+ | `ELASTIC_APM_SERVICE_NODE_NAME` | `service_node_name` | `nil` | `"my-app-1"`
728
+ |============
729
+
730
+ The name of the given service node. This is optional, and if omitted, the APM
731
+ Server will fall back on `system.container.id` if available, and finally
732
+ `host.name` if necessary.
733
+
734
+ This option allows you to set the node name manually to ensure uniqueness and
735
+ meaningfulness.
736
+
652
737
  [float]
653
738
  [[config-service-version]]
654
739
  ==== `service_version`
@@ -694,6 +779,8 @@ storage use in your Elasticsearch cluster.
694
779
  [[config-span-frames-min-duration-ms]]
695
780
  ==== `span_frames_min_duration`
696
781
 
782
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
783
+
697
784
  |============
698
785
  | Environment | `Config` key | Default
699
786
  | `ELASTIC_APM_SPAN_FRAMES_MIN_DURATION` | `span_frames_min_duration` | `"5ms"`
@@ -737,6 +824,8 @@ The maximum number of stack trace lines per span/error.
737
824
  [[config-transaction-max-spans]]
738
825
  ==== `transaction_max_spans`
739
826
 
827
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
828
+
740
829
  |============
741
830
  | Environment | `Config` key | Default
742
831
  | `ELASTIC_APM_TRANSACTION_MAX_SPANS` | `transaction_max_spans` | `500`
@@ -752,6 +841,8 @@ too much work for such edge cases.
752
841
  [[config-transaction-sample-rate]]
753
842
  ==== `transaction_sample_rate`
754
843
 
844
+ <<dynamic-configuration, image:./images/dynamic-config.svg[] >>
845
+
755
846
  |============
756
847
  | Environment | `Config` key | Default
757
848
  | `ELASTIC_APM_TRANSACTION_SAMPLE_RATE` | `transaction_sample_rate` | `1.0`
@@ -826,3 +917,13 @@ The unit is provided as suffix directly after the number, without any separation
826
917
  * `gb` (gigabytes)
827
918
 
828
919
  NOTE: we use the power-of-two sizing convention, e.g. `1 kilobyte == 1024 bytes`
920
+
921
+ [float]
922
+ [[special-configuration]]
923
+ === Special configuration
924
+
925
+ 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.
926
+
927
+ To get around this patch, set the environment variable `ELASTIC_APM_SKIP_REQUIRE_PATCH` to `"1"`.
928
+
929
+ 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.
@@ -28,3 +28,17 @@ Things to consider:
28
28
  - Experiencing high load? The agent can spawn multiple instances of its Workers that pick off the queue by changing the option `pool_size` (default is `1`).
29
29
  - If you have high load you may also consider setting `transaction_sample_rate` to something smaller than `1.0`. This determines whether to include _spans_ for every _transaction_. If you have enough traffic, skipping some (probably) identical spans won't have a noticeable effect on your data.
30
30
 
31
+ [float]
32
+ [[disable-agent]]
33
+ === Disable the Agent
34
+
35
+ In the unlikely event the agent causes disruptions to a production application,
36
+ you can disable the agent while you troubleshoot.
37
+
38
+ If you have access to <<dynamic-configuration,dynamic configuration>>,
39
+ you can disable the recording of events by setting <<config-recording,`recording`>> to `false`.
40
+ When changed at runtime from a supported source, there's no need to restart your application.
41
+
42
+ If that doesn't work, or you don't have access to dynamic configuration, you can disable the agent by setting
43
+ <<config-enabled,`enabled`>> to `false`.
44
+ You'll need to restart your application for the changes to apply.
@@ -25,4 +25,6 @@ server_url: http://localhost:8200
25
25
  secret_token: ''
26
26
  ----
27
27
 
28
+ Or if you prefer environment variables, skip the file and set `ELASTIC_APM_SERVER_URL` and `ELASTIC_APM_SECRET_TOKEN` in your local or server environment.
29
+
28
30
  This automatically sets up error logging and performance tracking but of course there are knobs to turn if you'd like to. See <<configuration>>.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="59" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="59" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#9f9f9f" d="M0 0h0v20H0z"/><path fill="#9f9f9f" d="M0 0h59v20H0z"/><path fill="url(#b)" d="M0 0h59v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="295" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="490">Dynamic</text><text x="295" y="140" transform="scale(.1)" textLength="490">Dynamic</text></g> </svg>
@@ -29,9 +29,10 @@ include::./graphql.asciidoc[]
29
29
 
30
30
  include::./log-correlation.asciidoc[]
31
31
 
32
+ include::./performance-tuning.asciidoc[]
33
+
32
34
  include::./debugging.asciidoc[]
33
35
 
34
36
  include::./upgrading.asciidoc[]
35
37
 
36
38
  include::./release-notes.asciidoc[]
37
-
@@ -32,4 +32,5 @@ You can then use the APM app in Kibana to gain insight into latency issues and e
32
32
  === Additional Components
33
33
 
34
34
  APM Agents work in conjunction with the {apm-server-ref-v}/index.html[APM Server], {ref}/index.html[Elasticsearch], and {kibana-ref}/index.html[Kibana].
35
- Please view the {apm-overview-ref-v}/index.html[APM Overview] for details on how these components work together.
35
+ The {apm-overview-ref-v}/index.html[APM Overview] provides details on how these components work together,
36
+ and provides a matrix outlining {apm-overview-ref-v}/agent-server-compatibility.html[Agent and Server compatibility].