elastic-apm 4.7.3 → 4.8.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.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.exclude.yml +21 -82
  3. data/.ci/.framework.yml +1 -4
  4. data/.ci/.ruby.yml +1 -1
  5. data/.ci/updatecli/values.d/apm-data-spec.yml +1 -0
  6. data/.ci/updatecli/values.d/apm-gherkin.yml +1 -0
  7. data/.ci/updatecli/values.d/apm-json-specs.yml +1 -0
  8. data/.ci/updatecli/values.d/scm.yml +10 -0
  9. data/.ci/updatecli/values.d/update-compose.yml +3 -0
  10. data/.github/PULL_REQUEST_TEMPLATE.md +2 -2
  11. data/.github/dependabot.yml +24 -19
  12. data/.github/workflows/README.md +1 -2
  13. data/.github/workflows/addToProject.yml +16 -2
  14. data/.github/workflows/ci.yml +6 -6
  15. data/.github/workflows/docs-build.yml +19 -0
  16. data/.github/workflows/docs-cleanup.yml +14 -0
  17. data/.github/workflows/github-commands-comment.yml +38 -0
  18. data/.github/workflows/microbenchmark.yml +7 -24
  19. data/.github/workflows/release.yml +39 -24
  20. data/.github/workflows/run-matrix.yml +21 -12
  21. data/.github/workflows/test-reporter.yml +4 -3
  22. data/.github/workflows/updatecli.yml +45 -13
  23. data/Gemfile +13 -0
  24. data/bin/dev +2 -2
  25. data/docs/docset.yml +9 -0
  26. data/docs/reference/advanced-topics.md +12 -0
  27. data/docs/reference/api-reference.md +422 -0
  28. data/docs/reference/configuration.md +734 -0
  29. data/docs/{context.asciidoc → reference/context.md} +21 -21
  30. data/docs/reference/custom-instrumentation.md +72 -0
  31. data/docs/{getting-started-rack.asciidoc → reference/getting-started-rack.md} +20 -29
  32. data/docs/reference/getting-started-rails.md +27 -0
  33. data/docs/reference/graphql.md +21 -0
  34. data/docs/reference/index.md +24 -0
  35. data/docs/{logs.asciidoc → reference/logs.md} +38 -56
  36. data/docs/reference/metrics.md +199 -0
  37. data/docs/reference/opentracing-api.md +70 -0
  38. data/docs/reference/performance-tuning.md +71 -0
  39. data/docs/reference/set-up-apm-ruby-agent.md +16 -0
  40. data/docs/reference/supported-technologies.md +128 -0
  41. data/docs/reference/toc.yml +22 -0
  42. data/docs/reference/upgrading.md +19 -0
  43. data/docs/release-notes/index.md +166 -0
  44. data/docs/release-notes/known-issues.md +24 -0
  45. data/docs/release-notes/toc.yml +3 -0
  46. data/lib/elastic_apm/context_builder.rb +5 -2
  47. data/lib/elastic_apm/spies/sidekiq.rb +2 -1
  48. data/lib/elastic_apm/stacktrace_builder.rb +3 -3
  49. data/lib/elastic_apm/version.rb +1 -1
  50. data/updatecli-compose.yaml +23 -0
  51. metadata +37 -36
  52. data/.ci/snapshoty.yml +0 -33
  53. data/.ci/updatecli/updatecli.d/update-gherkin-specs.yml +0 -84
  54. data/.ci/updatecli/updatecli.d/update-json-specs.yml +0 -84
  55. data/.ci/updatecli/updatecli.d/update-specs.yml +0 -86
  56. data/.ci/updatecli/values.yml +0 -14
  57. data/.github/workflows/coverage-reporter.yml +0 -34
  58. data/.github/workflows/opentelemetry.yml +0 -22
  59. data/.github/workflows/snapshoty.yml +0 -35
  60. data/CHANGELOG.asciidoc +0 -990
  61. data/docs/advanced.asciidoc +0 -14
  62. data/docs/api.asciidoc +0 -487
  63. data/docs/configuration.asciidoc +0 -889
  64. data/docs/custom-instrumentation.asciidoc +0 -80
  65. data/docs/debugging.asciidoc +0 -44
  66. data/docs/getting-started-rails.asciidoc +0 -30
  67. data/docs/graphql.asciidoc +0 -23
  68. data/docs/index.asciidoc +0 -38
  69. data/docs/introduction.asciidoc +0 -36
  70. data/docs/metrics.asciidoc +0 -235
  71. data/docs/opentracing.asciidoc +0 -94
  72. data/docs/performance-tuning.asciidoc +0 -106
  73. data/docs/redirects.asciidoc +0 -9
  74. data/docs/release-notes.asciidoc +0 -15
  75. data/docs/set-up.asciidoc +0 -19
  76. data/docs/supported-technologies.asciidoc +0 -157
  77. data/docs/upgrading.asciidoc +0 -18
  78. /data/docs/{images → reference/images}/dynamic-config.svg +0 -0
@@ -0,0 +1,70 @@
1
+ ---
2
+ mapped_pages:
3
+ - https://www.elastic.co/guide/en/apm/agent/ruby/current/opentracing.html
4
+ ---
5
+
6
+ # OpenTracing API [opentracing]
7
+
8
+ The Elastic APM OpenTracing bridge allows to create Elastic APM `Transactions` and `Spans`, using the OpenTracing API. In other words, it translates the calls to the OpenTracing API to Elastic APM and thus allows for reusing existing instrumentation.
9
+
10
+ The first span of a service will be converted to an Elastic APM `Transaction`, subsequent spans are mapped to Elastic APM `Span`.
11
+
12
+
13
+ ## Operation Modes [operation-modes]
14
+
15
+ This bridge allows for different operation modes in combination with the Elastic APM Agent.
16
+
17
+ * Noop<br> If no Elastic APM agent is running, the bridge is in noop mode and does not actually record and report spans.
18
+ * Mix and Match<br> If you want to leverage the auto instrumentation of Elastic APM, but also want do create custom spans or use the OpenTracing API to add custom tags to the spans created by Elastic APM, you can just do that. The OpenTracing bridge and the standard Elastic APM API interact seamlessly.
19
+ * Manual instrumentation<br> If you don’t want Elastic APM to auto-instrument known frameworks, but instead only rely on manual instrumentation, disable the auto instrumentation setting the configuration option [`instrument`](/reference/configuration.md#config-instrument) to `false`.
20
+
21
+
22
+ ## Getting started [getting-started]
23
+
24
+ Either `require 'elastic_apm/opentracing'` during the boot of your app or specify the `require:` argument to your `Gemfile`, eg. `gem 'elastic_apm', require: 'elastic_apm/opentracing'`.
25
+
26
+
27
+ ## Set Elastic APM as the global tracer [init-tracer]
28
+
29
+ ```ruby
30
+ ::OpenTracing.global_tracer = ElasticAPM::OpenTracing::Tracer.new
31
+ ```
32
+
33
+
34
+ ## Elastic APM specific tags [elastic-apm-tags]
35
+
36
+ Elastic APM defines some tags which are not included in the OpenTracing API but are relevant in the context of Elastic APM.
37
+
38
+ * `type` - sets the type of the transaction, for example `request`, `ext` or `db`
39
+ * `user.id` - sets the user id, appears in the "User" tab in the transaction details in the Elastic APM app
40
+ * `user.email` - sets the user email, appears in the "User" tab in the transaction details in the Elastic APM app
41
+ * `user.username` - sets the user name, appears in the "User" tab in the transaction details in the Elastic APM app
42
+ * `result` - sets the result of the transaction. Overrides the default value of `success`. If the `error` tag is set to `true`, the default value is `error`.
43
+
44
+
45
+ ## Caveats [unsupported]
46
+
47
+ Not all features of the OpenTracing API are supported.
48
+
49
+
50
+ ### Context propagation [propagation]
51
+
52
+ This bridge only supports the format `OpenTracing::FORMAT_RACK`, using HTTP headers with capitalized names, prefixed with `HTTP_` as Rack does it.
53
+
54
+ `OpenTracing::FORMAT_BINARY` is currently not supported.
55
+
56
+
57
+ ### Span References [references]
58
+
59
+ Currently, this bridge only supports `child_of` references. Other references, like `follows_from` are not supported yet.
60
+
61
+
62
+ ### Baggage [baggage]
63
+
64
+ The `Span.set_baggage` method is not supported. Baggage items are dropped with a warning log message.
65
+
66
+
67
+ ### Logs [opentracing-logs]
68
+
69
+ Logs are currently not supported.
70
+
@@ -0,0 +1,71 @@
1
+ ---
2
+ mapped_pages:
3
+ - https://www.elastic.co/guide/en/apm/agent/ruby/current/tuning-and-overhead.html
4
+ ---
5
+
6
+ # Performance tuning [tuning-and-overhead]
7
+
8
+ Using any APM solution comes with trade-offs, and the Elastic APM Ruby Agent is no different. Instrumenting your code, using timers, recording context data, etc., uses resources—for example:
9
+
10
+ * CPU time
11
+ * Memory
12
+ * Bandwidth
13
+ * Elasticsearch storage
14
+
15
+ We invest a lot of effort to ensure that the Ruby Agent is suitable for production code and that its overhead remains as low as possible. However, because every application is different, there are some knobs you can turn and tweak to adapt the Agent to your specific needs.
16
+
17
+
18
+ ## Transaction sample rate [tuning-sample-rate]
19
+
20
+ By default, the Agent samples every transaction. The easiest way to reduce both the overhead of the agent and storage requirements, is to tell it to do less, i.e., sample fewer transactions. To do this, set the [`transaction_sample_rate`](/reference/configuration.md#config-transaction-sample-rate) to a value between `0.0` and `1.0`—the percentage of transactions you’d like to randomly sample. The Agent will still record the overall time and result of unsampled transactions, but not context information, tags, or spans.
21
+
22
+
23
+ ## Collecting frame context [tuning-frame-context]
24
+
25
+ The Agent automatically captures several lines of source code around each frame location in the stack trace. This enables the APM app to provide greater insight into exactly where an error or span is occurring in your code. This insight does come at a cost—in terms of performance, stack trace collection is the most expensive thing the Agent does.
26
+
27
+ There are settings you can modify to control this behavior:
28
+
29
+ 1. Disable stack trace frame collection for short-duration spans by setting [`span_frames_min_duration`](/reference/configuration.md#config-span-frames-min-duration-ms) to `0`.
30
+ 2. Modify the number of source code lines collected. These settings are divided between app frames, which represent your application code, and library frames, which represent the code of your dependencies. Each of these categories are further split into separate error and span settings.
31
+
32
+ * [`source_lines_error_app_frames`](/reference/configuration.md#config-source-lines-error-app-frames)
33
+ * [`source_lines_error_library_frames`](/reference/configuration.md#config-source-lines-error-library-frames)
34
+ * [`source_lines_span_app_frames`](/reference/configuration.md#config-source-lines-span-app-frames)
35
+ * [`source_lines_span_library_frames`](/reference/configuration.md#config-source-lines-span-library-frames)
36
+
37
+ 3. If you’re using the API to create a custom span, you can disable stack trace collection with the [`include_stacktrace` argument](/reference/api-reference.md#api-agent-start_span).
38
+
39
+ Reading source files inside a running application can cause a lot of disk I/O, and sending up source lines for each frame will have a network and storage cost that is quite high. Turning these limits down will prevent storing excessive amounts of data in Elasticsearch.
40
+
41
+
42
+ ## Transaction queue [tuning-queue]
43
+
44
+ The Agent does not send every transaction as it happens. Instead, to reduce load on the APM Server, the Agent uses a queue. The queue is flushed periodically, or when it reaches a maximum size.
45
+
46
+ While this reduces the load on the APM Server, holding on to transaction data in a queue uses memory. If you notice a large increase in memory use, try adjusting these settings:
47
+
48
+ * [`api_request_time`](/reference/configuration.md#config-api-request-time) to reduce the duration of a single streaming request. This setting is helpful if you have a sustained high number of transactions.
49
+ * [`api_request_size`](/reference/configuration.md#config-api-request-size) to reduce the maximum size of one request. This setting can help if you experience transaction peaks (a large number in a short period of time).
50
+
51
+ Keep in mind that reducing the value of either setting will cause the agent to send more HTTP requests to the APM Server, potentially causing a higher load.
52
+
53
+
54
+ ## Spans per transaction [tuning-max-spans]
55
+
56
+ The number of spans per transaction will influence both how much time the agent spends in each transaction collecting contextual data, and how much storage space is needed in Elasticsearch. In our experience, most *usual* transactions should have well below 100 spans. In some cases, however, the number of spans can explode—for example:
57
+
58
+ * Long-running transactions
59
+ * Unoptimized code, e.g., doing hundreds of SQL queries in a loop
60
+
61
+ To avoid these edge cases which overload both the Agent and the APM Server, the Agent will stop recording spans when a specified limit is reached. This limit is configurable with [`transaction_max_spans`](/reference/configuration.md#config-transaction-max-spans).
62
+
63
+
64
+ ## Capturing headers and request body [tuning-body-headers]
65
+
66
+ You can configure the Agent to capture headers and request bodies with [`capture_headers`](/reference/configuration.md#config-capture-headers) and [`capture_body`](/reference/configuration.md#config-capture-body). By default, headers are captured and request bodies are not.
67
+
68
+ Depending on the nature of your POST requests, capturing request bodies for transactions may introduce noticeable overhead, as well as increased storage use. In most scenarios, we advise against enabling request body capturing for transactions, and only enabling it if necessary for errors.
69
+
70
+ Capturing request/response headers has less overhead on the agent than capturing request bodies, but can have an impact on storage use.
71
+
@@ -0,0 +1,16 @@
1
+ ---
2
+ mapped_pages:
3
+ - https://www.elastic.co/guide/en/apm/agent/ruby/current/set-up.html
4
+ ---
5
+
6
+ # Set up the APM Ruby agent [set-up]
7
+
8
+ To get you off the ground, we’ve prepared guides for setting up the Agent with different frameworks:
9
+
10
+ * [Rails](/reference/getting-started-rails.md)
11
+ * [Rack](/reference/getting-started-rack.md)
12
+
13
+ For custom instrumentation, see the [*API reference*](/reference/api-reference.md).
14
+
15
+
16
+
@@ -0,0 +1,128 @@
1
+ ---
2
+ mapped_pages:
3
+ - https://www.elastic.co/guide/en/apm/agent/ruby/current/supported-technologies.html
4
+ ---
5
+
6
+ # Supported technologies [supported-technologies]
7
+
8
+ The Elastic APM Ruby Agent has built-in support for many frameworks and libraries. Generally, we want to support all of the most popular libraries. If your favorite is missing, feel free to request it in an issue, or better yet, create a pull request.
9
+
10
+
11
+ ## Ruby [supported-technologies-ruby]
12
+
13
+ We follow Ruby’s own maintenance policy and officially support all currently maintained versions per [Ruby Maintenance Branches](https://www.ruby-lang.org/en/downloads/branches/).
14
+
15
+
16
+ ## Web Frameworks and Libraries [supported-technologies-web]
17
+
18
+ We have automatic support for Ruby on Rails and all Rack compatible web frameworks.
19
+
20
+ We test against all supported minor versions of Rails, Sinatra, and Grape.
21
+
22
+
23
+ ### Ruby on Rails [supported-technologies-rails]
24
+
25
+ We currently support all versions of Rails since 4.2. This follows Rails' own [Security policy](https://rubyonrails.org/security/).
26
+
27
+ See [Getting started with Rails](/reference/getting-started-rails.md).
28
+
29
+
30
+ ### Sinatra [supported-technologies-sinatra]
31
+
32
+ We currently support all versions of Sinatra since 1.0.
33
+
34
+ See [Getting started with Rack](/reference/getting-started-rack.md).
35
+
36
+
37
+ ### Grape [supported-technologies-grape]
38
+
39
+ We currently support all versions of Grape since 1.2.
40
+
41
+ See [Grape example](/reference/getting-started-rack.md#getting-started-grape).
42
+
43
+
44
+ ## Databases [supported-technologies-databases]
45
+
46
+ We automatically instrument database actions using:
47
+
48
+ * ActiveRecord (v4.2+)
49
+ * DynamoDB (v1.0+)
50
+ * Elasticsearch (v0.9+)
51
+ * Mongo (v2.1+)
52
+ * Redis (v3.1+)
53
+ * Sequel (v4.35+)
54
+
55
+
56
+ ## External HTTP requests [supported-technologies-http]
57
+
58
+ We automatically instrument and add support for distributed tracing to external requests using these libraries:
59
+
60
+ * `net/http`
61
+ * Http.rb (v0.6+)
62
+ * Faraday (v0.2.1+)
63
+
64
+ **Note:** These libraries usually assume `localhost` if no `Host` is specified, so the agent does as well.
65
+
66
+
67
+ ## Background Processing [supported-technologies-backgroud-processing]
68
+
69
+ We automatically instrument background processing using:
70
+
71
+ * DelayedJob
72
+ * Sidekiq
73
+ * Shoryuken
74
+ * Sneakers (v2.12.0+) (Experimental, see [#676](https://github.com/elastic/apm-agent-ruby/pull/676))
75
+ * Resque (v2.0.0+)
76
+ * SuckerPunch (v2.0.0+)
77
+
78
+
79
+ ## Resque [supported-technologies-resque]
80
+
81
+ To make the agent work with Resque, you need to require `elastic_apm/resque` before you boot your Resque worker process.
82
+
83
+ For example in your `Rakefile`:
84
+
85
+ ```ruby
86
+ require 'resque'
87
+ require 'elastic_apm'
88
+ require 'elastic_apm/resque'
89
+ ```
90
+
91
+ When you start Resque, you should see a series of messages like the following in the Resque logs:
92
+
93
+ ```ruby
94
+ I, [XXX #81227] INFO -- : Starting worker main
95
+ D, [XXX #81227] DEBUG -- : Registered signals
96
+ I, [XXX #81227] INFO -- : Running before_first_fork hooks
97
+ D, [XXX #81227] DEBUG -- : Starting ElasticAPM agent
98
+ ```
99
+
100
+ Also be sure to set the Resque environment variable `RUN_AT_EXIT_HOOKS` to `true`. Otherwise, the fork may be terminated before the agent has a chance to send all the fork’s events to the APM server.
101
+
102
+
103
+ ## SuckerPunch [supported-technologies-sucker-punch]
104
+
105
+ Asynchronously executed jobs in SuckerPunch are automatically instrumented.
106
+
107
+ Note that errors raised in the user-defined `JobClass#perform` method will be first handled by the SuckerPunch exception handler before being handled by the agent. The handler is accessed/set via `SuckerPunch.exception_handler` in version 2.0. The agent transaction will be marked as successful unless you re-raise the error in the exception handler. You can also explicitly report the error via [`ElasticAPM.report`](/reference/api-reference.md#api-agent-report) in a custom SuckerPunch exception handler.
108
+
109
+
110
+ ## gRPC [supported-technologies-grpc]
111
+
112
+ We automatically instrument gRPC using the `grpc` gem. Note that this is experimental, as the `grpc` gem’s support for `Interceptors` is experimental as of version 1.27.0.
113
+
114
+ To instrument a client, add the `ElasticAPM::GRPC::ClientInterceptor` as an `interceptor` at Stub creation.
115
+
116
+ ```ruby
117
+ Helloworld::Greeter::Stub.new(
118
+ 'localhost:50051',
119
+ interceptors: [ElasticAPM::GRPC::ClientInterceptor.new]
120
+ )
121
+ ```
122
+
123
+ To instrument a server, add the `ElasticAPM::GRPC::ServerInterceptor`.
124
+
125
+ ```ruby
126
+ GRPC::RpcServer.new(interceptors: [ElasticAPM::GRPC::ServerInterceptor.new])
127
+ ```
128
+
@@ -0,0 +1,22 @@
1
+ project: 'APM Ruby agent reference'
2
+ toc:
3
+ - file: index.md
4
+ - file: set-up-apm-ruby-agent.md
5
+ children:
6
+ - file: getting-started-rails.md
7
+ - file: getting-started-rack.md
8
+ - file: supported-technologies.md
9
+ - file: configuration.md
10
+ - file: advanced-topics.md
11
+ children:
12
+ - file: context.md
13
+ - file: custom-instrumentation.md
14
+ - file: api-reference.md
15
+ - file: metrics.md
16
+ - file: logs.md
17
+ - file: opentracing-api.md
18
+ - file: graphql.md
19
+ # TO DO: Not available on master
20
+ # - file: log-correlation.md
21
+ - file: performance-tuning.md
22
+ - file: upgrading.md
@@ -0,0 +1,19 @@
1
+ ---
2
+ mapped_pages:
3
+ - https://www.elastic.co/guide/en/apm/agent/ruby/current/upgrading.html
4
+ ---
5
+
6
+ # Upgrading [upgrading]
7
+
8
+ Upgrades between minor versions of the agent, like from 2.1 to 2.2 are always backwards compatible. Upgrades that involve a major version bump often come with some backwards incompatible changes.
9
+
10
+ Before upgrading the agent, be sure to review the:
11
+
12
+ * [Agent release notes](/release-notes/index.md)
13
+ * [Agent and Server compatibility chart](docs-content://solutions/observability/apps/apm-agent-compatibility.md)
14
+
15
+
16
+ ## End of life dates [end-of-life-dates]
17
+
18
+ We love all our products, but sometimes we must say goodbye to a release so that we can continue moving forward on future development and innovation. Our [End of life policy](https://www.elastic.co/support/eol) defines how long a given release is considered supported, as well as how long a release is considered still in active development or maintenance.
19
+
@@ -0,0 +1,166 @@
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
+ ---
7
+
8
+ # Elastic APM Ruby Agent release notes [elastic-apm-ruby-agent-release-notes]
9
+
10
+ Review the changes, fixes, and more in each version of Elastic APM Ruby Agent.
11
+
12
+ To check for security updates, go to [Security announcements for the Elastic stack](https://discuss.elastic.co/c/announcements/security-announcements/31).
13
+
14
+ All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.md).
15
+
16
+ % Release notes includes only features, enhancements, and fixes. Add breaking changes, deprecations, and known issues to the applicable release notes sections.
17
+
18
+ % ## version.next [elastic-apm-ruby-agent-versionext-release-notes]
19
+ % **Release date:** Month day, year
20
+
21
+ % ### Features and enhancements [elastic-apm-ruby-agent-versionext-features-enhancements]
22
+
23
+ % ### Fixes [elastic-apm-ruby-agent-versionext-fixes]
24
+
25
+ ## 4.8.0 [elastic-apm-ruby-agent-480-release-notes]
26
+
27
+ ### Features and enhancements [elastic-apm-ruby-agent-480-features-enhancements]
28
+ * Support ruby 3.4 [#1510](https://github.com/elastic/apm-agent-ruby/pull/1510)
29
+
30
+ ## 4.7.3 [elastic-apm-ruby-agent-473-release-notes]
31
+
32
+ ### Fixes [elastic-apm-ruby-agent-473-fixes]
33
+ * 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)
34
+
35
+ ## 4.7.2 [elastic-apm-ruby-agent-472-release-notes]
36
+
37
+ ### Fixes [elastic-apm-ruby-agent-472-fixes]
38
+ * Address machineType not being returned in GCP metadata [#1435](https://github.com/elastic/apm-agent-ruby/pull/1435)
39
+
40
+ ## 4.7.1 [elastic-apm-ruby-agent-471-release-notes]
41
+
42
+ ### Fixes [elastic-apm-ruby-agent-471-fixes]
43
+ * Skip capturing cookie header when it’s set separately [#1405](https://github.com/elastic/apm-agent-ruby/pull/1405)
44
+ * Changes/fixes to metadata.cloud.* fields collected for GCP [#1415](https://github.com/elastic/apm-agent-ruby/pull/1415)
45
+ * Pin version of bigdecimal for ruby 2.4 [#1417](https://github.com/elastic/apm-agent-ruby/pull/1417)
46
+ * Use response method on Faraday error for older versions of the library [#1419](https://github.com/elastic/apm-agent-ruby/pull/1419)
47
+ * Fix ActionDispatchSpy#render_exception for Rails 7.1 [#1423](https://github.com/elastic/apm-agent-ruby/pull/1423)
48
+ * Use graphql < 2.1 when Ruby < 2.7 [#1425](https://github.com/elastic/apm-agent-ruby/pull/1425)
49
+ * Guard against various Faraday exception response formats [#1428](https://github.com/elastic/apm-agent-ruby/pull/1428)
50
+
51
+ ## 4.7.0 [elastic-apm-ruby-agent-470-release-notes]
52
+
53
+ ### Features and enhancements [elastic-apm-ruby-agent-470-features-enhancements]
54
+ * Add keyword args for span_method helper [#1395](https://github.com/elastic/apm-agent-ruby/pull/1395)
55
+
56
+ ### Fixes [elastic-apm-ruby-agent-470-fixes]
57
+ * Handle Faraday response being nil [#1382](https://github.com/elastic/apm-agent-ruby/pull/1382)
58
+ * Fix error with invalid %-encoding [#1400](https://github.com/elastic/apm-agent-ruby/pull/1400)
59
+
60
+ ## 4.6.2 [elastic-apm-ruby-agent-462-release-notes]
61
+
62
+ ### Fixes [elastic-apm-ruby-agent-462-fixes]
63
+ * Fix Faraday::RackBuilder::StackLocked [#1371](https://github.com/elastic/apm-agent-ruby/pull/1371)
64
+
65
+ ## 4.6.1 [elastic-apm-ruby-agent-461-release-notes]
66
+
67
+ ### Fixes [elastic-apm-ruby-agent-461-fixes]
68
+ * 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)
69
+ * Fix setting span http status code when Faraday Middleware is used [#1368](https://github.com/elastic/apm-agent-ruby/pull/1368)
70
+ * Handle whitespace when splitting tracestate entries [#1353](https://github.com/elastic/apm-agent-ruby/pull/1353)
71
+
72
+ ## 4.6.0 [elastic-apm-ruby-agent-460-release-notes]
73
+
74
+ ### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
75
+ * Added transaction_name to reported error to allow grouping by transaction name [#1267](https://github.com/elastic/apm-agent-ruby/pull/1267)
76
+ * Added ability to query server for version (useful in the future) [#1278](https://github.com/elastic/apm-agent-ruby/pull/1278)
77
+ * 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)
78
+ * Expanded filtering to sanitize any key that contains the string *auth* [#1266](https://github.com/elastic/apm-agent-ruby/pull/1266)
79
+ * Rename `log_ecs_formatting` option to `log_ecs_reformatting`, deprecate old option name [#1248](https://github.com/elastic/apm-agent-ruby/pull/1248)
80
+ * 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)
81
+ * Only send tracestate header for distributed tracing when it has content [#1277](https://github.com/elastic/apm-agent-ruby/pull/1277)
82
+ * 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)
83
+
84
+ ### Fixes [elastic-apm-ruby-agent-460-fixes]
85
+ * Small change to Sidekiq tests to handle new configuration passing method [#1283](https://github.com/elastic/apm-agent-ruby/pull/1283)
86
+ * Set transaction sample rate to 0 when it’s unsampled [#1339](https://github.com/elastic/apm-agent-ruby/pull/1339)
87
+ * Don’t send unsampled transactions to APM server >= 8.0 [#1341](https://github.com/elastic/apm-agent-ruby/pull/1341)
88
+
89
+ ## 4.5.1 [elastic-apm-ruby-agent-451-release-notes]
90
+
91
+ ### Features and enhancements [elastic-apm-ruby-agent-461-features-enhancements]
92
+ * Update elasticsearch spy to use new transport gem name [#1257](https://github.com/elastic/apm-agent-ruby/pull/1257)
93
+ * 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)
94
+
95
+ ### Fixes [elastic-apm-ruby-agent-451-fixes]
96
+ * Fixed dependencies to allow CI to build successfully [#1259](https://github.com/elastic/apm-agent-ruby/pull/1259)
97
+ * Fixed warnings related to TimeTask timeouts [#1255](https://github.com/elastic/apm-agent-ruby/pull/1255)
98
+
99
+ ## 4.5.0 [elastic-apm-ruby-agent-450-release-notes]
100
+
101
+ ### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
102
+ * Stop collecting the field `http.request.socket.encrypted` [#1181](https://github.com/elastic/apm-agent-ruby/pull/1181)
103
+
104
+ ### Fixes [elastic-apm-ruby-agent-450-fixes]
105
+ * Fixed MongoDB spy thread safety [#1202](https://github.com/elastic/apm-agent-ruby/pull/1202)
106
+ * Fixed span context fields for DynamoDB instrumentation [#1178](https://github.com/elastic/apm-agent-ruby/pull/1178)
107
+ * Fixed span context fields for S3 instrumentation [#1179](https://github.com/elastic/apm-agent-ruby/pull/1179)
108
+ * Update user agent info to match spec [#1182](https://github.com/elastic/apm-agent-ruby/pull/1182)
109
+
110
+ ## 4.4.0 [elastic-apm-ruby-agent-440-release-notes]
111
+
112
+ ### Features and enhancements [elastic-apm-ruby-agent-460-features-enhancements]
113
+ * Optional span to be ended instead of current span [#1039](https://github.com/elastic/apm-agent-ruby/pull/1039)
114
+ * Config option `log_ecs_formatting` [#1053](https://github.com/elastic/apm-agent-ruby/pull/1053)
115
+
116
+ ### Fixes [elastic-apm-ruby-agent-440-fixes]
117
+ * Fixed detecting Linux on Alpine for CPU/MEM metrics [#1057](https://github.com/elastic/apm-agent-ruby/pull/1057)
118
+
119
+ ## 4.3.0 [elastic-apm-ruby-agent-430-release-notes]
120
+
121
+ ### Features and enhancements [elastic-apm-ruby-agent-430-features-enhancements]
122
+ * Add JVM memory metrics [#1040](https://github.com/elastic/apm-agent-ruby/pull/1040)
123
+
124
+ ## 4.2.0 [elastic-apm-ruby-agent-420-release-notes]
125
+
126
+ ### Features and enhancements [elastic-apm-ruby-agent-420-features-enhancements]
127
+ * Add support for AWS Storage Table/CosmosDB [#999](https://github.com/elastic/apm-agent-ruby/pull/999)
128
+
129
+ ### Fixes [elastic-apm-ruby-agent-420-fixes]
130
+ * Align HTTP span types/subtypes with spec [#1014](https://github.com/elastic/apm-agent-ruby/pull/1014)
131
+ * Passing a full URL as a path to `Net::HTTP` [#1029](https://github.com/elastic/apm-agent-ruby/pull/1029)
132
+ * Fix growing number of open file descriptors [#1033](https://github.com/elastic/apm-agent-ruby/pull/1033)
133
+
134
+ ## 4.1.0 [elastic-apm-ruby-agent-410-release-notes]
135
+
136
+ ### Features and enhancements [elastic-apm-ruby-agent-410-features-enhancements]
137
+ * Azure App Services instance metadata [#1007](https://github.com/elastic/apm-agent-ruby/pull/1007)
138
+ * `hostname` is now reported split by `configured_hostname` and `detected_hostname` [#1009](https://github.com/elastic/apm-agent-ruby/pull/1009)
139
+
140
+ ### Fixes [elastic-apm-ruby-agent-410-fixes]
141
+ * `service_node_name` is now correctly reported as `service.node.configured_name` [#1009](https://github.com/elastic/apm-agent-ruby/pull/1009)
142
+ * Fix JSON parsing when using yajl-ruby [#1012](https://github.com/elastic/apm-agent-ruby/pull/1012)
143
+ * Fix SpanHelpers when methods take blocks [#1013](https://github.com/elastic/apm-agent-ruby/pull/1013)
144
+ * Fix missing `environment` param when fetching from Central Config [#1014](https://github.com/elastic/apm-agent-ruby/pull/1014)
145
+
146
+ ## 4.0.0 [elastic-apm-ruby-agent-400-release-notes]
147
+
148
+ ### Features and enhancements [elastic-apm-ruby-agent-400-features-enhancements]
149
+ * 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.
150
+ * Removed support for Ruby 2.3 and JRuby 9.1 [#901](https://github.com/elastic/apm-agent-ruby/pull/901)
151
+ * Removed config option `active`, see `enabled` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
152
+ * Removed config option `custom_key_filters`, see `sanitize_field_names` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
153
+ * Removed config option `default_tags`, see `global_labels` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
154
+ * Removed config option `default_labels`, see `global_labels` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
155
+ * Removed config option `ignore_url_patterns`, see `transaction_ignore_urls` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
156
+ * Removed config option `use_legacy_sql_parser`, legacy parser no longer included [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
157
+ * Integrations (Spies) use Module#prepend over class_eval [#890](https://github.com/elastic/apm-agent-ruby/pull/890)
158
+ * The secrets filter no longer filters based on values, see `sanitize_field_names` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
159
+ * The secrets filter is aligned with other agents, see `sanitize_field_names` [#900](https://github.com/elastic/apm-agent-ruby/pull/900)
160
+ * Added `set_service` API [#1006](https://github.com/elastic/apm-agent-ruby/pull/1006)
161
+
162
+ ### Fixes [elastic-apm-ruby-agent-400-fixes]
163
+ * AWS S3 spy accepts symbol bucket names [#998](https://github.com/elastic/apm-agent-ruby/pull/998)
164
+ * AWS S3 spy passing on blocks [#998](https://github.com/elastic/apm-agent-ruby/pull/998)
165
+ * SQL scanner now recognizes CQL style comments [#1004](https://github.com/elastic/apm-agent-ruby/pull/1004)
166
+
@@ -0,0 +1,24 @@
1
+ ---
2
+ navigation_title: "Known issues"
3
+
4
+ ---
5
+
6
+ # Elastic APM Ruby Agent known issues [elastic-apm-ruby-agent-known-issues]
7
+
8
+ 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.
9
+
10
+ % Use the following template to add entries to this page.
11
+
12
+ % :::{dropdown} Title of known issue
13
+ % **Details**
14
+ % On [Month/Day/Year], a known issue was discovered that [description of known issue].
15
+
16
+ % **Workaround**
17
+ % Workaround description.
18
+
19
+ % **Resolved**
20
+ % On [Month/Day/Year], this issue was resolved.
21
+
22
+ :::
23
+
24
+ _No known issues_
@@ -0,0 +1,3 @@
1
+ toc:
2
+ - file: index.md
3
+ - file: known-issues.md
@@ -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
- body = req.body.read
83
- req.body.rewind
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
@@ -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 = nil
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
@@ -18,5 +18,5 @@
18
18
  # frozen_string_literal: true
19
19
 
20
20
  module ElasticAPM
21
- VERSION = '4.7.3'
21
+ VERSION = '4.8.0'
22
22
  end
@@ -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