elastic-apm 4.7.3 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ci/.exclude.yml +27 -82
- data/.ci/.framework.yml +1 -4
- data/.ci/.ruby.yml +1 -1
- data/.ci/updatecli/values.d/apm-data-spec.yml +1 -0
- data/.ci/updatecli/values.d/apm-gherkin.yml +1 -0
- data/.ci/updatecli/values.d/apm-json-specs.yml +1 -0
- data/.ci/updatecli/values.d/scm.yml +10 -0
- data/.ci/updatecli/values.d/update-compose.yml +3 -0
- data/.github/CODEOWNERS +1 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +2 -2
- data/.github/dependabot.yml +22 -19
- data/.github/workflows/README.md +1 -2
- data/.github/workflows/addToProject.yml +43 -12
- data/.github/workflows/ci.yml +6 -6
- data/.github/workflows/docs-build.yml +16 -0
- data/.github/workflows/docs-deploy.yml +16 -0
- data/.github/workflows/docs-preview-cleanup.yml +12 -0
- data/.github/workflows/github-commands-comment.yml +18 -0
- data/.github/workflows/microbenchmark.yml +7 -24
- data/.github/workflows/release.yml +40 -24
- data/.github/workflows/run-matrix.yml +21 -12
- data/.github/workflows/test-reporter.yml +4 -3
- data/.github/workflows/updatecli.yml +45 -13
- data/Dockerfile +38 -12
- data/Gemfile +38 -3
- data/bin/dev +16 -4
- data/bin/run-bdd +2 -2
- data/docker-compose.yml +12 -5
- data/docs/docset.yml +11 -0
- data/docs/reference/advanced-topics.md +18 -0
- data/docs/reference/api-reference.md +428 -0
- data/docs/reference/configuration.md +751 -0
- data/docs/{context.asciidoc → reference/context.md} +27 -21
- data/docs/reference/custom-instrumentation.md +78 -0
- data/docs/{getting-started-rack.asciidoc → reference/getting-started-rack.md} +27 -30
- data/docs/reference/getting-started-rails.md +33 -0
- data/docs/reference/graphql.md +27 -0
- data/docs/reference/index.md +33 -0
- data/docs/{logs.asciidoc → reference/logs.md} +45 -57
- data/docs/reference/metrics.md +205 -0
- data/docs/reference/opentracing-api.md +76 -0
- data/docs/reference/performance-tuning.md +77 -0
- data/docs/reference/set-up-apm-ruby-agent.md +22 -0
- data/docs/reference/supported-technologies.md +134 -0
- data/docs/reference/toc.yml +24 -0
- data/docs/reference/upgrading.md +25 -0
- data/docs/release-notes/index.md +182 -0
- data/docs/release-notes/known-issues.md +29 -0
- data/docs/release-notes/toc.yml +3 -0
- data/elastic-apm.gemspec +2 -2
- data/lib/elastic_apm/central_config.rb +1 -1
- data/lib/elastic_apm/config/round_float_hash_value.rb +35 -0
- data/lib/elastic_apm/config.rb +2 -0
- data/lib/elastic_apm/context_builder.rb +5 -2
- data/lib/elastic_apm/instrumenter.rb +23 -3
- data/lib/elastic_apm/spies/http.rb +1 -1
- data/lib/elastic_apm/spies/sidekiq.rb +2 -1
- data/lib/elastic_apm/stacktrace_builder.rb +3 -3
- data/lib/elastic_apm/transaction.rb +11 -4
- data/lib/elastic_apm/version.rb +1 -1
- data/updatecli-compose.yaml +23 -0
- metadata +49 -37
- data/.ci/snapshoty.yml +0 -33
- data/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +0 -84
- data/.ci/updatecli/updatecli.d/update-json-specs.yml +0 -84
- data/.ci/updatecli/updatecli.d/update-specs.yml +0 -86
- data/.ci/updatecli/values.yml +0 -14
- data/.github/workflows/coverage-reporter.yml +0 -34
- data/.github/workflows/opentelemetry.yml +0 -22
- data/.github/workflows/snapshoty.yml +0 -35
- data/CHANGELOG.asciidoc +0 -990
- data/SECURITY.md +0 -7
- data/docs/advanced.asciidoc +0 -14
- data/docs/api.asciidoc +0 -487
- data/docs/configuration.asciidoc +0 -889
- data/docs/custom-instrumentation.asciidoc +0 -80
- data/docs/debugging.asciidoc +0 -44
- data/docs/getting-started-rails.asciidoc +0 -30
- data/docs/graphql.asciidoc +0 -23
- data/docs/index.asciidoc +0 -38
- data/docs/introduction.asciidoc +0 -36
- data/docs/metrics.asciidoc +0 -235
- data/docs/opentracing.asciidoc +0 -94
- data/docs/performance-tuning.asciidoc +0 -106
- data/docs/redirects.asciidoc +0 -9
- data/docs/release-notes.asciidoc +0 -15
- data/docs/set-up.asciidoc +0 -19
- data/docs/supported-technologies.asciidoc +0 -157
- data/docs/upgrading.asciidoc +0 -18
- /data/docs/{images → reference/images}/dynamic-config.svg +0 -0
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
---
|
|
2
|
+
navigation_title: "Elastic APM Ruby Agent"
|
|
3
|
+
mapped_pages:
|
|
4
|
+
- https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes.html
|
|
5
|
+
- https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes-4.x.html
|
|
6
|
+
applies_to:
|
|
7
|
+
stack:
|
|
8
|
+
serverless:
|
|
9
|
+
observability:
|
|
10
|
+
product:
|
|
11
|
+
apm_agent_ruby: ga
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Elastic APM Ruby Agent release notes [elastic-apm-ruby-agent-release-notes]
|
|
15
|
+
|
|
16
|
+
Review the changes, fixes, and more in each version of Elastic APM Ruby Agent.
|
|
17
|
+
|
|
18
|
+
To check for security updates, go to [Security announcements for the Elastic stack](https://discuss.elastic.co/c/announcements/security-announcements/31).
|
|
19
|
+
|
|
20
|
+
All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.md).
|
|
21
|
+
|
|
22
|
+
% Release notes includes only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
|
|
23
|
+
|
|
24
|
+
% ## version.next [elastic-apm-ruby-agent-versionext-release-notes]
|
|
25
|
+
% **Release date:** Month day, year
|
|
26
|
+
|
|
27
|
+
% ### Features and enhancements [elastic-apm-ruby-agent-versionext-features-enhancements]
|
|
28
|
+
|
|
29
|
+
% ### Fixes [elastic-apm-ruby-agent-versionext-fixes]
|
|
30
|
+
|
|
31
|
+
## 4.9.0 [elastic-apm-ruby-agent-490-release-notes]
|
|
32
|
+
|
|
33
|
+
### Features and enhancements [elastic-apm-ruby-agent-490-features-enhancements]
|
|
34
|
+
* Add ability to configure sampling rate based on transaction span name [#1531](https://github.com/elastic/apm-agent-ruby/pull/1531)
|
|
35
|
+
* Set version 7.0 as http gem upper bound in gemspec [#1624](https://github.com/elastic/apm-agent-ruby/pull/1624)
|
|
36
|
+
|
|
37
|
+
### Fixes [elastic-apm-ruby-agent-490-fixes]
|
|
38
|
+
* Use status code explicitly in central config for changes in http 6.0 [#1615](https://github.com/elastic/apm-agent-ruby/pull/1615)
|
|
39
|
+
* Use headers method directly for compatibility with all versions of http [#1629](https://github.com/elastic/apm-agent-ruby/pull/1629)
|
|
40
|
+
|
|
41
|
+
## 4.8.0 [elastic-apm-ruby-agent-480-release-notes]
|
|
42
|
+
|
|
43
|
+
### Features and enhancements [elastic-apm-ruby-agent-480-features-enhancements]
|
|
44
|
+
* Support ruby 3.4 [#1510](https://github.com/elastic/apm-agent-ruby/pull/1510)
|
|
45
|
+
|
|
46
|
+
## 4.7.3 [elastic-apm-ruby-agent-473-release-notes]
|
|
47
|
+
|
|
48
|
+
### Fixes [elastic-apm-ruby-agent-473-fixes]
|
|
49
|
+
* Address a bug where if `capture_headers` is false, `ContextBuilder` will raise `"undefined method 'has_key?' for nil:NilClass"` [#1449](https://github.com/elastic/apm-agent-ruby/pull/1449)
|
|
50
|
+
|
|
51
|
+
## 4.7.2 [elastic-apm-ruby-agent-472-release-notes]
|
|
52
|
+
|
|
53
|
+
### Fixes [elastic-apm-ruby-agent-472-fixes]
|
|
54
|
+
* Address machineType not being returned in GCP metadata [#1435](https://github.com/elastic/apm-agent-ruby/pull/1435)
|
|
55
|
+
|
|
56
|
+
## 4.7.1 [elastic-apm-ruby-agent-471-release-notes]
|
|
57
|
+
|
|
58
|
+
### Fixes [elastic-apm-ruby-agent-471-fixes]
|
|
59
|
+
* Skip capturing cookie header when it’s set separately [#1405](https://github.com/elastic/apm-agent-ruby/pull/1405)
|
|
60
|
+
* Changes/fixes to metadata.cloud.* fields collected for GCP [#1415](https://github.com/elastic/apm-agent-ruby/pull/1415)
|
|
61
|
+
* Pin version of bigdecimal for ruby 2.4 [#1417](https://github.com/elastic/apm-agent-ruby/pull/1417)
|
|
62
|
+
* Use response method on Faraday error for older versions of the library [#1419](https://github.com/elastic/apm-agent-ruby/pull/1419)
|
|
63
|
+
* Fix ActionDispatchSpy#render_exception for Rails 7.1 [#1423](https://github.com/elastic/apm-agent-ruby/pull/1423)
|
|
64
|
+
* Use graphql < 2.1 when Ruby < 2.7 [#1425](https://github.com/elastic/apm-agent-ruby/pull/1425)
|
|
65
|
+
* Guard against various Faraday exception response formats [#1428](https://github.com/elastic/apm-agent-ruby/pull/1428)
|
|
66
|
+
|
|
67
|
+
## 4.7.0 [elastic-apm-ruby-agent-470-release-notes]
|
|
68
|
+
|
|
69
|
+
### Features and enhancements [elastic-apm-ruby-agent-470-features-enhancements]
|
|
70
|
+
* Add keyword args for span_method helper [#1395](https://github.com/elastic/apm-agent-ruby/pull/1395)
|
|
71
|
+
|
|
72
|
+
### Fixes [elastic-apm-ruby-agent-470-fixes]
|
|
73
|
+
* Handle Faraday response being nil [#1382](https://github.com/elastic/apm-agent-ruby/pull/1382)
|
|
74
|
+
* Fix error with invalid %-encoding [#1400](https://github.com/elastic/apm-agent-ruby/pull/1400)
|
|
75
|
+
|
|
76
|
+
## 4.6.2 [elastic-apm-ruby-agent-462-release-notes]
|
|
77
|
+
|
|
78
|
+
### Fixes [elastic-apm-ruby-agent-462-fixes]
|
|
79
|
+
* Fix Faraday::RackBuilder::StackLocked [#1371](https://github.com/elastic/apm-agent-ruby/pull/1371)
|
|
80
|
+
|
|
81
|
+
## 4.6.1 [elastic-apm-ruby-agent-461-release-notes]
|
|
82
|
+
|
|
83
|
+
### Fixes [elastic-apm-ruby-agent-461-fixes]
|
|
84
|
+
* Fix growing number of open file descriptors when HTTP request to APM is never sent [#1351](https://github.com/elastic/apm-agent-ruby/pull/1351)
|
|
85
|
+
* Fix setting span http status code when Faraday Middleware is used [#1368](https://github.com/elastic/apm-agent-ruby/pull/1368)
|
|
86
|
+
* Handle whitespace when splitting tracestate entries [#1353](https://github.com/elastic/apm-agent-ruby/pull/1353)
|
|
87
|
+
|
|
88
|
+
## 4.6.0 [elastic-apm-ruby-agent-460-release-notes]
|
|
89
|
+
|
|
90
|
+
### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
|
|
91
|
+
* Added transaction_name to reported error to allow grouping by transaction name [#1267](https://github.com/elastic/apm-agent-ruby/pull/1267)
|
|
92
|
+
* Added ability to query server for version (useful in the future) [#1278](https://github.com/elastic/apm-agent-ruby/pull/1278)
|
|
93
|
+
* Added instrumentation for [https://github.com/zendesk/racecar/](https://github.com/zendesk/racecar/) Racecar Kafka library [#1284](https://github.com/elastic/apm-agent-ruby/pull/1284)
|
|
94
|
+
* Expanded filtering to sanitize any key that contains the string *auth* [#1266](https://github.com/elastic/apm-agent-ruby/pull/1266)
|
|
95
|
+
* Rename `log_ecs_formatting` option to `log_ecs_reformatting`, deprecate old option name [#1248](https://github.com/elastic/apm-agent-ruby/pull/1248)
|
|
96
|
+
* When the configuration value for `log_path` is set, override the `logger` to point to that path instead of using e.g. Rails logger [#1247](https://github.com/elastic/apm-agent-ruby/pull/1247)
|
|
97
|
+
* Only send tracestate header for distributed tracing when it has content [#1277](https://github.com/elastic/apm-agent-ruby/pull/1277)
|
|
98
|
+
* Use the hostname as the Kubernetes pod name in the Container Info metadata if the pod id is parsed from cgroup [#1314](https://github.com/elastic/apm-agent-ruby/pull/1314)
|
|
99
|
+
|
|
100
|
+
### Fixes [elastic-apm-ruby-agent-460-fixes]
|
|
101
|
+
* Small change to Sidekiq tests to handle new configuration passing method [#1283](https://github.com/elastic/apm-agent-ruby/pull/1283)
|
|
102
|
+
* Set transaction sample rate to 0 when it’s unsampled [#1339](https://github.com/elastic/apm-agent-ruby/pull/1339)
|
|
103
|
+
* Don’t send unsampled transactions to APM server >= 8.0 [#1341](https://github.com/elastic/apm-agent-ruby/pull/1341)
|
|
104
|
+
|
|
105
|
+
## 4.5.1 [elastic-apm-ruby-agent-451-release-notes]
|
|
106
|
+
|
|
107
|
+
### Features and enhancements [elastic-apm-ruby-agent-461-features-enhancements]
|
|
108
|
+
* Update elasticsearch spy to use new transport gem name [#1257](https://github.com/elastic/apm-agent-ruby/pull/1257)
|
|
109
|
+
* Standardize placeholder for phone numbers as [PHONENUMBER] per [https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-aws.md](https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-aws.md) [#1246](https://github.com/elastic/apm-agent-ruby/pull/1246)
|
|
110
|
+
|
|
111
|
+
### Fixes [elastic-apm-ruby-agent-451-fixes]
|
|
112
|
+
* Fixed dependencies to allow CI to build successfully [#1259](https://github.com/elastic/apm-agent-ruby/pull/1259)
|
|
113
|
+
* Fixed warnings related to TimeTask timeouts [#1255](https://github.com/elastic/apm-agent-ruby/pull/1255)
|
|
114
|
+
|
|
115
|
+
## 4.5.0 [elastic-apm-ruby-agent-450-release-notes]
|
|
116
|
+
|
|
117
|
+
### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
|
|
118
|
+
* Stop collecting the field `http.request.socket.encrypted` [#1181](https://github.com/elastic/apm-agent-ruby/pull/1181)
|
|
119
|
+
|
|
120
|
+
### Fixes [elastic-apm-ruby-agent-450-fixes]
|
|
121
|
+
* Fixed MongoDB spy thread safety [#1202](https://github.com/elastic/apm-agent-ruby/pull/1202)
|
|
122
|
+
* Fixed span context fields for DynamoDB instrumentation [#1178](https://github.com/elastic/apm-agent-ruby/pull/1178)
|
|
123
|
+
* Fixed span context fields for S3 instrumentation [#1179](https://github.com/elastic/apm-agent-ruby/pull/1179)
|
|
124
|
+
* Update user agent info to match spec [#1182](https://github.com/elastic/apm-agent-ruby/pull/1182)
|
|
125
|
+
|
|
126
|
+
## 4.4.0 [elastic-apm-ruby-agent-440-release-notes]
|
|
127
|
+
|
|
128
|
+
### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
|
|
129
|
+
* Optional span to be ended instead of current span [#1039](https://github.com/elastic/apm-agent-ruby/pull/1039)
|
|
130
|
+
* Config option `log_ecs_formatting` [#1053](https://github.com/elastic/apm-agent-ruby/pull/1053)
|
|
131
|
+
|
|
132
|
+
### Fixes [elastic-apm-ruby-agent-440-fixes]
|
|
133
|
+
* Fixed detecting Linux on Alpine for CPU/MEM metrics [#1057](https://github.com/elastic/apm-agent-ruby/pull/1057)
|
|
134
|
+
|
|
135
|
+
## 4.3.0 [elastic-apm-ruby-agent-430-release-notes]
|
|
136
|
+
|
|
137
|
+
### Features and enhancements [elastic-apm-ruby-agent-430-features-enhancements]
|
|
138
|
+
* Add JVM memory metrics [#1040](https://github.com/elastic/apm-agent-ruby/pull/1040)
|
|
139
|
+
|
|
140
|
+
## 4.2.0 [elastic-apm-ruby-agent-420-release-notes]
|
|
141
|
+
|
|
142
|
+
### Features and enhancements [elastic-apm-ruby-agent-420-features-enhancements]
|
|
143
|
+
* Add support for AWS Storage Table/CosmosDB [#999](https://github.com/elastic/apm-agent-ruby/pull/999)
|
|
144
|
+
|
|
145
|
+
### Fixes [elastic-apm-ruby-agent-420-fixes]
|
|
146
|
+
* Align HTTP span types/subtypes with spec [#1014](https://github.com/elastic/apm-agent-ruby/pull/1014)
|
|
147
|
+
* Passing a full URL as a path to `Net::HTTP` [#1029](https://github.com/elastic/apm-agent-ruby/pull/1029)
|
|
148
|
+
* Fix growing number of open file descriptors [#1033](https://github.com/elastic/apm-agent-ruby/pull/1033)
|
|
149
|
+
|
|
150
|
+
## 4.1.0 [elastic-apm-ruby-agent-410-release-notes]
|
|
151
|
+
|
|
152
|
+
### Features and enhancements [elastic-apm-ruby-agent-410-features-enhancements]
|
|
153
|
+
* Azure App Services instance metadata [#1007](https://github.com/elastic/apm-agent-ruby/pull/1007)
|
|
154
|
+
* `hostname` is now reported split by `configured_hostname` and `detected_hostname` [#1009](https://github.com/elastic/apm-agent-ruby/pull/1009)
|
|
155
|
+
|
|
156
|
+
### Fixes [elastic-apm-ruby-agent-410-fixes]
|
|
157
|
+
* `service_node_name` is now correctly reported as `service.node.configured_name` [#1009](https://github.com/elastic/apm-agent-ruby/pull/1009)
|
|
158
|
+
* Fix JSON parsing when using yajl-ruby [#1012](https://github.com/elastic/apm-agent-ruby/pull/1012)
|
|
159
|
+
* Fix SpanHelpers when methods take blocks [#1013](https://github.com/elastic/apm-agent-ruby/pull/1013)
|
|
160
|
+
* Fix missing `environment` param when fetching from Central Config [#1014](https://github.com/elastic/apm-agent-ruby/pull/1014)
|
|
161
|
+
|
|
162
|
+
## 4.0.0 [elastic-apm-ruby-agent-400-release-notes]
|
|
163
|
+
|
|
164
|
+
### Features and enhancements [elastic-apm-ruby-agent-400-features-enhancements]
|
|
165
|
+
* Be aware that this release changes the agent’s general approach to instrumenting third party libraries. It now uses `Module#prepend` over alias method chaining. This doesn’t necessarily impact your application but it could if you are using other gems that use the old approach to patch the same method. Mixing the two approaches can lead to infinite recursion.
|
|
166
|
+
* Removed support for Ruby 2.3 and JRuby 9.1 [#901](https://github.com/elastic/apm-agent-ruby/pull/901)
|
|
167
|
+
* Removed config option `active`, see `enabled` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
168
|
+
* Removed config option `custom_key_filters`, see `sanitize_field_names` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
169
|
+
* Removed config option `default_tags`, see `global_labels` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
170
|
+
* Removed config option `default_labels`, see `global_labels` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
171
|
+
* Removed config option `ignore_url_patterns`, see `transaction_ignore_urls` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
172
|
+
* Removed config option `use_legacy_sql_parser`, legacy parser no longer included [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
173
|
+
* Integrations (Spies) use Module#prepend over class_eval [#890](https://github.com/elastic/apm-agent-ruby/pull/890)
|
|
174
|
+
* The secrets filter no longer filters based on values, see `sanitize_field_names` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
175
|
+
* The secrets filter is aligned with other agents, see `sanitize_field_names` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
|
|
176
|
+
* Added `set_service` API [#1006](https://github.com/elastic/apm-agent-ruby/pull/1006)
|
|
177
|
+
|
|
178
|
+
### Fixes [elastic-apm-ruby-agent-400-fixes]
|
|
179
|
+
* AWS S3 spy accepts symbol bucket names [#998](https://github.com/elastic/apm-agent-ruby/pull/998)
|
|
180
|
+
* AWS S3 spy passing on blocks [#998](https://github.com/elastic/apm-agent-ruby/pull/998)
|
|
181
|
+
* SQL scanner now recognizes CQL style comments [#1004](https://github.com/elastic/apm-agent-ruby/pull/1004)
|
|
182
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
navigation_title: "Known issues"
|
|
3
|
+
applies_to:
|
|
4
|
+
stack:
|
|
5
|
+
serverless:
|
|
6
|
+
observability:
|
|
7
|
+
product:
|
|
8
|
+
apm_agent_ruby: ga
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Elastic APM Ruby Agent known issues [elastic-apm-ruby-agent-known-issues]
|
|
12
|
+
|
|
13
|
+
Known issues are significant defects or limitations that may impact your implementation. These issues are actively being worked on and will be addressed in a future release. Review the Elastic APM Ruby Agent known issues to help you make informed decisions, such as upgrading to a new version.
|
|
14
|
+
|
|
15
|
+
% Use the following template to add entries to this page.
|
|
16
|
+
|
|
17
|
+
% :::{dropdown} Title of known issue
|
|
18
|
+
% **Details**
|
|
19
|
+
% On [Month/Day/Year], a known issue was discovered that [description of known issue].
|
|
20
|
+
|
|
21
|
+
% **Workaround**
|
|
22
|
+
% Workaround description.
|
|
23
|
+
|
|
24
|
+
% **Resolved**
|
|
25
|
+
% On [Month/Day/Year], this issue was resolved.
|
|
26
|
+
|
|
27
|
+
:::
|
|
28
|
+
|
|
29
|
+
_No known issues_
|
data/elastic-apm.gemspec
CHANGED
|
@@ -29,14 +29,14 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.homepage = 'https://github.com/elastic/apm-agent-ruby'
|
|
30
30
|
spec.metadata = { 'source_code_uri' => 'https://github.com/elastic/apm-agent-ruby' }
|
|
31
31
|
spec.license = 'Apache-2.0'
|
|
32
|
-
spec.required_ruby_version = ">= 2.3.0"
|
|
32
|
+
spec.required_ruby_version = ">= 2.3.0", "< 4.0"
|
|
33
33
|
|
|
34
34
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
35
35
|
f.match(%r{^(test|spec|features)/})
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
spec.add_dependency('concurrent-ruby', '~> 1.0')
|
|
39
|
-
spec.add_dependency('http', '>= 3.0')
|
|
39
|
+
spec.add_dependency('http', '>= 3.0', '< 7.0')
|
|
40
40
|
spec.add_runtime_dependency('ruby2_keywords')
|
|
41
41
|
|
|
42
42
|
spec.require_paths = ['lib']
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Licensed to Elasticsearch B.V. under one or more contributor
|
|
2
|
+
# license agreements. See the NOTICE file distributed with
|
|
3
|
+
# this work for additional information regarding copyright
|
|
4
|
+
# ownership. Elasticsearch B.V. licenses this file to you under
|
|
5
|
+
# the Apache License, Version 2.0 (the "License"); you may
|
|
6
|
+
# not use this file except in compliance with the License.
|
|
7
|
+
# You may obtain a copy of the License at
|
|
8
|
+
#
|
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
#
|
|
11
|
+
# Unless required by applicable law or agreed to in writing,
|
|
12
|
+
# software distributed under the License is distributed on an
|
|
13
|
+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
# KIND, either express or implied. See the License for the
|
|
15
|
+
# specific language governing permissions and limitations
|
|
16
|
+
# under the License.
|
|
17
|
+
|
|
18
|
+
# frozen_string_literal: true
|
|
19
|
+
|
|
20
|
+
module ElasticAPM
|
|
21
|
+
class Config
|
|
22
|
+
# @api private
|
|
23
|
+
class RoundFloatHashValue
|
|
24
|
+
def initialize
|
|
25
|
+
@float_converter = RoundFloat.new
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def call(hash)
|
|
29
|
+
return {} unless hash
|
|
30
|
+
|
|
31
|
+
hash.transform_values { |value| @float_converter.call(value) }
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
data/lib/elastic_apm/config.rb
CHANGED
|
@@ -22,6 +22,7 @@ require 'elastic_apm/config/duration'
|
|
|
22
22
|
require 'elastic_apm/config/log_level_map'
|
|
23
23
|
require 'elastic_apm/config/options'
|
|
24
24
|
require 'elastic_apm/config/round_float'
|
|
25
|
+
require 'elastic_apm/config/round_float_hash_value'
|
|
25
26
|
require 'elastic_apm/config/regexp_list'
|
|
26
27
|
require 'elastic_apm/config/wildcard_pattern_list'
|
|
27
28
|
require 'elastic_apm/deprecations'
|
|
@@ -98,6 +99,7 @@ module ElasticAPM
|
|
|
98
99
|
option :transaction_ignore_urls, type: :list, default: [], converter: WildcardPatternList.new
|
|
99
100
|
option :transaction_max_spans, type: :int, default: 500
|
|
100
101
|
option :transaction_sample_rate, type: :float, default: 1.0, converter: RoundFloat.new
|
|
102
|
+
option :transaction_sample_rate_by_name, type: :hash, default: {}, converter: RoundFloatHashValue.new
|
|
101
103
|
option :use_elastic_traceparent_header, type: :bool, default: true
|
|
102
104
|
option :verify_server_cert, type: :bool, default: true
|
|
103
105
|
|
|
@@ -79,8 +79,11 @@ module ElasticAPM
|
|
|
79
79
|
when 'application/x-www-form-urlencoded', 'multipart/form-data'
|
|
80
80
|
req.POST.dup
|
|
81
81
|
else
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
io = req.body
|
|
83
|
+
return '' unless io
|
|
84
|
+
|
|
85
|
+
body = io.read
|
|
86
|
+
io.rewind
|
|
84
87
|
body.byteslice(0, MAX_BODY_LENGTH).force_encoding('utf-8').scrub
|
|
85
88
|
end
|
|
86
89
|
end
|
|
@@ -123,7 +123,7 @@ module ElasticAPM
|
|
|
123
123
|
sampled = trace_context.recorded?
|
|
124
124
|
sample_rate = trace_context.tracestate.sample_rate
|
|
125
125
|
else
|
|
126
|
-
sampled = random_sample?(config)
|
|
126
|
+
sampled = random_sample?(config.transaction_sample_rate)
|
|
127
127
|
sample_rate = sampled ? config.transaction_sample_rate : 0
|
|
128
128
|
end
|
|
129
129
|
|
|
@@ -195,6 +195,19 @@ module ElasticAPM
|
|
|
195
195
|
current_transaction
|
|
196
196
|
end
|
|
197
197
|
return unless transaction
|
|
198
|
+
|
|
199
|
+
unless trace_context
|
|
200
|
+
span_sample_rate = transaction_sample_rate_for_name(name, transaction.config)
|
|
201
|
+
# if the span sample rate is different from the transaction sample rate,
|
|
202
|
+
# we need to check if the span should be sampled
|
|
203
|
+
# and update the transaction's sample rate accordingly
|
|
204
|
+
if transaction.started_spans == 0 && span_sample_rate && span_sample_rate != transaction.sample_rate
|
|
205
|
+
span_sampled = random_sample?(span_sample_rate)
|
|
206
|
+
transaction.sampled = span_sampled
|
|
207
|
+
transaction.sample_rate = span_sampled ? span_sample_rate : 0
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
198
211
|
return unless transaction.sampled?
|
|
199
212
|
return unless transaction.inc_started_spans!
|
|
200
213
|
|
|
@@ -278,10 +291,17 @@ module ElasticAPM
|
|
|
278
291
|
'>'
|
|
279
292
|
end
|
|
280
293
|
|
|
294
|
+
def transaction_sample_rate_for_name(name, config)
|
|
295
|
+
return if !name || config.transaction_sample_rate_by_name.empty?
|
|
296
|
+
return unless config.transaction_sample_rate_by_name.key?(name)
|
|
297
|
+
|
|
298
|
+
config.transaction_sample_rate_by_name[name]
|
|
299
|
+
end
|
|
300
|
+
|
|
281
301
|
private
|
|
282
302
|
|
|
283
|
-
def random_sample?(
|
|
284
|
-
rand <=
|
|
303
|
+
def random_sample?(sample_rate)
|
|
304
|
+
rand <= sample_rate
|
|
285
305
|
end
|
|
286
306
|
|
|
287
307
|
def update_transaction_metrics(transaction)
|
|
@@ -49,7 +49,7 @@ module ElasticAPM
|
|
|
49
49
|
context: context
|
|
50
50
|
) do |span|
|
|
51
51
|
trace_context = span&.trace_context || transaction.trace_context
|
|
52
|
-
trace_context.apply_headers { |key, value| req[key] = value }
|
|
52
|
+
trace_context.apply_headers { |key, value| req.headers[key] = value }
|
|
53
53
|
|
|
54
54
|
result = super(req, options)
|
|
55
55
|
|
|
@@ -24,6 +24,7 @@ module ElasticAPM
|
|
|
24
24
|
class SidekiqSpy
|
|
25
25
|
ACTIVE_JOB_WRAPPER =
|
|
26
26
|
'ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper'
|
|
27
|
+
ACTIVE_JOB_WRAPPER_V8 = 'Sidekiq::ActiveJob::Wrapper'
|
|
27
28
|
|
|
28
29
|
# @api private
|
|
29
30
|
class Middleware
|
|
@@ -50,7 +51,7 @@ module ElasticAPM
|
|
|
50
51
|
klass = job['class']
|
|
51
52
|
|
|
52
53
|
case klass
|
|
53
|
-
when ACTIVE_JOB_WRAPPER
|
|
54
|
+
when ACTIVE_JOB_WRAPPER, ACTIVE_JOB_WRAPPER_V8
|
|
54
55
|
job['wrapped']
|
|
55
56
|
else
|
|
56
57
|
klass
|
|
@@ -24,7 +24,7 @@ module ElasticAPM
|
|
|
24
24
|
# @api private
|
|
25
25
|
class StacktraceBuilder
|
|
26
26
|
JAVA_FORMAT = /^(.+)\.([^.]+)\(([^:]+):(\d+)\)$/.freeze
|
|
27
|
-
RUBY_FORMAT = /^(.+?):(\d+)(?::in `(.+?)')?$/.freeze
|
|
27
|
+
RUBY_FORMAT = /^(.+?):(\d+)(?::in ['`](.+#)?(.+?)')?$/.freeze
|
|
28
28
|
|
|
29
29
|
RUBY_VERS_REGEX = %r{ruby(/gems)?[-/](\d+\.)+\d}.freeze
|
|
30
30
|
JRUBY_ORG_REGEX = %r{org/jruby}.freeze
|
|
@@ -77,9 +77,9 @@ module ElasticAPM
|
|
|
77
77
|
ruby_match = line.match(RUBY_FORMAT)
|
|
78
78
|
|
|
79
79
|
if ruby_match
|
|
80
|
-
_, file, number, method = ruby_match.to_a
|
|
80
|
+
_, file, number, module_name, method = ruby_match.to_a
|
|
81
81
|
file.sub!(/\.class$/, '.rb')
|
|
82
|
-
module_name
|
|
82
|
+
module_name&.sub!('#', '')
|
|
83
83
|
else
|
|
84
84
|
java_match = line.match(JAVA_FORMAT)
|
|
85
85
|
_, module_name, method, file, number = java_match.to_a
|
|
@@ -87,7 +87,15 @@ module ElasticAPM
|
|
|
87
87
|
end
|
|
88
88
|
# rubocop:enable Metrics/ParameterLists
|
|
89
89
|
|
|
90
|
-
attr_accessor
|
|
90
|
+
attr_accessor(
|
|
91
|
+
:name,
|
|
92
|
+
:type,
|
|
93
|
+
:result,
|
|
94
|
+
:outcome,
|
|
95
|
+
:sampled,
|
|
96
|
+
:sample_rate,
|
|
97
|
+
:started_spans
|
|
98
|
+
)
|
|
91
99
|
|
|
92
100
|
attr_reader(
|
|
93
101
|
:breakdown_metrics,
|
|
@@ -98,12 +106,11 @@ module ElasticAPM
|
|
|
98
106
|
:framework_name,
|
|
99
107
|
:notifications,
|
|
100
108
|
:self_time,
|
|
101
|
-
:sample_rate,
|
|
102
109
|
:span_frames_min_duration,
|
|
103
|
-
:started_spans,
|
|
104
110
|
:timestamp,
|
|
105
111
|
:trace_context,
|
|
106
|
-
:transaction_max_spans
|
|
112
|
+
:transaction_max_spans,
|
|
113
|
+
:config
|
|
107
114
|
)
|
|
108
115
|
|
|
109
116
|
alias :collect_metrics? :collect_metrics
|
data/lib/elastic_apm/version.rb
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Config file for `updatecli compose ...`.
|
|
2
|
+
# https://www.updatecli.io/docs/core/compose/
|
|
3
|
+
policies:
|
|
4
|
+
- name: Handle apm-data server specs
|
|
5
|
+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-data-spec:0.6.0@sha256:c0bbdec23541bed38df1342c95aeb601530a113db1ff11715c1c7616ed5e9e8b
|
|
6
|
+
values:
|
|
7
|
+
- .ci/updatecli/values.d/scm.yml
|
|
8
|
+
- .ci/updatecli/values.d/apm-data-spec.yml
|
|
9
|
+
- name: Handle apm gherkin specs
|
|
10
|
+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-gherkin:0.6.0@sha256:dbaf4d855c5c212c3b5a8d2cc98c243a2b769ac347198ae8814393a1a0576587
|
|
11
|
+
values:
|
|
12
|
+
- .ci/updatecli/values.d/scm.yml
|
|
13
|
+
- .ci/updatecli/values.d/apm-gherkin.yml
|
|
14
|
+
- name: Handle apm json specs
|
|
15
|
+
policy: ghcr.io/elastic/oblt-updatecli-policies/apm/apm-json-specs:0.6.0@sha256:e5a74c159ceed02fd20515ea76fa25ff81e3ccf977e74e636f9973db86aa52a5
|
|
16
|
+
values:
|
|
17
|
+
- .ci/updatecli/values.d/scm.yml
|
|
18
|
+
- .ci/updatecli/values.d/apm-json-specs.yml
|
|
19
|
+
- name: Update Updatecli policies
|
|
20
|
+
policy: ghcr.io/updatecli/policies/autodiscovery/updatecli:0.8.0@sha256:99e9e61b501575c2c176c39f2275998d198b590a3f6b1fe829f7315f8d457e7f
|
|
21
|
+
values:
|
|
22
|
+
- .ci/updatecli/values.d/scm.yml
|
|
23
|
+
- .ci/updatecli/values.d/update-compose.yml
|