elastic-apm 3.15.1 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/.jenkins_exclude.yml +13 -0
- data/.ci/.jenkins_ruby.yml +0 -1
- data/.ci/Jenkinsfile +1 -0
- data/.github/dependabot.yml +16 -0
- data/.rubocop.yml +0 -7
- data/CHANGELOG.asciidoc +77 -4
- data/Gemfile +4 -1
- data/README.md +12 -0
- data/SECURITY.md +7 -0
- data/bench/report.rb +1 -1
- data/bin/run-bdd +17 -0
- data/bin/run-tests +1 -1
- data/docker-compose.yml +1 -1
- data/docs/configuration.asciidoc +62 -147
- data/docs/release-notes.asciidoc +1 -0
- data/docs/upgrading.asciidoc +0 -27
- data/lib/elastic_apm.rb +12 -1
- data/lib/elastic_apm/agent.rb +7 -3
- data/lib/elastic_apm/central_config.rb +8 -7
- data/lib/elastic_apm/config.rb +2 -88
- data/lib/elastic_apm/config/regexp_list.rb +1 -1
- data/lib/elastic_apm/config/wildcard_pattern_list.rb +1 -1
- data/lib/elastic_apm/context/response.rb +1 -3
- data/lib/elastic_apm/fields.rb +88 -0
- data/lib/elastic_apm/grpc.rb +2 -4
- data/lib/elastic_apm/instrumenter.rb +1 -1
- data/lib/elastic_apm/metadata/cloud_info.rb +32 -5
- data/lib/elastic_apm/metadata/system_info.rb +14 -4
- data/lib/elastic_apm/metrics/cpu_mem_set.rb +1 -1
- data/lib/elastic_apm/normalizers.rb +2 -2
- data/lib/elastic_apm/normalizers/rails/active_record.rb +3 -3
- data/lib/elastic_apm/opentracing.rb +3 -2
- data/lib/elastic_apm/span.rb +26 -1
- data/lib/elastic_apm/span/context.rb +2 -1
- data/lib/elastic_apm/span/context/destination.rb +53 -40
- data/lib/elastic_apm/span_helpers.rb +6 -8
- data/lib/elastic_apm/spies.rb +20 -0
- data/lib/elastic_apm/spies/action_dispatch.rb +10 -9
- data/lib/elastic_apm/spies/azure_storage_table.rb +148 -0
- data/lib/elastic_apm/spies/dynamo_db.rb +12 -12
- data/lib/elastic_apm/spies/elasticsearch.rb +32 -29
- data/lib/elastic_apm/spies/faraday.rb +83 -63
- data/lib/elastic_apm/spies/http.rb +33 -34
- data/lib/elastic_apm/spies/mongo.rb +5 -3
- data/lib/elastic_apm/spies/net_http.rb +59 -56
- data/lib/elastic_apm/spies/rake.rb +28 -26
- data/lib/elastic_apm/spies/redis.rb +11 -10
- data/lib/elastic_apm/spies/resque.rb +18 -21
- data/lib/elastic_apm/spies/s3.rb +14 -15
- data/lib/elastic_apm/spies/sequel.rb +42 -48
- data/lib/elastic_apm/spies/sidekiq.rb +13 -15
- data/lib/elastic_apm/spies/sinatra.rb +20 -21
- data/lib/elastic_apm/spies/sns.rb +39 -44
- data/lib/elastic_apm/spies/sqs.rb +21 -31
- data/lib/elastic_apm/spies/tilt.rb +10 -9
- data/lib/elastic_apm/sql/tokenizer.rb +21 -5
- data/lib/elastic_apm/stacktrace_builder.rb +3 -1
- data/lib/elastic_apm/subscriber.rb +1 -0
- data/lib/elastic_apm/trace_context.rb +5 -13
- data/lib/elastic_apm/trace_context/traceparent.rb +5 -6
- data/lib/elastic_apm/transport/connection.rb +1 -1
- data/lib/elastic_apm/transport/connection/http.rb +4 -2
- data/lib/elastic_apm/transport/connection/proxy_pipe.rb +1 -2
- data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +5 -23
- data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +3 -2
- data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +2 -2
- data/lib/elastic_apm/transport/serializers/span_serializer.rb +12 -12
- data/lib/elastic_apm/transport/user_agent.rb +3 -2
- data/lib/elastic_apm/transport/worker.rb +1 -1
- data/lib/elastic_apm/util/deep_dup.rb +1 -1
- data/lib/elastic_apm/version.rb +1 -1
- metadata +12 -9
- data/lib/elastic_apm/sql.rb +0 -36
- data/lib/elastic_apm/sql_summarizer.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81641cee86d90236fac69836ed6b6e4e858e0650d099c7cf0ab2fbc58e9d8550
|
4
|
+
data.tar.gz: a8f13b6c5b4b430c4cba21f92167b784634bc151ef802472e9a4fc1af6f95c1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3db0a577687ac11af79c29de68c3935cb0df9572bed2583c5d9666dd15aefabb97a0ab0a081b79fd41ee7e53e1e3319700d0ebd74a30883eaa55b45684ea9862
|
7
|
+
data.tar.gz: a191284ee54fd8be1511927ff1af81f13bb129c6f282d2078099cf8a79fe124ec5f995243260d66a23920f6d82fdb1955614cdbe260b58413bb9863ee0226a3a
|
data/.ci/.jenkins_exclude.yml
CHANGED
@@ -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
|
data/.ci/.jenkins_ruby.yml
CHANGED
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,17 +32,90 @@ endif::[]
|
|
32
32
|
==== Unreleased
|
33
33
|
////
|
34
34
|
|
35
|
-
[[release-notes-
|
36
|
-
=== Ruby Agent version
|
35
|
+
[[release-notes-4.x]]
|
36
|
+
=== Ruby Agent version 4.x
|
37
|
+
|
38
|
+
[[release-notes-4.2.0]]
|
39
|
+
==== 4.2.0
|
40
|
+
|
41
|
+
[float]
|
42
|
+
===== Added
|
43
|
+
|
44
|
+
- Add support for AWS Storage Table/CosmosDB {pull}999[#999]
|
45
|
+
|
46
|
+
[float]
|
47
|
+
===== Fixed
|
48
|
+
|
49
|
+
- Align HTTP span types/subtypes with spec {pull}1014[#1014]
|
50
|
+
- Passing a full URL as a path to `Net::HTTP` {pull}1029[#1029]
|
51
|
+
- Fix growing number of open file descriptors {pull}1033[#1033]
|
52
|
+
|
53
|
+
[[release-notes-4.1.0]]
|
54
|
+
==== 4.1.0
|
55
|
+
|
56
|
+
[float]
|
57
|
+
===== Added
|
58
|
+
|
59
|
+
- Azure App Services instance metadata {pull}1007[#1007]
|
60
|
+
|
61
|
+
[float]
|
62
|
+
===== Changed
|
63
|
+
|
64
|
+
- `hostname` is now reported split by `configured_hostname` and `detected_hostname` {pull}1009[#1009]
|
65
|
+
|
66
|
+
[float]
|
67
|
+
===== Fixed
|
68
|
+
- `service_node_name` is now correctly reported as `service.node.configured_name` {pull}1009[#1009]
|
69
|
+
- Fix JSON parsing when using yajl-ruby {pull}1012[#1012]
|
70
|
+
- Fix SpanHelpers when methods take blocks {pull}1013[#1013]
|
71
|
+
- Fix missing `environment` param when fetching from Central Config {pull}1014[#1014]
|
72
|
+
|
73
|
+
[[release-notes-4.0.0]]
|
74
|
+
==== 4.0.0
|
75
|
+
|
76
|
+
[float]
|
77
|
+
===== Upgrading
|
78
|
+
|
79
|
+
Be aware that this release changes the agent's general approach to instrumenting third
|
80
|
+
party libraries.
|
81
|
+
It now uses `Module#prepend` over alias method chaining.
|
37
82
|
|
38
|
-
|
39
|
-
|
83
|
+
This doesn't necessarily impact your application but it could if you are using other gems
|
84
|
+
that use the old approach to patch the same method.
|
85
|
+
Mixing the two approaches can lead to infinite recursion.
|
86
|
+
|
87
|
+
[float]
|
88
|
+
===== Removed
|
89
|
+
|
90
|
+
- Removed support for Ruby 2.3 and JRuby 9.1 {pull}901[#901]
|
91
|
+
- Config option `active`, see `enabled` {pull}900[#900]
|
92
|
+
- Config option `custom_key_filters`, see `sanitize_field_names` {pull}900[#900]
|
93
|
+
- Config option `default_tags`, see `global_labels` {pull}900[#900]
|
94
|
+
- Config option `default_labels`, see `global_labels` {pull}900[#900]
|
95
|
+
- Config option `ignore_url_patterns`, see `transaction_ignore_urls` {pull}900[#900]
|
96
|
+
- Config option `use_legacy_sql_parser`, legacy parser no longer included {pull}900[#900]
|
97
|
+
|
98
|
+
[float]
|
99
|
+
===== Changed
|
100
|
+
|
101
|
+
- Integrations (Spies) use Module#prepend over class_eval {pull}890[#890]
|
102
|
+
- The secrets filter no longer filters based on values, see `sanitize_field_names` {pull}900[#900]
|
103
|
+
- The secrets filter is aligned with other agents, see `sanitize_field_names` {pull}900[#900]
|
104
|
+
|
105
|
+
[float]
|
106
|
+
===== Added
|
107
|
+
|
108
|
+
- Added `set_service` API {pull}1006[#1006]
|
40
109
|
|
41
110
|
[float]
|
42
111
|
===== Fixed
|
43
112
|
|
44
113
|
- AWS S3 spy accepts symbol bucket names {pull}998[#998]
|
45
114
|
- AWS S3 spy passing on blocks {pull}998[#998]
|
115
|
+
- SQL scanner now recognizes CQL style comments {pull}1004[#1004]
|
116
|
+
|
117
|
+
[[release-notes-3.x]]
|
118
|
+
=== Ruby Agent version 3.x
|
46
119
|
|
47
120
|
[[release-notes-3.15.0]]
|
48
121
|
==== 3.15.0 (2021-03-22)
|
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
|
|
@@ -34,6 +36,7 @@ gem 'aws-sdk-dynamodb', require: nil
|
|
34
36
|
gem 'aws-sdk-s3', require: nil
|
35
37
|
gem 'aws-sdk-sqs', require: nil
|
36
38
|
gem 'aws-sdk-sns', require: nil
|
39
|
+
gem 'azure-storage-table', require: nil if RUBY_VERSION < '3.0'
|
37
40
|
gem 'elasticsearch', require: nil
|
38
41
|
gem 'fakeredis', require: nil
|
39
42
|
gem 'faraday', require: nil
|
@@ -91,7 +94,7 @@ frameworks_versions.each do |framework, version|
|
|
91
94
|
end
|
92
95
|
|
93
96
|
if frameworks_versions.key?('rails')
|
94
|
-
unless frameworks_versions['rails']
|
97
|
+
unless /^(main|6)/.match?(frameworks_versions['rails'])
|
95
98
|
gem 'delayed_job', require: nil
|
96
99
|
end
|
97
100
|
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/SECURITY.md
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
# Security Policy
|
2
|
+
|
3
|
+
Thanks for your interest in the security of our products.
|
4
|
+
Our security policy can be found at [https://www.elastic.co/community/security](https://www.elastic.co/community/security).
|
5
|
+
|
6
|
+
## Reporting a Vulnerability
|
7
|
+
Please send security vulnerability reports to security@elastic.co.
|
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
data/docker-compose.yml
CHANGED
data/docs/configuration.asciidoc
CHANGED
@@ -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
|
-
|
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,
|
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),
|
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
|
-
|
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
|
-
|
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
|
-
|
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:
|
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
|
-
|
185
|
+
The maximum amount of objects kept in queue before sending to APM Server.
|
201
186
|
|
202
|
-
If you hit
|
203
|
-
|
204
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
250
|
-
|
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
|
-
|
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:
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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.
|
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
|
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
|
-
|
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
|
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
|
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
|
-
|
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.
|
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
|
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
|
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
|
705
|
-
| `ELASTIC_APM_SANITIZE_FIELD_NAMES` | `sanitize_field_names` | `
|
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
|
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
|
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
|
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
|
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
|
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
|
-
|
764
|
-
|
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
|
-
|
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
|
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
|
-
|
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:
|
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
|
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
|
-
|
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.
|