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.
- checksums.yaml +4 -4
- data/.ci/Jenkinsfile +183 -100
- data/.ci/jobs/defaults.yml +1 -1
- data/.ci/packer_cache.sh +12 -10
- data/.rspec +0 -1
- data/.rubocop.yml +3 -0
- data/CHANGELOG.asciidoc +84 -0
- data/Gemfile +22 -1
- data/Rakefile +28 -1
- data/bin/run-tests +4 -1
- data/docker-compose.yml +2 -0
- data/docs/configuration.asciidoc +117 -16
- data/docs/debugging.asciidoc +14 -0
- data/docs/getting-started-rails.asciidoc +2 -0
- data/docs/images/dynamic-config.svg +1 -0
- data/docs/index.asciidoc +2 -1
- data/docs/introduction.asciidoc +2 -1
- data/docs/performance-tuning.asciidoc +106 -0
- data/docs/set-up.asciidoc +5 -2
- data/docs/supported-technologies.asciidoc +18 -1
- data/elastic-apm.gemspec +17 -0
- data/lib/elastic-apm.rb +17 -0
- data/lib/elastic_apm.rb +18 -1
- data/lib/elastic_apm/agent.rb +48 -2
- data/lib/elastic_apm/central_config.rb +27 -8
- data/lib/elastic_apm/central_config/cache_control.rb +17 -0
- data/lib/elastic_apm/child_durations.rb +17 -0
- data/lib/elastic_apm/config.rb +52 -2
- data/lib/elastic_apm/config/bytes.rb +17 -0
- data/lib/elastic_apm/config/duration.rb +17 -0
- data/lib/elastic_apm/config/options.rb +18 -1
- data/lib/elastic_apm/config/regexp_list.rb +17 -0
- data/lib/elastic_apm/config/wildcard_pattern_list.rb +28 -1
- data/lib/elastic_apm/context.rb +17 -0
- data/lib/elastic_apm/context/request.rb +17 -0
- data/lib/elastic_apm/context/request/socket.rb +17 -0
- data/lib/elastic_apm/context/request/url.rb +17 -0
- data/lib/elastic_apm/context/response.rb +17 -0
- data/lib/elastic_apm/context/user.rb +17 -0
- data/lib/elastic_apm/context_builder.rb +18 -1
- data/lib/elastic_apm/deprecations.rb +17 -0
- data/lib/elastic_apm/error.rb +17 -0
- data/lib/elastic_apm/error/exception.rb +17 -0
- data/lib/elastic_apm/error/log.rb +17 -0
- data/lib/elastic_apm/error_builder.rb +17 -0
- data/lib/elastic_apm/grape.rb +17 -0
- data/lib/elastic_apm/graphql.rb +17 -0
- data/lib/elastic_apm/grpc.rb +19 -2
- data/lib/elastic_apm/instrumenter.rb +29 -4
- data/lib/elastic_apm/internal_error.rb +17 -0
- data/lib/elastic_apm/logging.rb +17 -0
- data/lib/elastic_apm/metadata.rb +17 -0
- data/lib/elastic_apm/metadata/process_info.rb +17 -0
- data/lib/elastic_apm/metadata/service_info.rb +22 -2
- data/lib/elastic_apm/metadata/system_info.rb +22 -3
- data/lib/elastic_apm/metadata/system_info/container_info.rb +45 -4
- data/lib/elastic_apm/metrics.rb +33 -1
- data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
- data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
- data/lib/elastic_apm/metrics/metric.rb +17 -0
- data/lib/elastic_apm/metrics/set.rb +17 -0
- data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
- data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
- data/lib/elastic_apm/metrics/vm_set.rb +17 -0
- data/lib/elastic_apm/metricset.rb +17 -0
- data/lib/elastic_apm/middleware.rb +25 -2
- data/lib/elastic_apm/naively_hashable.rb +17 -0
- data/lib/elastic_apm/normalizers.rb +17 -0
- data/lib/elastic_apm/normalizers/grape.rb +17 -0
- data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
- data/lib/elastic_apm/normalizers/rails.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/active_record.rb +17 -0
- data/lib/elastic_apm/opentracing.rb +64 -23
- data/lib/elastic_apm/rails.rb +17 -0
- data/lib/elastic_apm/railtie.rb +17 -0
- data/lib/elastic_apm/resque.rb +17 -0
- data/lib/elastic_apm/sinatra.rb +17 -0
- data/lib/elastic_apm/span.rb +20 -2
- data/lib/elastic_apm/span/context.rb +17 -0
- data/lib/elastic_apm/span/context/db.rb +17 -0
- data/lib/elastic_apm/span/context/destination.rb +17 -0
- data/lib/elastic_apm/span/context/http.rb +17 -0
- data/lib/elastic_apm/span_helpers.rb +17 -0
- data/lib/elastic_apm/spies.rb +33 -14
- data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
- data/lib/elastic_apm/spies/delayed_job.rb +17 -0
- data/lib/elastic_apm/spies/dynamo_db.rb +58 -0
- data/lib/elastic_apm/spies/elasticsearch.rb +37 -2
- data/lib/elastic_apm/spies/faraday.rb +17 -0
- data/lib/elastic_apm/spies/http.rb +17 -0
- data/lib/elastic_apm/spies/json.rb +17 -0
- data/lib/elastic_apm/spies/mongo.rb +18 -1
- data/lib/elastic_apm/spies/net_http.rb +23 -2
- data/lib/elastic_apm/spies/rake.rb +17 -0
- data/lib/elastic_apm/spies/redis.rb +17 -0
- data/lib/elastic_apm/spies/resque.rb +19 -9
- data/lib/elastic_apm/spies/sequel.rb +18 -1
- data/lib/elastic_apm/spies/shoryuken.rb +17 -0
- data/lib/elastic_apm/spies/sidekiq.rb +17 -0
- data/lib/elastic_apm/spies/sinatra.rb +17 -0
- data/lib/elastic_apm/spies/sneakers.rb +17 -0
- data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
- data/lib/elastic_apm/spies/tilt.rb +17 -0
- data/lib/elastic_apm/sql.rb +17 -0
- data/lib/elastic_apm/sql/signature.rb +17 -0
- data/lib/elastic_apm/sql/tokenizer.rb +17 -0
- data/lib/elastic_apm/sql/tokens.rb +17 -0
- data/lib/elastic_apm/sql_summarizer.rb +17 -0
- data/lib/elastic_apm/stacktrace.rb +17 -0
- data/lib/elastic_apm/stacktrace/frame.rb +17 -0
- data/lib/elastic_apm/stacktrace_builder.rb +17 -0
- data/lib/elastic_apm/subscriber.rb +17 -0
- data/lib/elastic_apm/trace_context.rb +17 -0
- data/lib/elastic_apm/trace_context/traceparent.rb +17 -0
- data/lib/elastic_apm/trace_context/tracestate.rb +17 -0
- data/lib/elastic_apm/transaction.rb +33 -5
- data/lib/elastic_apm/transport/base.rb +39 -23
- data/lib/elastic_apm/transport/connection.rb +17 -0
- data/lib/elastic_apm/transport/connection/http.rb +17 -0
- data/lib/elastic_apm/transport/connection/proxy_pipe.rb +22 -0
- data/lib/elastic_apm/transport/filters.rb +17 -0
- data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
- data/lib/elastic_apm/transport/filters/secrets_filter.rb +30 -56
- data/lib/elastic_apm/transport/headers.rb +17 -0
- data/lib/elastic_apm/transport/serializers.rb +17 -0
- data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
- data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/span_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
- data/lib/elastic_apm/transport/user_agent.rb +17 -0
- data/lib/elastic_apm/transport/worker.rb +21 -0
- data/lib/elastic_apm/util.rb +17 -0
- data/lib/elastic_apm/util/inflector.rb +17 -0
- data/lib/elastic_apm/util/lru_cache.rb +17 -0
- data/lib/elastic_apm/util/throttle.rb +17 -0
- data/lib/elastic_apm/version.rb +18 -1
- metadata +12 -11
- data/.ci/downstreamTests.groovy +0 -185
- data/.ci/prepare-git-context.sh +0 -27
- 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 '
|
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
|
-
`
|
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
|
data/bin/run-tests
CHANGED
@@ -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
|
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
|
|
data/docker-compose.yml
CHANGED
data/docs/configuration.asciidoc
CHANGED
@@ -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
|
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
|
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
|
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
|
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
|
-
|
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.
|
data/docs/debugging.asciidoc
CHANGED
@@ -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>
|
data/docs/index.asciidoc
CHANGED
data/docs/introduction.asciidoc
CHANGED
@@ -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
|
-
|
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].
|