elastic-apm 4.5.0 → 4.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.jenkins_exclude.yml +86 -29
  3. data/.ci/.jenkins_framework.yml +4 -3
  4. data/.ci/{.jenkins_master_framework.yml → .jenkins_main_framework.yml} +0 -0
  5. data/.ci/.jenkins_ruby.yml +1 -1
  6. data/.ci/.jenkins_ruby_benchmarks.yml +6 -0
  7. data/.ci/Jenkinsfile +16 -37
  8. data/.ci/jobs/apm-agent-ruby-mbp.yml +1 -1
  9. data/.github/PULL_REQUEST_TEMPLATE.md +5 -5
  10. data/.pre-commit-config.yaml +2 -2
  11. data/CHANGELOG.asciidoc +38 -0
  12. data/CONTRIBUTING.md +2 -2
  13. data/Gemfile +11 -2
  14. data/README.md +1 -1
  15. data/Rakefile +2 -2
  16. data/bench/report.rb +1 -1
  17. data/docs/api.asciidoc +2 -2
  18. data/docs/configuration.asciidoc +7 -5
  19. data/docs/introduction.asciidoc +3 -3
  20. data/docs/log-correlation.asciidoc +1 -1
  21. data/docs/upgrading.asciidoc +1 -1
  22. data/elastic-apm.gemspec +3 -2
  23. data/lib/elastic_apm/central_config.rb +5 -0
  24. data/lib/elastic_apm/config/server_info.rb +50 -0
  25. data/lib/elastic_apm/config.rb +25 -4
  26. data/lib/elastic_apm/error.rb +2 -1
  27. data/lib/elastic_apm/error_builder.rb +1 -0
  28. data/lib/elastic_apm/instrumenter.rb +4 -2
  29. data/lib/elastic_apm/metadata/system_info/container_info.rb +4 -3
  30. data/lib/elastic_apm/metadata/system_info.rb +1 -1
  31. data/lib/elastic_apm/metrics.rb +1 -4
  32. data/lib/elastic_apm/span/context/links.rb +32 -0
  33. data/lib/elastic_apm/span/context/service.rb +55 -0
  34. data/lib/elastic_apm/span/context.rb +19 -3
  35. data/lib/elastic_apm/span.rb +3 -0
  36. data/lib/elastic_apm/span_helpers.rb +2 -2
  37. data/lib/elastic_apm/spies/elasticsearch.rb +11 -1
  38. data/lib/elastic_apm/spies/mongo.rb +5 -12
  39. data/lib/elastic_apm/spies/racecar.rb +77 -0
  40. data/lib/elastic_apm/spies/redis.rb +1 -1
  41. data/lib/elastic_apm/spies/sequel.rb +9 -0
  42. data/lib/elastic_apm/spies/sns.rb +1 -1
  43. data/lib/elastic_apm/spies/sqs.rb +1 -0
  44. data/lib/elastic_apm/trace_context/tracestate.rb +1 -1
  45. data/lib/elastic_apm/trace_context.rb +1 -1
  46. data/lib/elastic_apm/transport/base.rb +1 -3
  47. data/lib/elastic_apm/transport/serializers/span_serializer.rb +25 -0
  48. data/lib/elastic_apm/version.rb +1 -1
  49. data/lib/elastic_apm.rb +1 -0
  50. metadata +29 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c396bc981217532f2d6775de89e9a2aa7a1bcd501100588bbd700d0f4f2eb590
4
- data.tar.gz: 94f859585a09fc99f02a4bbd261193e0ed1f74bdb9463968692a16f277b1e4f0
3
+ metadata.gz: edae30dc148307b137e402a81ffed731cbe738ca7924f31c9440a9a6ea9a8eb4
4
+ data.tar.gz: ef860d2d783fd9351b0eea3106e96eafbadef339fa72a4b5979fbc38d4e3d46a
5
5
  SHA512:
6
- metadata.gz: ae66a68c4651f695361b2028bf76132e8bc257fc141d3ad2872786bbab10b8e19bc3609a84478de53e56ad0c15695ad7debbcf62c4af8997833d0cf7cc7f6d23
7
- data.tar.gz: c6b9fd6f80de4139cac0dd040e45d56f869eb2ff8b3db38df376e898490b8c2a5523a9bb3f1ba73a8583356ae5647ec67835b994597dc3db8d72c62ee506794f
6
+ metadata.gz: 8e1543b7f39d5ba73eb30e34777ba07a8ae940ddd1aee2d84afc445642319304bd26036a9eb5b5e6d4d9c11bbc0323c7c17aa2bd18101bbfcfed1cdcf6bdc635
7
+ data.tar.gz: 971963f1d06a398c2af8f988e4386004b7fb176e67d6d8c35b9be8a781b8561fd8236395d89f51ef87e3cad4375f9c91c4105e550dc7f7b1e7b1142e1d0f7c17
@@ -1,27 +1,31 @@
1
1
  exclude:
2
- # Ruby 2.3
3
- # Only includes rails-5.2, sinatra-2.0
4
- - RUBY_VERSION: ruby:2.3
2
+ # Ruby 2.4
3
+ # Only test on rails-5.2, sinatra-1.4
4
+ - RUBY_VERSION: ruby:2.4
5
+ FRAMEWORK: rails-7.0
6
+ - RUBY_VERSION: ruby:2.4
5
7
  FRAMEWORK: rails-6.1
6
- - RUBY_VERSION: ruby:2.3
8
+ - RUBY_VERSION: ruby:2.4
7
9
  FRAMEWORK: rails-6.0
8
- - RUBY_VERSION: ruby:2.3
10
+ - RUBY_VERSION: ruby:2.4
9
11
  FRAMEWORK: rails-4.2
10
- - RUBY_VERSION: ruby:2.3
11
- FRAMEWORK: sinatra-1.4
12
- - RUBY_VERSION: ruby:2.3
13
- FRAMEWORK: grape-1.5
14
- - RUBY_VERSION: ruby:2.3
15
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.0
16
- - RUBY_VERSION: ruby:2.3
12
+ - RUBY_VERSION: ruby:2.4
13
+ FRAMEWORK: sinatra-2.2
14
+ - RUBY_VERSION: ruby:2.4
15
+ FRAMEWORK: grape-1.6
16
+ - RUBY_VERSION: ruby:2.4
17
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.0
18
+ - RUBY_VERSION: ruby:2.4
17
19
  FRAMEWORK: rails-main
18
- - RUBY_VERSION: ruby:2.3
20
+ - RUBY_VERSION: ruby:2.4
19
21
  FRAMEWORK: sinatra-master
20
- - RUBY_VERSION: ruby:2.3
22
+ - RUBY_VERSION: ruby:2.4
21
23
  FRAMEWORK: grape-master
22
24
 
23
25
  # rails-4.2 exclusions
24
- # Only test on ruby 2.6, 2.5, 2.4, 2.3
26
+ # Only test on ruby 2.6, 2.5, 2.4
27
+ - RUBY_VERSION: ruby:3.1
28
+ FRAMEWORK: rails-4.2
25
29
  - RUBY_VERSION: ruby:3.0
26
30
  FRAMEWORK: rails-4.2
27
31
  - RUBY_VERSION: ruby:2.7
@@ -35,6 +39,8 @@ exclude:
35
39
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
36
40
  FRAMEWORK: rails-4.2
37
41
  # sinatra-1.4 exclusions
42
+ - RUBY_VERSION: ruby:3.1
43
+ FRAMEWORK: sinatra-1.4
38
44
  - RUBY_VERSION: ruby:3.0
39
45
  FRAMEWORK: sinatra-1.4
40
46
  - RUBY_VERSION: ruby:2.7
@@ -55,7 +61,11 @@ exclude:
55
61
  - RUBY_VERSION: ruby:2.4
56
62
  FRAMEWORK: rails-6.0
57
63
 
58
- # Only test rails master on ruby 2.7 and ruby 3.0
64
+ # Only test rails master on ruby 3.1
65
+ - RUBY_VERSION: ruby:3.0
66
+ FRAMEWORK: rails-main
67
+ - RUBY_VERSION: ruby:2.7
68
+ FRAMEWORK: rails-main
59
69
  - RUBY_VERSION: ruby:2.6
60
70
  FRAMEWORK: rails-main
61
71
  - RUBY_VERSION: ruby:2.5
@@ -71,7 +81,25 @@ exclude:
71
81
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
72
82
  FRAMEWORK: rails-main
73
83
 
74
- # Only test sinatra master on ruby 2.7 and ruby 3.0
84
+ # Only test rails 7.0 on ruby >= 2.7
85
+ - RUBY_VERSION: ruby:2.6
86
+ FRAMEWORK: rails-7.0
87
+ - RUBY_VERSION: ruby:2.5
88
+ FRAMEWORK: rails-7.0
89
+ - RUBY_VERSION: ruby:2.4
90
+ FRAMEWORK: rails-7.0
91
+ - RUBY_VERSION: jruby:9.2
92
+ FRAMEWORK: rails-7.0
93
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
94
+ FRAMEWORK: rails-7.0
95
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
96
+ FRAMEWORK: rails-7.0
97
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
98
+ FRAMEWORK: rails-7.0
99
+
100
+ # Only test sinatra master on ruby 2.7 and ruby 3.1
101
+ - RUBY_VERSION: ruby:3.0
102
+ FRAMEWORK: sinatra-master
75
103
  - RUBY_VERSION: ruby:2.6
76
104
  FRAMEWORK: sinatra-master
77
105
  - RUBY_VERSION: ruby:2.5
@@ -104,31 +132,60 @@ exclude:
104
132
  FRAMEWORK: grape-master
105
133
 
106
134
  # grape 1.5 doesn't support ruby 3.0
135
+ - RUBY_VERSION: ruby:3.1
136
+ FRAMEWORK: grape-1.6
137
+ - RUBY_VERSION: ruby:3.1
138
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
139
+ - RUBY_VERSION: ruby:3.1
140
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
107
141
  - RUBY_VERSION: ruby:3.0
108
- FRAMEWORK: grape-1.5
142
+ FRAMEWORK: grape-1.6
109
143
  - RUBY_VERSION: ruby:3.0
110
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
144
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
111
145
 
112
- # only test ruby 3.0 with rails 6.0 and rails 6.1
146
+ # only test ruby >= 3.0 with rails 6.0 and rails 6.1
147
+ - RUBY_VERSION: ruby:3.1
148
+ FRAMEWORK: rails-5.2
149
+ - RUBY_VERSION: ruby:3.1
150
+ FRAMEWORK: rails-5.1
113
151
  - RUBY_VERSION: ruby:3.0
114
152
  FRAMEWORK: rails-5.2
115
153
  - RUBY_VERSION: ruby:3.0
116
154
  FRAMEWORK: rails-5.1
117
155
 
118
156
  # Unsupported
157
+ # Ruby 2.6
158
+ - RUBY_VERSION: ruby:2.6
159
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
119
160
  - RUBY_VERSION: ruby:2.6
120
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
161
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
162
+ # Ruby 2.5
121
163
  - RUBY_VERSION: ruby:2.5
122
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
164
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
165
+ - RUBY_VERSION: ruby:2.5
166
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
167
+ # Ruby 2.4
168
+ - RUBY_VERSION: ruby:2.4
169
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
123
170
  - RUBY_VERSION: ruby:2.4
124
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
125
- - RUBY_VERSION: ruby:2.3
126
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
171
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
172
+ # JRuby 9.2
127
173
  - RUBY_VERSION: jruby:9.2
128
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
174
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
175
+ - RUBY_VERSION: jruby:9.2
176
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
177
+ # JRuby 9.2-13-jdk
178
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
179
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
129
180
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
130
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
181
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
182
+ # JRuby 9.2-11-jdk
131
183
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
132
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
184
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
185
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
186
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
187
+ # JRuby 9.2-8-jdk
188
+ - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
189
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
133
190
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
134
- FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
191
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
@@ -1,12 +1,13 @@
1
1
  FRAMEWORK:
2
+ - rails-7.0
2
3
  - rails-6.1
3
4
  - rails-6.0
4
5
  - rails-5.2
5
6
  - rails-4.2
6
7
 
7
- - sinatra-2.0
8
+ - sinatra-2.2
8
9
  - sinatra-1.4
9
10
 
10
- - grape-1.5
11
+ - grape-1.6
11
12
 
12
- - grape-1.5,sinatra-2.0,rails-6.1
13
+ - grape-1.6,sinatra-2.2,rails-6.1
@@ -1,8 +1,8 @@
1
1
  RUBY_VERSION:
2
+ - ruby:3.1
2
3
  - ruby:3.0
3
4
  - ruby:2.7
4
5
  - ruby:2.6
5
- - ruby:2.5
6
6
  - ruby:2.4
7
7
  - jruby:9.2
8
8
  - docker.elastic.co/observability-ci/jruby:9.2-13-jdk
@@ -0,0 +1,6 @@
1
+ RUBY_VERSION:
2
+ - ruby:3.1
3
+ - ruby:3.0
4
+ - ruby:2.7
5
+ - ruby:2.6
6
+ - jruby:9.2
data/.ci/Jenkinsfile CHANGED
@@ -21,8 +21,6 @@ pipeline {
21
21
  CODECOV_SECRET = 'secret/apm-team/ci/apm-agent-ruby-codecov'
22
22
  DOCKER_REGISTRY = 'docker.elastic.co'
23
23
  DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod'
24
- GITHUB_CHECK_ITS_NAME = 'Integration Tests'
25
- ITS_PIPELINE = 'apm-integration-tests-selector-mbp/master'
26
24
  RELEASE_SECRET = 'secret/apm-team/ci/apm-agent-ruby-rubygems-release'
27
25
  OPBEANS_REPO = 'opbeans-ruby'
28
26
  REFERENCE_REPO = '/var/lib/jenkins/.git-references/apm-agent-ruby.git'
@@ -42,7 +40,7 @@ pipeline {
42
40
  issueCommentTrigger("(${obltGitHubComments()}|^run benchmark tests)")
43
41
  }
44
42
  parameters {
45
- booleanParam(name: 'Run_As_Master_Branch', defaultValue: false, description: 'Allow to run any steps on a PR, some steps normally only run on master branch.')
43
+ booleanParam(name: 'Run_As_Main_Branch', defaultValue: false, description: 'Allow to run any steps on a PR, some steps normally only run on main branch.')
46
44
  booleanParam(name: 'bench_ci', defaultValue: true, description: 'Enable run benchmarks.')
47
45
  }
48
46
  stages {
@@ -71,7 +69,7 @@ pipeline {
71
69
  expression { return env.ONLY_DOCS == "false" }
72
70
  anyOf {
73
71
  not { changeRequest() }
74
- expression { return params.Run_As_Master_Branch }
72
+ expression { return params.Run_As_Main_Branch }
75
73
  }
76
74
  }
77
75
  }
@@ -115,33 +113,14 @@ pipeline {
115
113
  }
116
114
  }
117
115
  }
118
- stage('Master Tests frameworks') {
116
+ stage('Main Tests frameworks') {
119
117
  options { skipDefaultCheckout() }
120
118
  steps {
121
- catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: "The tests for the master framework have failed. Let's warn instead.") {
122
- runTests('.ci/.jenkins_master_framework.yml')
119
+ catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: "The tests for the main framework have failed. Let's warn instead.") {
120
+ runTests('.ci/.jenkins_main_framework.yml')
123
121
  }
124
122
  }
125
123
  }
126
- stage('Integration Tests') {
127
- agent none
128
- when {
129
- beforeAgent true
130
- anyOf {
131
- changeRequest()
132
- expression { return !params.Run_As_Master_Branch }
133
- }
134
- }
135
- steps {
136
- githubNotify(context: "${env.GITHUB_CHECK_ITS_NAME}", description: "${env.GITHUB_CHECK_ITS_NAME} ...", status: 'PENDING', targetUrl: "${env.JENKINS_URL}search/?q=${env.ITS_PIPELINE.replaceAll('/','+')}")
137
- build(job: env.ITS_PIPELINE, propagate: false, wait: true,
138
- parameters: [ string(name: 'INTEGRATION_TEST', value: 'Ruby'),
139
- string(name: 'BUILD_OPTS', value: "--ruby-agent-version ${env.GIT_BASE_COMMIT} --ruby-agent-version-state ${env.GIT_BUILD_CAUSE} --ruby-agent-repo ${env.CHANGE_FORK?.trim() ?: 'elastic'}/${env.REPO} --opbeans-ruby-agent-branch ${env.GIT_BASE_COMMIT}"),
140
- string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_ITS_NAME),
141
- string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
142
- string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT) ])
143
- }
144
- }
145
124
  }
146
125
  }
147
126
  stage('Benchmarks') {
@@ -150,11 +129,11 @@ pipeline {
150
129
  beforeAgent true
151
130
  allOf {
152
131
  anyOf {
153
- branch 'master'
132
+ branch 'main'
154
133
  branch "\\d+\\.\\d+"
155
134
  branch "v\\d?"
156
135
  tag pattern: 'v\\d+.*', comparator: "REGEXP"
157
- expression { return params.Run_As_Master_Branch }
136
+ expression { return params.Run_As_Main_Branch }
158
137
  expression { return env.GITHUB_COMMENT?.contains('benchmark tests') }
159
138
  }
160
139
  expression { return params.bench_ci }
@@ -162,13 +141,13 @@ pipeline {
162
141
  }
163
142
  stages {
164
143
  stage('Clean Workspace') {
165
- agent { label 'metal' }
144
+ agent { label 'microbenchmarks-pool' }
166
145
  steps {
167
146
  echo "Cleaning Workspace"
168
147
  }
169
148
  post {
170
149
  always {
171
- cleanWs()
150
+ cleanWs(notFailBuild: true)
172
151
  }
173
152
  }
174
153
  }
@@ -183,7 +162,7 @@ pipeline {
183
162
  unstash 'source'
184
163
  dir("${BASE_DIR}"){
185
164
  script {
186
- def versions = readYaml(file: ".ci/.jenkins_ruby.yml")
165
+ def versions = readYaml(file: ".ci/.jenkins_ruby_benchmarks.yml")
187
166
  def benchmarkTask = [:]
188
167
  versions['RUBY_VERSION'].each{ v ->
189
168
  benchmarkTask[v] = runBenchmark(v)
@@ -256,11 +235,12 @@ pipeline {
256
235
  (retry 10 curl --silent --show-error --fail -I https://rubygems.org/gems/elastic-apm/versions/${env.VERSION})
257
236
  """
258
237
  dir("${OPBEANS_REPO}"){
259
- git credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
260
- url: "git@github.com:elastic/${OPBEANS_REPO}.git"
238
+ git(credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
239
+ url: "git@github.com:elastic/${OPBEANS_REPO}.git",
240
+ branch: 'main')
261
241
  // It's required to transform the tag value to the gem version
262
242
  sh script: ".ci/bump-version.sh ${env.VERSION}", label: 'Bump version'
263
- // The opbeans pipeline will trigger a release for the master branch
243
+ // The opbeans pipeline will trigger a release for the main branch
264
244
  gitPush()
265
245
  // The opbeans pipeline will trigger a release for the release tag
266
246
  gitCreateTag(tag: "${env.BRANCH_NAME}")
@@ -282,7 +262,7 @@ pipeline {
282
262
  */
283
263
  def runBenchmark(version){
284
264
  return {
285
- node('metal'){
265
+ node('microbenchmarks-pool'){
286
266
  // Transform the versions like:
287
267
  // - docker.elastic.co/observability-ci/jruby:9.2-12-jdk to jruby-9.2-12-jdk
288
268
  // - jruby:9.1 to jruby-9.1
@@ -298,8 +278,6 @@ def runBenchmark(version){
298
278
  }
299
279
  try{
300
280
  sh """./spec/scripts/benchmarks.sh "${version}" "${REFERENCE_REPO}" """
301
- } catch(e){
302
- throw e
303
281
  } finally {
304
282
  archiveArtifacts(
305
283
  allowEmptyArchive: true,
@@ -307,6 +285,7 @@ def runBenchmark(version){
307
285
  onlyIfSuccessful: false)
308
286
  sendBenchmarks(file: "benchmark-${transformedVersion}.bulk",
309
287
  index: "benchmark-ruby", archive: true)
288
+ cleanWs(notFailBuild: true)
310
289
  }
311
290
  }
312
291
  }
@@ -15,7 +15,7 @@
15
15
  repo: apm-agent-ruby
16
16
  repo-owner: elastic
17
17
  credentials-id: 2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken
18
- head-filter-regex: '^(master|PR-.*|[3-4]\.x)$'
18
+ head-filter-regex: '^(main|PR-.*|[3-9]\.x|v4\.[5-9]+.*|v[5-9]+.*)$'
19
19
  ssh-checkout:
20
20
  credentials: f6c7695a-671e-4f4f-a331-acdce44ff9ba
21
21
  build-strategies:
@@ -34,16 +34,16 @@ Add a checklist of things that are required to be reviewed in order to have the
34
34
  List here all the items you have verified BEFORE sending this PR. Please DO NOT remove any item, striking through those that do not apply. (Just in case, strikethrough uses two tildes. ~~Scratch this.~~)
35
35
  -->
36
36
 
37
- - [ ] I have signed the [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).
37
+ - [ ] I have signed the [Contributor License Agreement](https://www.elastic.co/contributor-agreement/).
38
38
  - [ ] My code follows the style guidelines of this project (See `.rubocop.yml`)
39
- - [ ] I have rebased my changes on top of the latest master branch
39
+ - [ ] I have rebased my changes on top of the latest main branch
40
40
  <!--
41
- Update your local repository with the most recent code from the main repo, and rebase your branch on top of the latest master branch. We prefer your initial changes to be squashed into a single commit. Later, if we ask you to make changes, add them as separate commits. This makes them easier to review.
41
+ Update your local repository with the most recent code from the main repo, and rebase your branch on top of the latest main branch. We prefer your initial changes to be squashed into a single commit. Later, if we ask you to make changes, add them as separate commits. This makes them easier to review.
42
42
  -->
43
43
  - [ ] I have added tests that prove my fix is effective or that my feature works
44
- - [ ] New and existing [**unit** tests](https://github.com/elastic/apm-agent-ruby/blob/master/CONTRIBUTING.md#testing) pass locally with my changes
44
+ - [ ] New and existing [**unit** tests](https://github.com/elastic/apm-agent-ruby/blob/main/CONTRIBUTING.md#testing) pass locally with my changes
45
45
  <!--
46
- Run the test suite to make sure that nothing is broken. See https://github.com/elastic/apm-agent-ruby/blob/master/CONTRIBUTING.md#testing for details.
46
+ Run the test suite to make sure that nothing is broken. See https://github.com/elastic/apm-agent-ruby/blob/main/CONTRIBUTING.md#testing for details.
47
47
  -->
48
48
  - [ ] I have made corresponding changes to the documentation
49
49
  - [ ] I have updated [CHANGELOG.asciidoc](CHANGELOG.asciidoc)
@@ -1,5 +1,5 @@
1
1
  repos:
2
- - repo: git://github.com/pre-commit/pre-commit-hooks
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
3
  rev: v2.2.3
4
4
  hooks:
5
5
  - id: check-case-conflict
@@ -9,7 +9,7 @@ repos:
9
9
  - id: check-yaml
10
10
  - id: check-xml
11
11
 
12
- - repo: git@github.com:elastic/apm-pipeline-library
12
+ - repo: https://github.com/elastic/apm-pipeline-library
13
13
  rev: current
14
14
  hooks:
15
15
  - id: check-bash-syntax
data/CHANGELOG.asciidoc CHANGED
@@ -35,6 +35,44 @@ endif::[]
35
35
  [[release-notes-4.x]]
36
36
  === Ruby Agent version 4.x
37
37
 
38
+ [[release-notes-4.6.0]]
39
+ ==== 4.6.0
40
+
41
+ [float]
42
+ ===== Added
43
+
44
+ - Added transaction_name to reported error to allow grouping by transaction name {pull}1267[#1267]
45
+ - Added ability to query server for version (useful in the future) {pull}1278[#1278]
46
+ - Added instrumentation for https://github.com/zendesk/racecar/ Racecar Kafka library {pull}1284[#1284]
47
+
48
+ ===== Changed
49
+
50
+ - Expanded filtering to sanitize any key that contains the string 'auth' {pull}1266[#1266]
51
+ - Rename `log_ecs_formatting` option to `log_ecs_reformatting`, deprecate old option name {pull}1248[#1248]
52
+ - When the configuration value for `log_path` is set, override the `logger` to point to that path instead of using e.g. Rails logger {pull}1247[#1247]
53
+ - Only send tracestate header for distributed tracing when it has content {pull}1277[#1277]
54
+ - Use the hostname as the Kubernetes pod name in the Container Info metadata if the pod id is parsed from cgroup {pull}1314[#1314]
55
+
56
+ ====== Fixed
57
+
58
+ - Small change to Sidekiq tests to handle new configuration passing method {pull}1283[#1283]
59
+ - Set transaction sample rate to 0 when it's unsampled {pull}1339[#1339]
60
+ - Don't send unsampled transactions to APM server >= 8.0 {pull}1341[#1341]
61
+
62
+ [[release-notes-4.5.1]]
63
+ ==== 4.5.1
64
+
65
+ [float]
66
+ ===== Changed
67
+
68
+ - Update elasticsearch spy to use new transport gem name {pull}1257[#1257]
69
+ - Standardize placeholder for phone numbers as [PHONENUMBER] per https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-aws.md {pull}1246[#1246]
70
+
71
+ ===== Fixed
72
+
73
+ - Fixed dependencies to allow CI to build successfully {pull}1259[#1259]
74
+ - Fixed warnings related to TimeTask timeouts {pull}1255[#1255]
75
+
38
76
  [[release-notes-4.5.0]]
39
77
  ==== 4.5.0
40
78
 
data/CONTRIBUTING.md CHANGED
@@ -20,7 +20,7 @@ or that there are particular issues that you should know about before implementi
20
20
 
21
21
  ### Workflow
22
22
 
23
- All feature development and most bug fixes hit the master branch first.
23
+ All feature development and most bug fixes hit the main branch first.
24
24
  Pull requests should be reviewed by someone with commit access.
25
25
  Once approved, the author of the pull request,
26
26
  or reviewer if the author does not have commit access,
@@ -42,7 +42,7 @@ To release a new version:
42
42
 
43
43
  1. Update `VERSION` in `lib/elastic_apm/version.rb` according to the changes (major, minor, patch).
44
44
  1. Update `CHANGELOG.md` to reflect the new version – change _Unreleased_ section to _Version (release date)_.
45
- 1. For Majors: Add a new row to the EOL table in `docs/upgrading.asciidoc`. The EOL date is the release date plus 18 months.
45
+ 1. For Majors: Add a new row to the EOL table in `docs/upgrading.asciidoc`. The EOL date is the release date plus 18 months.
46
46
  1. Make a new commit with the changes above, with a message in the style of `vX.X.X`.
47
47
  1. Run `rake release`. This will...
48
48
  1. Tag the current commit as new version.
data/Gemfile CHANGED
@@ -50,14 +50,14 @@ gem 'json'
50
50
  gem 'json-schema', require: nil
51
51
  gem 'mongo', require: nil
52
52
  gem 'opentracing', require: nil
53
- gem 'rake', require: nil
53
+ gem 'rake', '>= 13.0', require: nil
54
+ gem 'racecar', require: nil if !defined?(JRUBY_VERSION)
54
55
  gem 'resque', require: nil
55
56
  gem 'sequel', require: nil
56
57
  gem 'shoryuken', require: nil
57
58
  gem 'sidekiq', require: nil
58
59
  gem 'simplecov', require: false
59
60
  gem 'simplecov-cobertura', require: false
60
- gem 'sneakers', '~> 2.12', require: nil
61
61
  gem 'sucker_punch', '~> 2.0', require: nil
62
62
  gem 'yard', require: nil
63
63
  gem 'yarjuf'
@@ -78,6 +78,10 @@ frameworks_versions = parsed_frameworks.inject({}) do |frameworks, str|
78
78
  end
79
79
 
80
80
  frameworks_versions.each do |framework, version|
81
+ if framework =='rails' && RUBY_VERSION >= '3.1'
82
+ gem 'net-smtp', require: false
83
+ end
84
+
81
85
  case version
82
86
  when 'master' # sinatra, grape
83
87
  gem framework, github: GITHUB_REPOS.fetch(framework)
@@ -116,6 +120,11 @@ else
116
120
  gem 'sqlite3'
117
121
  end
118
122
 
123
+ # sneakers main only supports >=2.5.0
124
+ if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create('2.5.0') && !defined?(JRUBY_VERSION)
125
+ gem 'sneakers', github: 'jondot/sneakers', ref: 'd761dfe1493', require: nil
126
+ end
127
+
119
128
  group :bench do
120
129
  gem 'ruby-prof', require: nil, platforms: %i[ruby]
121
130
  gem 'stackprof', require: nil, platforms: %i[ruby]
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Elastic APM agent for Ruby
4
4
 
5
- [![Jenkins](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-ruby/apm-agent-ruby-mbp/master)](https://apm-ci.elastic.co/job/apm-agent-ruby/job/apm-agent-ruby-mbp/job/master/) [![Gem](https://img.shields.io/gem/v/elastic-apm.svg)](https://rubygems.org/gems/elastic-apm)
5
+ [![Jenkins](https://apm-ci.elastic.co/buildStatus/icon?job=apm-agent-ruby/apm-agent-ruby-mbp/main)](https://apm-ci.elastic.co/job/apm-agent-ruby/job/apm-agent-ruby-mbp/job/main/) [![Gem](https://img.shields.io/gem/v/elastic-apm.svg)](https://rubygems.org/gems/elastic-apm)
6
6
 
7
7
  The official Rubygem for [Elastic][] [APM][].
8
8
 
data/Rakefile CHANGED
@@ -25,9 +25,9 @@ desc 'Post release action:'\
25
25
  namespace :release do
26
26
  task :update_branch do
27
27
  `git checkout 3.x &&
28
- git rebase master &&
28
+ git rebase main &&
29
29
  git push origin 3.x &&
30
- git checkout master`
30
+ git checkout main`
31
31
  end
32
32
  end
33
33
 
data/bench/report.rb CHANGED
@@ -11,7 +11,7 @@ git_date = `git log -n 1 --pretty="format:%ai"`
11
11
  platform = Gem::Platform.local
12
12
 
13
13
  def doc(payload)
14
- puts({ index: { _index: "benchmark-ruby", _type: "_doc" } }.to_json)
14
+ puts({ index: { _index: "benchmark-ruby" } }.to_json)
15
15
  puts(payload.to_json)
16
16
  end
17
17
 
data/docs/api.asciidoc CHANGED
@@ -334,7 +334,7 @@ Labels are basic key-value pairs that are indexed in your Elasticsearch database
334
334
  The value can be a string, nil, numeric or boolean.
335
335
 
336
336
  TIP: Before using custom labels, ensure you understand the different types of
337
- {apm-overview-ref-v}/metadata.html[metadata] that are available.
337
+ {apm-guide-ref}/data-model-metadata.html[metadata] that are available.
338
338
 
339
339
  [source,ruby]
340
340
  ----
@@ -361,7 +361,7 @@ Use this to further specify a context that will help you track or diagnose what'
361
361
  going on inside your app.
362
362
 
363
363
  TIP: Before using custom context, ensure you understand the different types of
364
- {apm-overview-ref-v}/metadata.html[metadata] that are available.
364
+ {apm-guide-ref}/data-model-metadata.html[metadata] that are available.
365
365
 
366
366
  If called several times during a transaction the custom context will be destructively
367
367
  merged with `merge!`.
@@ -170,7 +170,7 @@ 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
- The API key must be created using the {apm-server-ref-v}/api-key.html[APM server command-line tool].
173
+ The API key must be created using the {apm-guide-ref}/api-key.html[APM server command-line tool].
174
174
 
175
175
  WARNING: API keys only provide any real security if your APM server uses TLS.
176
176
 
@@ -506,12 +506,12 @@ Elastic APM can instrument your Rake tasks. This is an opt-in field, as they are
506
506
 
507
507
  [float]
508
508
  [[config-log-ecs-formatting]]
509
- ==== `log_ecs_formatting`
509
+ ==== `log_ecs_reformatting`
510
510
 
511
511
  [options="header"]
512
512
  |============
513
513
  | Environment | `Config` key | Default
514
- | `ELASTIC_APM_LOG_ECS_FORMATTING` | `log_ecs_formatting` | `off`
514
+ | `ELASTIC_APM_LOG_ECS_REFORMATTING` | `log_ecs_reformatting` | `off`
515
515
  |============
516
516
 
517
517
  This is an experimental option that configures the agent to use the logger from the `ecs-logging` gem. The two
@@ -520,7 +520,7 @@ valid options are `off` and `override`.
520
520
  Setting this option to `override` will set the agent logger to a `EcsLogging::Logger` instance and all logged output
521
521
  will be in ECS-compatible json.
522
522
 
523
- The `ecs-logging` gem must be installed before the agent is started. If `log_ecs_formatting` is set to `override`,
523
+ The `ecs-logging` gem must be installed before the agent is started. If `log_ecs_reformatting` is set to `override`,
524
524
  the agent will attempt to require the gem and if it cannot be loaded, it will fall back to using the standard Ruby
525
525
  `::Logger` and log the load error.
526
526
 
@@ -556,6 +556,8 @@ A path to a log file.
556
556
 
557
557
  By default Elastic APM logs to `stdout` or uses `Rails.log` when used with Rails.
558
558
 
559
+ If `log_path` is specified, this will override `Rails.log` to point to that path instead.
560
+
559
561
  This should support both absolute and relative paths. Please be sure the directory exists.
560
562
 
561
563
  [float]
@@ -654,7 +656,7 @@ when this option is false.
654
656
  [options="header"]
655
657
  |============
656
658
  | Environment | `Config` key | Default | Example
657
- | `ELASTIC_APM_SANITIZE_FIELD_NAMES` | `sanitize_field_names` | `"password,passwd,pwd,secret,*key,*token*,*session*,*credit*,*card*,authorization,set-cookie"` | `Auth*tion,abc*,*xyz`
659
+ | `ELASTIC_APM_SANITIZE_FIELD_NAMES` | `sanitize_field_names` | `"password,passwd,pwd,secret,*key,*token*,*session*,*credit*,*card*,*auth*,set-cookie"` | `Auth*tion,abc*,*xyz`
658
660
  |============
659
661
 
660
662
  Sometimes it is necessary to sanitize the data sent to Elastic APM to remove sensitive values.
@@ -31,6 +31,6 @@ You can then use the APM app in Kibana to gain insight into latency issues and e
31
31
  [[additional-components]]
32
32
  === Additional Components
33
33
 
34
- APM Agents work in conjunction with the {apm-server-ref-v}/index.html[APM Server], {ref}/index.html[Elasticsearch], and {kibana-ref}/index.html[Kibana].
35
- The {apm-overview-ref-v}/index.html[APM Overview] provides details on how these components work together,
36
- and provides a matrix outlining {apm-overview-ref-v}/agent-server-compatibility.html[Agent and Server compatibility].
34
+ APM Agents work in conjunction with the {apm-guide-ref}/index.html[APM Server], {ref}/index.html[Elasticsearch], and {kibana-ref}/index.html[Kibana].
35
+ The {apm-guide-ref}/index.html[APM Guide] provides details on how these components work together,
36
+ and provides a matrix outlining {apm-guide-ref}/agent-server-compatibility.html[Agent and Server compatibility].
@@ -118,4 +118,4 @@ PUT _ingest/pipeline/extract_trace_id
118
118
  }
119
119
  ----
120
120
 
121
- Please see {apm-overview-ref-v}/observability-integrations.html[Observability integrations] for more information.
121
+ Please see {apm-guide-ref}/log-correlation.html[Observability integrations] for more information.
@@ -6,7 +6,7 @@ Upgrades that involve a major version bump often come with some backwards incomp
6
6
  Before upgrading the agent, be sure to review the:
7
7
 
8
8
  * <<release-notes,Agent release notes>>
9
- * {apm-overview-ref-v}/agent-server-compatibility.html[Agent and Server compatibility chart]
9
+ * {apm-guide-ref}/agent-server-compatibility.html[Agent and Server compatibility chart]
10
10
 
11
11
  [float]
12
12
  [[end-of-life-dates]]