elastic-apm 4.7.0 → 4.7.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cd4366b1660aa74bcabd2f70126ab00d849d6bf326c884ab47d9877564430db
4
- data.tar.gz: a9c5faf9bc50e3922ac2eb816e85b71c32a946c263c284b5c69675330b262047
3
+ metadata.gz: 2a42c0ce245df1d22209302a5047957fdc35532ef06e0834078200305377df50
4
+ data.tar.gz: 43cbfaca9d8b8d382bb95c42559a7a497e28926bf7067558741b57aa036842e0
5
5
  SHA512:
6
- metadata.gz: 2fb7959b551db2b43453beeef14cf59adf3c9a18fecfe9b54129dbb449d6c7e320bfbf15df0b3e25fbebb8a3d96c59e91df841027c2cb1cefe55d288889738f8
7
- data.tar.gz: ce91a520a1358d9610b816d1f6a1bf20bb6b270a66c6c6ff0a410af975f1535424b9686f3a958c1e22d1c630a465d7161cabe5fb48ffb17df7e3fe38bb97550e
6
+ metadata.gz: fe8f8a3f6228788632530c5ee4ecfcf8ade01e199aa5cc06bc40e1af68a54f75266d5fcae91aa4d2357bb57fbd54c62f357b24a6e89b841ac449ae75199b1603
7
+ data.tar.gz: 2d3f2ece8d92db1a43475384e284fc82678ca5bf8352ce3b5d384e682dfbf55c6324886de1a94f95641861ce808cadaa1f057e7956c2b46fe4ab39db213fa0c1
@@ -23,7 +23,15 @@ sources:
23
23
  transformers:
24
24
  - findsubmatch:
25
25
  pattern: "[0-9a-f]{40}"
26
-
26
+ pull_request:
27
+ kind: shell
28
+ dependson:
29
+ - sha
30
+ spec:
31
+ command: gh api /repos/elastic/apm/commits/{{ source "sha" }}/pulls --jq '.[].html_url'
32
+ environments:
33
+ - name: GITHUB_TOKEN
34
+ - name: PATH
27
35
  api_key.feature:
28
36
  kind: file
29
37
  spec:
@@ -65,6 +73,7 @@ actions:
65
73
  ### Why
66
74
  *Changeset*
67
75
  * https://github.com/elastic/apm/commit/{{ source "sha" }}
76
+ * {{ source "pull_request" }}
68
77
 
69
78
  targets:
70
79
  api_key.feature:
@@ -23,7 +23,15 @@ sources:
23
23
  transformers:
24
24
  - findsubmatch:
25
25
  pattern: "[0-9a-f]{40}"
26
-
26
+ pull_request:
27
+ kind: shell
28
+ dependson:
29
+ - sha
30
+ spec:
31
+ command: gh api /repos/elastic/apm/commits/{{ source "sha" }}/pulls --jq '.[].html_url'
32
+ environments:
33
+ - name: GITHUB_TOKEN
34
+ - name: PATH
27
35
  container_metadata_discovery.json:
28
36
  kind: file
29
37
  spec:
@@ -68,6 +76,7 @@ actions:
68
76
  ### Why
69
77
  *Changeset*
70
78
  * https://github.com/elastic/apm/commit/{{ source "sha" }}
79
+ * {{ source "pull_request" }}
71
80
 
72
81
  targets:
73
82
  container_metadata_discovery.json:
@@ -23,6 +23,15 @@ sources:
23
23
  transformers:
24
24
  - findsubmatch:
25
25
  pattern: "[0-9a-f]{40}"
26
+ pull_request:
27
+ kind: shell
28
+ dependson:
29
+ - sha
30
+ spec:
31
+ command: gh api /repos/elastic/apm-data/commits/{{ source "sha" }}/pulls --jq '.[].html_url'
32
+ environments:
33
+ - name: GITHUB_TOKEN
34
+ - name: PATH
26
35
  error.json:
27
36
  kind: file
28
37
  spec:
@@ -64,6 +73,7 @@ actions:
64
73
  ### Why
65
74
  *Changeset*
66
75
  * https://github.com/elastic/apm-data/commit/{{ source "sha" }}
76
+ * {{ source "pull_request" }}
67
77
 
68
78
  targets:
69
79
  error.json:
@@ -3,7 +3,9 @@ updates:
3
3
  - package-ecosystem: bundler
4
4
  directory: "/"
5
5
  schedule:
6
- interval: daily
6
+ interval: "weekly"
7
+ day: "sunday"
8
+ time: "22:00"
7
9
  open-pull-requests-limit: 10
8
10
  ignore:
9
11
  - dependency-name: sucker_punch
@@ -14,3 +16,17 @@ updates:
14
16
  - 1.8.10
15
17
  - 1.8.8
16
18
  - 1.8.9
19
+
20
+ # GitHub actions
21
+ - package-ecosystem: "github-actions"
22
+ directory: "/"
23
+ reviewers:
24
+ - "elastic/observablt-ci"
25
+ schedule:
26
+ interval: "weekly"
27
+ day: "sunday"
28
+ time: "22:00"
29
+ groups:
30
+ github-actions:
31
+ patterns:
32
+ - "*"
@@ -0,0 +1,58 @@
1
+ ## CI/CD
2
+
3
+ There are 5 main stages that run on GitHub actions:
4
+
5
+ * Linting
6
+ * Test
7
+ * Test `main` versions
8
+ * Package
9
+ * Release
10
+
11
+ There are some other stages that run for every push on the main branches:
12
+
13
+ * [Microbenchmark](./microbenchmark.yml)
14
+ * [Snapshoty](./snapshoty.yml)
15
+
16
+ ### Scenarios
17
+
18
+ * Compatibility matrix runs on branches, tags and PRs basis.
19
+ * Tests should be triggered on branch, tag and PR basis.
20
+ * Commits that are only affecting the docs files should not trigger any test or similar stages that are not required.
21
+ * Automated release in the CI gets triggered when a tag release is created.
22
+ * **This is not the case yet**, but if Github secrets are required then Pull Requests from forked repositories won't run any build accessing those secrets. If needed, then create a feature branch.
23
+
24
+ ### Compatibility matrix
25
+
26
+ Ruby agent supports compatibility to different ruby versions and frameworks, those are defined in:
27
+
28
+ * [frameworks](../../.ci/.framework.yml) for all the PRs.
29
+ * [frameworks](../../.ci/.main_framework.yml) for all the PRs using the `main` branches.
30
+ * Ruby [versions](../../.ci/.ruby.yml) for all the `*nix` builds.
31
+ * [Exclude list](../../.ci/.exclude.yml) for the above entries.
32
+
33
+ ### How to interact with the CI?
34
+
35
+ #### On a PR basis
36
+
37
+ Once a PR has been opened then there are two different ways you can trigger builds in the CI:
38
+
39
+ 1. Commit based
40
+ 1. UI based, any Elasticians can force a build through the GitHub UI
41
+
42
+ #### Branches
43
+
44
+ Every time there is a merge to main or any release branches the whole workflow will compile and test every entry in the compatibility matrix for Linux.
45
+
46
+ ### Release process
47
+
48
+ This process has been fully automated and it gets triggered when a tag release has been created.
49
+ The tag release follows the naming convention: `v.<major>.<minor>.<patch>`, where `<major>`, `<minor>` and `<patch>`.
50
+
51
+ ### OpenTelemetry
52
+
53
+ There is a GitHub workflow in charge to populate what the workflow run in terms of jobs and steps. Those details can be seen in [here](https://ela.st/oblt-ci-cd-stats) (**NOTE**: only available for Elasticians).
54
+
55
+ ## Bump automation
56
+
57
+ [updatecli](https://www.updatecli.io/) is the tool we use to automatically update the specs
58
+ the [APM agents](./updatecli.yml) use.
data/CHANGELOG.asciidoc CHANGED
@@ -34,6 +34,19 @@ endif::[]
34
34
  [[release-notes-4.x]]
35
35
  === Ruby Agent version 4.x
36
36
 
37
+ [[release-notes-4.7.1]
38
+ ==== 4.7.1
39
+
40
+ [float]
41
+ ===== Fixed
42
+ - Skip capturing cookie header when it's set separately {pull}1405[#1405]
43
+ - Changes/fixes to metadata.cloud.* fields collected for GCP {pull}1415[#1415]
44
+ - Pin version of bigdecimal for ruby 2.4 {pull}1417[#1417]
45
+ - Use response method on Faraday error for older versions of the library {pull}1419[#1419]
46
+ - Fix ActionDispatchSpy#render_exception for Rails 7.1 {pull}1423[#1423]
47
+ - Use graphql < 2.1 when Ruby < 2.7 {pull}1425[#1425]
48
+ - Guard against various Faraday exception response formats {pull}1428[#1428]
49
+
37
50
  [[release-notes-4.7.0]]
38
51
  ==== 4.7.0
39
52
 
data/Gemfile CHANGED
@@ -41,9 +41,14 @@ gem 'ecs-logging', require: 'ecs_logging/logger'
41
41
  gem 'elasticsearch', require: nil
42
42
  gem 'fakeredis', require: nil
43
43
  gem 'faraday', require: nil
44
- gem 'graphql', require: nil
45
- if !defined?(JRUBY_VERSION) && RUBY_VERSION < '2.5'
46
- gem 'google-protobuf', '< 3.12'
44
+ if RUBY_VERSION < '2.7'
45
+ gem 'graphql', '< 2.1', require: nil
46
+ else
47
+ gem 'graphql', require: nil
48
+ end
49
+ if !defined?(JRUBY_VERSION)
50
+ gem 'google-protobuf', '< 3.12' if RUBY_VERSION < '2.5'
51
+ gem 'google-protobuf', '< 3.23' if RUBY_VERSION < '2.7' && RUBY_VERSION > '2.5'
47
52
  end
48
53
  gem 'grpc' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '3.0'
49
54
  gem 'json'
@@ -131,6 +136,10 @@ if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.5.0') && !defined
131
136
  gem 'sneakers', github: 'jondot/sneakers', ref: 'd761dfe1493', require: nil
132
137
  end
133
138
 
139
+ if Gem::Version.create(RUBY_VERSION) <= Gem::Version.create('2.5.0')
140
+ gem 'bigdecimal', '1.3.5'
141
+ end
142
+
134
143
  group :bench do
135
144
  gem 'ruby-prof', require: nil, platforms: %i[ruby]
136
145
  gem 'stackprof', require: nil, platforms: %i[ruby]
@@ -55,6 +55,9 @@ module ElasticAPM
55
55
  request.env = env if config.capture_env?
56
56
 
57
57
  request.cookies = req.cookies.dup
58
+ unless request.cookies.empty?
59
+ request.headers['Cookie'] = SKIPPED if request.headers.has_key?('Cookie')
60
+ end
58
61
 
59
62
  context
60
63
  end
@@ -97,13 +97,12 @@ module ElasticAPM
97
97
  zone = metadata["instance"]["zone"]&.split("/")&.at(-1)
98
98
 
99
99
  self.provider = "gcp"
100
- self.instance_id = metadata["instance"]["id"]
100
+ self.instance_id = metadata["instance"]["id"].to_s
101
101
  self.instance_name = metadata["instance"]["name"]
102
- self.project_id = metadata["project"]["numericProjectId"]
103
- self.project_name = metadata["project"]["projectId"]
102
+ self.project_id = metadata["project"]["projectId"]
104
103
  self.availability_zone = zone
105
104
  self.region = zone.split("-")[0..-2].join("-")
106
- self.machine_type = metadata["instance"]["machineType"]
105
+ self.machine_type = metadata["instance"]["machineType"].split("/")[-1]
107
106
  rescue HTTP::TimeoutError, HTTP::ConnectionError
108
107
  nil
109
108
  end
@@ -24,11 +24,19 @@ module ElasticAPM
24
24
  class ActionDispatchSpy
25
25
  # @api private
26
26
  module Ext
27
- def render_exception(env, exception)
28
- context = ElasticAPM.build_context(rack_env: env, for_type: :error)
27
+ def render_exception(request, exception_or_wrapper)
28
+ context = ElasticAPM.build_context(
29
+ rack_env: request, for_type: :error
30
+ )
31
+ exception =
32
+ if exception_or_wrapper.is_a?(ActionDispatch::ExceptionWrapper)
33
+ exception_or_wrapper.exception
34
+ else
35
+ exception_or_wrapper
36
+ end
29
37
  ElasticAPM.report(exception, context: context, handled: false)
30
38
 
31
- super(env, exception)
39
+ super(request, exception_or_wrapper)
32
40
  end
33
41
  end
34
42
 
@@ -109,7 +109,14 @@ module ElasticAPM
109
109
  yield req if block
110
110
  end
111
111
  rescue Faraday::ClientError, Faraday::ServerError => e # Faraday::Response::RaiseError
112
- status = e.response_status
112
+ status =
113
+ if e.respond_to?(:response_status)
114
+ e.response_status
115
+ elsif e.response && e.response.respond_to?(:status)
116
+ e.response.status
117
+ elsif e.response && e.response.respond_to?(:fetch)
118
+ e.response[:status]
119
+ end
113
120
  http = span&.context&.http
114
121
  if http && status
115
122
  http.status_code = status.to_s
@@ -18,5 +18,5 @@
18
18
  # frozen_string_literal: true
19
19
 
20
20
  module ElasticAPM
21
- VERSION = '4.7.0'
21
+ VERSION = '4.7.1'
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.0
4
+ version: 4.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-17 00:00:00.000000000 Z
12
+ date: 2024-01-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: concurrent-ruby
@@ -84,6 +84,7 @@ files:
84
84
  - ".github/PULL_REQUEST_TEMPLATE.md"
85
85
  - ".github/dependabot.yml"
86
86
  - ".github/labeler-config.yml"
87
+ - ".github/workflows/README.md"
87
88
  - ".github/workflows/addToProject.yml"
88
89
  - ".github/workflows/ci-docs.yml"
89
90
  - ".github/workflows/ci.yml"