elastic-apm 3.13.0 → 3.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49c0c5abfddc19b97d5a0a25f7adeff62bd8ed99a1bdcb97d94ca9b3ff09134f
4
- data.tar.gz: 4e7a68808d904181b3649cc766c075e5b575633b55a370047cd85c4eff53c5ef
3
+ metadata.gz: f35288b7b9e691e200b5ae0183f6cc81ba40cb3cf520f11e3319e6a31461b8d2
4
+ data.tar.gz: '0487ec48ab081691b85d410711402a9777e9a2c815e5384148d2f33ee0d48e89'
5
5
  SHA512:
6
- metadata.gz: 94af89d9a12520b2344f941b85eefdd6d0bd447dc75ac75b220b491611e0b16a47722cce78badf8f065f78cd09496d7a63d5a0e392af3ee939ed86ecef43599b
7
- data.tar.gz: '0790d669dede1e490e290960129488264dc9661224ccb011094c1a3a5a48419ad628f5b7e83ba11ad273c8af1698e9d935cb2d6f3a823197793931f2ec27e7de'
6
+ metadata.gz: 17f18165f940d10a57a0fec94f1f9c5311e0d4c4769273f30a749c2512cc125f912f53b15b78f7a90bb5dc8e6c41dbdf7ecb7b9ecc669f581e0768e22d30771f
7
+ data.tar.gz: 0d2e0655d61495157b947d1ccd441511ee1508ba32b7acbe00dc6deeebd343efa708c6755afa9fc8a9f150cda3224eac52f42f7841c6eeb704bf40bb85c68fb2
@@ -2,4 +2,4 @@
2
2
  # Tuple of ruby version and frameworks which are in charge to send data to codecov.
3
3
  # # is the separator between the ruby version and the framework.
4
4
  ENABLED:
5
- - ruby:2.6#rails-6.0
5
+ - ruby:2.7#rails-6.1
@@ -2,91 +2,79 @@ exclude:
2
2
  # Ruby 2.3
3
3
  # Only includes rails-5.2, sinatra-2.0
4
4
  - RUBY_VERSION: ruby:2.3
5
- FRAMEWORK: rails-6.0
6
- - RUBY_VERSION: ruby:2.3
7
- FRAMEWORK: rails-5.1
5
+ FRAMEWORK: rails-6.1
8
6
  - RUBY_VERSION: ruby:2.3
9
- FRAMEWORK: rails-5.0
7
+ FRAMEWORK: rails-6.0
10
8
  - RUBY_VERSION: ruby:2.3
11
9
  FRAMEWORK: rails-4.2
12
10
  - RUBY_VERSION: ruby:2.3
13
11
  FRAMEWORK: sinatra-1.4
14
12
  - RUBY_VERSION: ruby:2.3
15
- FRAMEWORK: grape-1.3
13
+ FRAMEWORK: grape-1.5
16
14
  - RUBY_VERSION: ruby:2.3
17
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
15
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.0
18
16
  - RUBY_VERSION: ruby:2.3
19
- FRAMEWORK: rails-master
17
+ FRAMEWORK: rails-main
20
18
  - RUBY_VERSION: ruby:2.3
21
19
  FRAMEWORK: sinatra-master
22
20
  - RUBY_VERSION: ruby:2.3
23
21
  FRAMEWORK: grape-master
24
22
 
23
+ # rails-4.2 exclusions
24
+ # Only test on ruby 2.6, 2.5, 2.4, 2.3
25
+ - RUBY_VERSION: ruby:3.0
26
+ FRAMEWORK: rails-4.2
25
27
  - RUBY_VERSION: ruby:2.7
26
28
  FRAMEWORK: rails-4.2
27
29
  - RUBY_VERSION: jruby:9.2
28
30
  FRAMEWORK: rails-4.2
29
- - RUBY_VERSION: jruby:9.1
30
- FRAMEWORK: rails-4.2
31
31
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
32
32
  FRAMEWORK: rails-4.2
33
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-12-jdk
34
- FRAMEWORK: rails-4.2
35
33
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
36
34
  FRAMEWORK: rails-4.2
37
35
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
38
36
  FRAMEWORK: rails-4.2
39
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
40
- FRAMEWORK: rails-4.2
41
37
 
38
+ # rails-6.0 and rails-6.1 exclusions
39
+ # Don't test on ruby 2.4
40
+ - RUBY_VERSION: ruby:2.4
41
+ FRAMEWORK: rails-6.1
42
42
  - RUBY_VERSION: ruby:2.4
43
- FRAMEWORK: rails-6.0
44
- - RUBY_VERSION: jruby:9.1
45
- FRAMEWORK: rails-6.0
46
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
47
43
  FRAMEWORK: rails-6.0
48
44
 
49
- # Only test master on newest ruby
45
+ # Only test rails master on ruby 2.7 and ruby 3.0
50
46
  - RUBY_VERSION: ruby:2.6
51
- FRAMEWORK: rails-master
47
+ FRAMEWORK: rails-main
52
48
  - RUBY_VERSION: ruby:2.5
53
- FRAMEWORK: rails-master
49
+ FRAMEWORK: rails-main
54
50
  - RUBY_VERSION: ruby:2.4
55
- FRAMEWORK: rails-master
51
+ FRAMEWORK: rails-main
56
52
  - RUBY_VERSION: jruby:9.2
57
- FRAMEWORK: rails-master
58
- - RUBY_VERSION: jruby:9.1
59
- FRAMEWORK: rails-master
53
+ FRAMEWORK: rails-main
60
54
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
61
- FRAMEWORK: rails-master
62
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-12-jdk
63
- FRAMEWORK: rails-master
55
+ FRAMEWORK: rails-main
64
56
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
65
- FRAMEWORK: rails-master
57
+ FRAMEWORK: rails-main
66
58
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
67
- FRAMEWORK: rails-master
68
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
69
- FRAMEWORK: rails-master
59
+ FRAMEWORK: rails-main
70
60
 
61
+ # Only test sinatra master on ruby 2.7 and ruby 3.0
62
+ - RUBY_VERSION: ruby:2.6
63
+ FRAMEWORK: sinatra-master
71
64
  - RUBY_VERSION: ruby:2.5
72
65
  FRAMEWORK: sinatra-master
73
66
  - RUBY_VERSION: ruby:2.4
74
67
  FRAMEWORK: sinatra-master
75
68
  - RUBY_VERSION: jruby:9.2
76
69
  FRAMEWORK: sinatra-master
77
- - RUBY_VERSION: jruby:9.1
78
- FRAMEWORK: sinatra-master
79
70
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
80
71
  FRAMEWORK: sinatra-master
81
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-12-jdk
82
- FRAMEWORK: sinatra-master
83
72
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
84
73
  FRAMEWORK: sinatra-master
85
74
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
86
75
  FRAMEWORK: sinatra-master
87
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
88
- FRAMEWORK: sinatra-master
89
76
 
77
+ # Only test grape master on ruby 2.7 and ruby 3.0
90
78
  - RUBY_VERSION: ruby:2.6
91
79
  FRAMEWORK: grape-master
92
80
  - RUBY_VERSION: ruby:2.5
@@ -95,42 +83,39 @@ exclude:
95
83
  FRAMEWORK: grape-master
96
84
  - RUBY_VERSION: jruby:9.2
97
85
  FRAMEWORK: grape-master
98
- - RUBY_VERSION: jruby:9.1
99
- FRAMEWORK: grape-master
100
86
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
101
87
  FRAMEWORK: grape-master
102
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-12-jdk
103
- FRAMEWORK: grape-master
104
88
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
105
89
  FRAMEWORK: grape-master
106
90
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
107
91
  FRAMEWORK: grape-master
108
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
109
- FRAMEWORK: grape-master
110
92
 
111
- # Unsupported
112
- - RUBY_VERSION: jruby:9.1
113
- FRAMEWORK: grape-1.3
114
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
115
- FRAMEWORK: grape-1.3
93
+ # grape 1.5 doesn't support ruby 3.0
94
+ - RUBY_VERSION: ruby:3.0
95
+ FRAMEWORK: grape-1.5
96
+ - RUBY_VERSION: ruby:3.0
97
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
98
+
99
+ # only test ruby 3.0 with rails 6.0 and rails 6.1
100
+ - RUBY_VERSION: ruby:3.0
101
+ FRAMEWORK: rails-5.2
102
+ - RUBY_VERSION: ruby:3.0
103
+ FRAMEWORK: rails-5.1
116
104
 
105
+ # Unsupported
117
106
  - RUBY_VERSION: ruby:2.6
118
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
107
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
119
108
  - RUBY_VERSION: ruby:2.5
120
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
109
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
121
110
  - RUBY_VERSION: ruby:2.4
122
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
111
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
112
+ - RUBY_VERSION: ruby:2.3
113
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
123
114
  - RUBY_VERSION: jruby:9.2
124
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
125
- - RUBY_VERSION: jruby:9.1
126
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
115
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
127
116
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-13-jdk
128
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
129
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-12-jdk
130
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
117
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
131
118
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-11-jdk
132
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
119
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
133
120
  - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.2-8-jdk
134
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
135
- - RUBY_VERSION: docker.elastic.co/observability-ci/jruby:9.1-7-jdk
136
- FRAMEWORK: grape-1.3,sinatra-2.0,rails-6.0
121
+ FRAMEWORK: grape-1.5,sinatra-2.0,rails-6.1
@@ -1,13 +1,12 @@
1
1
  FRAMEWORK:
2
+ - rails-6.1
2
3
  - rails-6.0
3
4
  - rails-5.2
4
- - rails-5.1
5
- - rails-5.0
6
5
  - rails-4.2
7
6
 
8
7
  - sinatra-2.0
9
8
  - sinatra-1.4
10
9
 
11
- - grape-1.3
10
+ - grape-1.5
12
11
 
13
- - grape-1.3,sinatra-2.0,rails-6.0
12
+ - grape-1.5,sinatra-2.0,rails-6.1
@@ -1,4 +1,4 @@
1
1
  FRAMEWORK:
2
- - rails-master
2
+ - rails-main
3
3
  - sinatra-master
4
4
  - grape-master
@@ -1,13 +1,11 @@
1
1
  RUBY_VERSION:
2
+ - ruby:3.0
2
3
  - ruby:2.7
3
4
  - ruby:2.6
4
5
  - ruby:2.5
5
6
  - ruby:2.4
6
7
  - ruby:2.3
7
8
  - jruby:9.2
8
- - jruby:9.1
9
9
  - docker.elastic.co/observability-ci/jruby:9.2-13-jdk
10
- - docker.elastic.co/observability-ci/jruby:9.2-12-jdk
11
10
  - docker.elastic.co/observability-ci/jruby:9.2-11-jdk
12
11
  - docker.elastic.co/observability-ci/jruby:9.2-8-jdk
13
- - docker.elastic.co/observability-ci/jruby:9.1-7-jdk
data/.ci/Jenkinsfile CHANGED
@@ -26,6 +26,7 @@ pipeline {
26
26
  RELEASE_SECRET = 'secret/apm-team/ci/apm-agent-ruby-rubygems-release'
27
27
  OPBEANS_REPO = 'opbeans-ruby'
28
28
  REFERENCE_REPO = '/var/lib/jenkins/.git-references/apm-agent-ruby.git'
29
+ SLACK_CHANNEL = '#apm-agent-ruby'
29
30
  }
30
31
  options {
31
32
  timeout(time: 2, unit: 'HOURS')
@@ -206,6 +207,12 @@ pipeline {
206
207
  tag pattern: 'v\\d+.*', comparator: 'REGEXP'
207
208
  }
208
209
  stages {
210
+ stage('Notify') {
211
+ steps {
212
+ notifyStatus(slackStatus: 'warning', subject: "[${env.REPO}] Release *${env.TAG_NAME}* ready to be pushed",
213
+ body: "(<${env.RUN_DISPLAY_URL}|Open>).\n Changes: ${env.TAG_NAME}")
214
+ }
215
+ }
209
216
  stage('Release') {
210
217
  steps {
211
218
  deleteDir()
@@ -226,9 +233,13 @@ pipeline {
226
233
  }
227
234
  }
228
235
  post {
236
+ success {
237
+ notifyStatus(slackStatus: 'good', subject: "[${env.REPO}] Release *${env.TAG_NAME}* published",
238
+ body: "Great news, the release has been done successfully. (<${env.RUN_DISPLAY_URL}|Open>).")
239
+ }
229
240
  unsuccessful {
230
- emailext subject: "[${env.REPO}] Syncup post-release stage failed.", to: "${NOTIFY_TO}",
231
- body: "Please go to ${env.BUILD_URL} to review the logs. Most likely you need to update the branch manually."
241
+ notifyStatus(slackStatus: 'warning', subject: "[${env.REPO}] Release *${env.TAG_NAME}* has some sync-up post-release failures.",
242
+ body: "Please go to ${env.BUILD_URL} to review the logs. Most likely you need to update the branch manually. (<${env.RUN_DISPLAY_URL}|Open>)")
232
243
  }
233
244
  }
234
245
  }
@@ -417,3 +428,12 @@ def prepareRelease(Closure body){
417
428
  def normalise(def what) {
418
429
  return what.replaceAll('.*/', '').replaceAll(':', '-')
419
430
  }
431
+
432
+ def notifyStatus(def args = [:]) {
433
+ releaseNotification(slackChannel: "${env.SLACK_CHANNEL}",
434
+ slackColor: args.slackStatus,
435
+ slackCredentialsId: 'jenkins-slack-integration-token',
436
+ to: "${env.NOTIFY_TO}",
437
+ subject: args.subject,
438
+ body: args.body)
439
+ }
@@ -2,6 +2,7 @@ FROM openjdk:11-jdk
2
2
 
3
3
  RUN apt-get update \
4
4
  && apt-get install -y libc6-dev --no-install-recommends \
5
+ && apt-get install -y gcc \
5
6
  && rm -rf /var/lib/apt/lists/*
6
7
 
7
8
  ENV JRUBY_VERSION 9.2.10.0
@@ -37,4 +38,4 @@ ENV PATH $BUNDLE_BIN:$PATH
37
38
  RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
38
39
  && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
39
40
 
40
- CMD [ "irb" ]
41
+ CMD [ "irb" ]
@@ -2,6 +2,7 @@ FROM adoptopenjdk:12-jdk-openj9
2
2
 
3
3
  RUN apt-get update \
4
4
  && apt-get install -y libc6-dev git tcc netbase --no-install-recommends \
5
+ && apt-get install -y gcc \
5
6
  && rm -rf /var/lib/apt/lists/*
6
7
 
7
8
  ENV JRUBY_VERSION 9.2.10.0
@@ -37,4 +38,4 @@ ENV PATH $BUNDLE_BIN:$PATH
37
38
  RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
38
39
  && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
39
40
 
40
- CMD [ "irb" ]
41
+ CMD [ "irb" ]
@@ -2,6 +2,7 @@ FROM openjdk:13-jdk-slim
2
2
 
3
3
  RUN apt-get update \
4
4
  && apt-get install -y libc6-dev git tcc curl netbase --no-install-recommends \
5
+ && apt-get install -y gcc \
5
6
  && rm -rf /var/lib/apt/lists/*
6
7
 
7
8
  ENV JRUBY_VERSION 9.2.10.0
@@ -37,4 +38,4 @@ ENV PATH $BUNDLE_BIN:$PATH
37
38
  RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
38
39
  && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
39
40
 
40
- CMD [ "irb" ]
41
+ CMD [ "irb" ]
@@ -2,6 +2,7 @@ FROM openjdk:7-jdk
2
2
 
3
3
  RUN apt-get update \
4
4
  && apt-get install -y libc6-dev --no-install-recommends \
5
+ && apt-get install -y gcc \
5
6
  && rm -rf /var/lib/apt/lists/*
6
7
 
7
8
  ENV JRUBY_VERSION 9.1.17.0
@@ -37,4 +38,4 @@ ENV PATH $BUNDLE_BIN:$PATH
37
38
  RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
38
39
  && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
39
40
 
40
- CMD [ "irb" ]
41
+ CMD [ "irb" ]
@@ -2,6 +2,7 @@ FROM openjdk:8-jdk
2
2
 
3
3
  RUN apt-get update \
4
4
  && apt-get install -y libc6-dev --no-install-recommends \
5
+ && apt-get install -y gcc \
5
6
  && rm -rf /var/lib/apt/lists/*
6
7
 
7
8
  ENV JRUBY_VERSION 9.2.10.0
@@ -37,4 +38,4 @@ ENV PATH $BUNDLE_BIN:$PATH
37
38
  RUN mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
38
39
  && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
39
40
 
40
- CMD [ "irb" ]
41
+ CMD [ "irb" ]
@@ -0,0 +1,29 @@
1
+ name: Auto Assign to Project(s)
2
+
3
+ on:
4
+ issues:
5
+ types: [opened, edited, milestoned]
6
+ pull_request_target:
7
+ types: [opened, edited, milestoned]
8
+ env:
9
+ MY_GITHUB_TOKEN: ${{ secrets.APM_TECH_USER_TOKEN }}
10
+
11
+ jobs:
12
+ assign_one_project:
13
+ runs-on: ubuntu-latest
14
+ name: Assign milestoned to Project
15
+ steps:
16
+ - name: Assign issues with milestones to project
17
+ uses: elastic/assign-one-project-github-action@1.2.2
18
+ if: github.event.issue && github.event.issue.milestone
19
+ with:
20
+ project: 'https://github.com/orgs/elastic/projects/454'
21
+ project_id: '5882982'
22
+ column_name: 'Planned'
23
+ - name: Assign new pull requests to project
24
+ uses: elastic/assign-one-project-github-action@1.2.2
25
+ if: github.event.action == 'opened' && github.event.pull_request
26
+ with:
27
+ project: 'https://github.com/orgs/elastic/projects/454'
28
+ project_id: '5882982'
29
+ column_name: 'In Progress'
data/CHANGELOG.asciidoc CHANGED
@@ -35,6 +35,20 @@ endif::[]
35
35
  [[release-notes-3.x]]
36
36
  === Ruby Agent version 3.x
37
37
 
38
+ [[release-notes-3.14.0]]
39
+ ==== 3.14.0 (2021-03-17)
40
+
41
+ [float]
42
+ ===== Added
43
+ - Expanded support for extracting ActiveRecord adapter name from notification payload when using ActiveRecord versions before 6.0 {pull}953[#953]
44
+
45
+ [float]
46
+ ===== Fixed
47
+
48
+ - Fixed setting outcome in Mongo spy when not traced {pull}937[#937]
49
+ - Fixed missing container metadata in payloads {pull}942[#942]
50
+ - Fixed outgoing HTTP request spans with no Host {pull}962[#962]
51
+
38
52
  [[release-notes-3.13.0]]
39
53
  ==== 3.13.0 (2020-12-22)
40
54
 
data/Gemfile CHANGED
@@ -23,7 +23,6 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
23
23
 
24
24
  # Tools
25
25
  gem 'cucumber', require: false
26
- gem 'pry'
27
26
  gem 'rack-test'
28
27
  gem 'rspec', '~> 3'
29
28
  gem 'rspec-its'
@@ -40,7 +39,7 @@ gem 'graphql', require: nil
40
39
  if !defined?(JRUBY_VERSION) && RUBY_VERSION < '2.5'
41
40
  gem 'google-protobuf', '< 3.12'
42
41
  end
43
- gem 'grpc' unless defined?(JRUBY_VERSION)
42
+ gem 'grpc' if !defined?(JRUBY_VERSION) && RUBY_VERSION < '3.0'
44
43
  gem 'json'
45
44
  gem 'json-schema', require: nil
46
45
  gem 'mongo', require: nil
@@ -57,6 +56,10 @@ gem 'sucker_punch', '~> 2.0', require: nil
57
56
  gem 'yard', require: nil
58
57
  gem 'yarjuf'
59
58
 
59
+ # See issue #6547 in the JRuby repo. When that bug is fixed,
60
+ # we can use the latest version of the i18n gem.
61
+ gem 'i18n', '< 1.8.8'
62
+
60
63
  ## Install Framework
61
64
  GITHUB_REPOS = {
62
65
  'grape' => 'ruby-grape/grape',
@@ -74,8 +77,10 @@ end
74
77
 
75
78
  frameworks_versions.each do |framework, version|
76
79
  case version
77
- when 'master'
80
+ when 'master' # sinatra, grape
78
81
  gem framework, github: GITHUB_REPOS.fetch(framework)
82
+ when 'main' # rails
83
+ gem framework, github: GITHUB_REPOS.fetch(framework), branch: 'main'
79
84
  when /.+/
80
85
  gem framework, "~> #{version}.0"
81
86
  else
@@ -84,14 +89,22 @@ frameworks_versions.each do |framework, version|
84
89
  end
85
90
 
86
91
  if frameworks_versions.key?('rails')
87
- unless frameworks_versions['rails'] =~ /^(master|6)/
92
+ unless frameworks_versions['rails'] =~ /^(main|6)/
88
93
  gem 'delayed_job', require: nil
89
94
  end
90
95
  end
91
96
 
92
97
  if RUBY_PLATFORM == 'java'
93
- gem 'activerecord-jdbcsqlite3-adapter'
94
- gem 'jdbc-sqlite3'
98
+ case rails = frameworks_versions['rails']
99
+ when 'main'
100
+ gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', glob: 'activerecord-jdbcsqlite3-adapter/*.gemspec'
101
+ when ''
102
+ gem 'activerecord-jdbcsqlite3-adapter', "~> 61.0"
103
+ when nil
104
+ gem 'jdbc-sqlite3'
105
+ else
106
+ gem 'activerecord-jdbcsqlite3-adapter', "~> #{rails.tr('.', '')}.0"
107
+ end
95
108
  elsif frameworks_versions['rails'] =~ /^(4|5)/
96
109
  gem 'sqlite3', '~> 1.3.6'
97
110
  else
@@ -322,6 +322,23 @@ Usually APM Server determines how often to poll, but if not the default interval
322
322
 
323
323
  NOTE: This feature requires APM Server v7.3 or later and that the APM Server is configured with `kibana.enabled: true`.
324
324
 
325
+ [float]
326
+ [[config-cloud-provider]]
327
+ ==== `cloud_provider`
328
+ |============
329
+ | Environment | `Config` key | Default
330
+ | `ELASTIC_APM_CLOUD_PROVIDER` | `cloud_provider` | `"auto"`
331
+ |============
332
+
333
+ Specify the cloud provider for metadata collection.
334
+ Defaults to `"auto"`, which means the agent uses trial and
335
+ error to collect metadata from all supported cloud providers.
336
+
337
+ Valid options are `"auto"`, `"aws"`, `"gcp"`, `"azure"`, and `"none"`.
338
+ If set to `"none"`, no cloud metadata will be collected.
339
+ If set to any of `"aws"`, `"gcp"`, or `"azure"`,
340
+ attempts to collect metadata will only be performed from the chosen provider.
341
+
325
342
  [float]
326
343
  [[config-custom-key-filters]]
327
344
  ==== `custom_key_filters` deprecated:[3.5.0,See <<config-sanitize-field-names>> instead.]
@@ -77,6 +77,8 @@ requests using these libraries:
77
77
  - Http.rb (v0.6+)
78
78
  - Faraday (v0.2.1+)
79
79
 
80
+ *Note:* These libraries usually assume `localhost` if no `Host` is specified, so the agent does as well.
81
+
80
82
  [float]
81
83
  [[supported-technologies-backgroud-processing]]
82
84
  === Background Processing
@@ -303,8 +303,11 @@ module ElasticAPM
303
303
  end
304
304
 
305
305
  def server_ca_cert=(value)
306
- warn '[DEPRECATED] The option server_ca_cert has been ' \
307
- 'renamed to server_ca_cert_file to align with other agents.'
306
+ unless value == self.class.schema[:server_ca_cert_file][:default]
307
+ warn '[DEPRECATED] The option server_ca_cert has been ' \
308
+ 'renamed to server_ca_cert_file to align with other agents.'
309
+ end
310
+
308
311
  self.server_ca_cert_file = value
309
312
  end
310
313
 
@@ -57,10 +57,17 @@ module ElasticAPM
57
57
  private
58
58
 
59
59
  def subtype_for(payload)
60
- cached_adapter_name(
61
- payload[:connection]&.adapter_name ||
62
- ::ActiveRecord::Base.connection_config[:adapter]
63
- )
60
+ return cached_adapter_name(payload[:connection].adapter_name) if payload[:connection]
61
+
62
+ if can_attempt_connection_id_lookup?(payload)
63
+ begin
64
+ loaded_object = ObjectSpace._id2ref(payload[:connection_id])
65
+ return cached_adapter_name(loaded_object.adapter_name) if loaded_object.respond_to?(:adapter_name)
66
+ rescue RangeError # if connection object has somehow been garbage collected
67
+ end
68
+ end
69
+
70
+ cached_adapter_name(::ActiveRecord::Base.connection_config[:adapter])
64
71
  end
65
72
 
66
73
  def summarize(sql)
@@ -69,11 +76,16 @@ module ElasticAPM
69
76
 
70
77
  def cached_adapter_name(adapter_name)
71
78
  return UNKNOWN if adapter_name.nil? || adapter_name.empty?
79
+
72
80
  @adapters[adapter_name] ||
73
81
  (@adapters[adapter_name] = adapter_name.downcase)
74
82
  rescue StandardError
75
83
  nil
76
84
  end
85
+
86
+ def can_attempt_connection_id_lookup?(payload)
87
+ RUBY_ENGINE == "ruby" && payload[:connection_id] && ObjectSpace.respond_to?(:_id2ref)
88
+ end
77
89
  end
78
90
  end
79
91
  end
@@ -33,6 +33,8 @@ module ElasticAPM
33
33
  private
34
34
 
35
35
  def sanitize_url(uri_or_str)
36
+ return unless uri_or_str
37
+
36
38
  uri = uri_or_str.is_a?(URI) ? uri_or_str.dup : URI(uri_or_str)
37
39
  uri.password = nil
38
40
  uri.to_s
@@ -38,7 +38,7 @@ module ElasticAPM
38
38
  end
39
39
 
40
40
  def self.invoke_job(job, *args, &block)
41
- job_name = name_from_payload(job.payload_object)
41
+ job_name = job_name(job)
42
42
  transaction = ElasticAPM.start_transaction(job_name, TYPE)
43
43
  job.invoke_job_without_apm(*args, &block)
44
44
  transaction&.done 'success'
@@ -52,7 +52,9 @@ module ElasticAPM
52
52
  ElasticAPM.end_transaction
53
53
  end
54
54
 
55
- def self.name_from_payload(payload_object)
55
+ def self.job_name(job)
56
+ payload_object = job.payload_object
57
+
56
58
  if payload_object.is_a?(::Delayed::PerformableMethod)
57
59
  performable_method_name(payload_object)
58
60
  elsif payload_object.instance_of?(
@@ -62,6 +64,8 @@ module ElasticAPM
62
64
  else
63
65
  payload_object.class.name
64
66
  end
67
+ rescue
68
+ job.name
65
69
  end
66
70
 
67
71
  def self.performable_method_name(payload_object)
@@ -55,20 +55,25 @@ module ElasticAPM
55
55
  tmp_request = build_request(method) do |req|
56
56
  yield(req) if block_given?
57
57
  end
58
- uri = URI(tmp_request.path)
58
+ uri = tmp_request.path && URI(tmp_request.path)
59
59
  end
60
60
 
61
- host = uri.host
61
+ host = uri&.host || 'localhost'
62
62
 
63
63
  upcased_method = method.to_s.upcase
64
64
 
65
- destination = ElasticAPM::Span::Context::Destination.from_uri(uri)
66
-
67
- context =
68
- ElasticAPM::Span::Context.new(
69
- http: { url: uri, method: upcased_method },
70
- destination: destination
71
- )
65
+ if uri
66
+ destination = ElasticAPM::Span::Context::Destination.from_uri(uri)
67
+
68
+ context =
69
+ ElasticAPM::Span::Context.new(
70
+ http: { url: uri, method: upcased_method },
71
+ destination: destination
72
+ )
73
+ else
74
+ context =
75
+ ElasticAPM::Span::Context.new(http: { url: uri, method: upcased_method })
76
+ end
72
77
 
73
78
  ElasticAPM.with_span(
74
79
  "#{upcased_method} #{host}",
@@ -44,14 +44,18 @@ module ElasticAPM
44
44
  end
45
45
 
46
46
  def failed(event)
47
- span = pop_event(event)
48
- span&.outcome = Span::Outcome::FAILURE
47
+ if (span = pop_event(event))
48
+ span.outcome = Span::Outcome::FAILURE
49
+ end
50
+
49
51
  span
50
52
  end
51
53
 
52
54
  def succeeded(event)
53
- span = pop_event(event)
54
- span&.outcome = Span::Outcome::SUCCESS
55
+ if span = pop_event(event)
56
+ span.outcome = Span::Outcome::SUCCESS
57
+ end
58
+
55
59
  span
56
60
  end
57
61
 
@@ -61,7 +61,7 @@ module ElasticAPM
61
61
  return request_without_apm(req, body, &block)
62
62
  end
63
63
 
64
- host = req['host']&.split(':')&.first || address
64
+ host = req['host']&.split(':')&.first || address || 'localhost'
65
65
  method = req.method.to_s.upcase
66
66
  path, query = req.path.split('?')
67
67
 
@@ -84,7 +84,8 @@ module ElasticAPM
84
84
  hostname: keyword_field(system.hostname),
85
85
  architecture: keyword_field(system.architecture),
86
86
  platform: keyword_field(system.platform),
87
- kubernetes: keyword_object(system.kubernetes)
87
+ kubernetes: keyword_object(system.kubernetes),
88
+ container: keyword_object(system.container)
88
89
  }
89
90
  end
90
91
 
@@ -18,5 +18,5 @@
18
18
  # frozen_string_literal: true
19
19
 
20
20
  module ElasticAPM
21
- VERSION = '3.13.0'
21
+ VERSION = '3.14.0'
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 3.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikkel Malmberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-22 00:00:00.000000000 Z
11
+ date: 2021-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -70,6 +70,7 @@ files:
70
70
  - ".github/ISSUE_TEMPLATE/Feature_request.md"
71
71
  - ".github/PULL_REQUEST_TEMPLATE.md"
72
72
  - ".github/labeler-config.yml"
73
+ - ".github/workflows/addToProject.yml"
73
74
  - ".github/workflows/labeler.yml"
74
75
  - ".gitignore"
75
76
  - ".pre-commit-config.yaml"