elastic-apm 3.3.0 → 3.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/.jenkins_exclude.yml +43 -24
- data/.ci/.jenkins_framework.yml +2 -2
- data/.ci/.jenkins_ruby.yml +1 -1
- data/.ci/Jenkinsfile +288 -170
- data/.ci/docker/jruby/11-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/12-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/13-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/7-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/8-jdk/Dockerfile +40 -0
- data/.ci/docker/jruby/README.md +31 -0
- data/.ci/docker/jruby/run.sh +73 -0
- data/.ci/docker/jruby/test.sh +13 -0
- data/.ci/jobs/apm-agent-ruby-downstream.yml +1 -0
- data/.ci/jobs/apm-agent-ruby-linting-mbp.yml +1 -0
- data/.ci/jobs/apm-agent-ruby-mbp.yml +1 -0
- data/.ci/jobs/defaults.yml +1 -1
- data/.ci/packer_cache.sh +16 -0
- data/.github/ISSUE_TEMPLATE/Bug_report.md +40 -0
- data/.github/ISSUE_TEMPLATE/Feature_request.md +17 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +60 -0
- data/.gitignore +8 -0
- data/.rspec +0 -1
- data/.rubocop.yml +18 -0
- data/CHANGELOG.asciidoc +104 -1
- data/CONTRIBUTING.md +6 -48
- data/Gemfile +38 -10
- data/README.md +62 -13
- data/Rakefile +37 -5
- data/bench/sql.rb +49 -0
- data/bin/build_docs +1 -1
- data/bin/run-tests +4 -1
- data/docker-compose.yml +7 -0
- data/docs/api.asciidoc +52 -3
- data/docs/configuration.asciidoc +171 -22
- data/docs/getting-started-rails.asciidoc +2 -0
- data/docs/graphql.asciidoc +23 -0
- data/docs/images/dynamic-config.svg +1 -0
- data/docs/index.asciidoc +6 -1
- data/docs/introduction.asciidoc +2 -1
- data/docs/performance-tuning.asciidoc +106 -0
- data/docs/set-up.asciidoc +5 -2
- data/docs/supported-technologies.asciidoc +86 -1
- data/docs/upgrading.asciidoc +45 -0
- data/elastic-apm.gemspec +17 -0
- data/lib/elastic-apm.rb +17 -0
- data/lib/elastic_apm.rb +58 -5
- data/lib/elastic_apm/agent.rb +55 -4
- data/lib/elastic_apm/central_config.rb +27 -8
- data/lib/elastic_apm/central_config/cache_control.rb +17 -0
- data/lib/elastic_apm/child_durations.rb +26 -4
- data/lib/elastic_apm/config.rb +86 -5
- data/lib/elastic_apm/config/bytes.rb +17 -0
- data/lib/elastic_apm/config/duration.rb +17 -0
- data/lib/elastic_apm/config/options.rb +21 -5
- data/lib/elastic_apm/config/regexp_list.rb +17 -0
- data/lib/elastic_apm/config/wildcard_pattern_list.rb +20 -1
- data/lib/elastic_apm/context.rb +17 -0
- data/lib/elastic_apm/context/request.rb +17 -0
- data/lib/elastic_apm/context/request/socket.rb +17 -0
- data/lib/elastic_apm/context/request/url.rb +17 -0
- data/lib/elastic_apm/context/response.rb +27 -2
- data/lib/elastic_apm/context/user.rb +17 -0
- data/lib/elastic_apm/context_builder.rb +17 -0
- data/lib/elastic_apm/deprecations.rb +17 -0
- data/lib/elastic_apm/error.rb +17 -0
- data/lib/elastic_apm/error/exception.rb +17 -0
- data/lib/elastic_apm/error/log.rb +17 -0
- data/lib/elastic_apm/error_builder.rb +17 -0
- data/lib/elastic_apm/grape.rb +17 -0
- data/lib/elastic_apm/graphql.rb +91 -0
- data/lib/elastic_apm/grpc.rb +99 -0
- data/lib/elastic_apm/instrumenter.rb +49 -15
- data/lib/elastic_apm/internal_error.rb +17 -0
- data/lib/elastic_apm/logging.rb +17 -0
- data/lib/elastic_apm/metadata.rb +17 -0
- data/lib/elastic_apm/metadata/process_info.rb +17 -0
- data/lib/elastic_apm/metadata/service_info.rb +22 -2
- data/lib/elastic_apm/metadata/system_info.rb +17 -0
- data/lib/elastic_apm/metadata/system_info/container_info.rb +17 -0
- data/lib/elastic_apm/metrics.rb +33 -1
- data/lib/elastic_apm/metrics/breakdown_set.rb +17 -0
- data/lib/elastic_apm/metrics/cpu_mem_set.rb +17 -0
- data/lib/elastic_apm/metrics/metric.rb +23 -4
- data/lib/elastic_apm/metrics/set.rb +17 -0
- data/lib/elastic_apm/metrics/span_scoped_set.rb +17 -0
- data/lib/elastic_apm/metrics/transaction_set.rb +17 -0
- data/lib/elastic_apm/metrics/vm_set.rb +17 -0
- data/lib/elastic_apm/metricset.rb +17 -0
- data/lib/elastic_apm/middleware.rb +20 -4
- data/lib/elastic_apm/naively_hashable.rb +17 -0
- data/lib/elastic_apm/normalizers.rb +17 -0
- data/lib/elastic_apm/normalizers/grape.rb +17 -0
- data/lib/elastic_apm/normalizers/grape/endpoint_run.rb +18 -1
- data/lib/elastic_apm/normalizers/rails.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_controller.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_mailer.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/action_view.rb +17 -0
- data/lib/elastic_apm/normalizers/rails/active_record.rb +29 -5
- data/lib/elastic_apm/opentracing.rb +66 -24
- data/lib/elastic_apm/rails.rb +18 -10
- data/lib/elastic_apm/railtie.rb +18 -1
- data/lib/elastic_apm/resque.rb +29 -0
- data/lib/elastic_apm/sinatra.rb +17 -0
- data/lib/elastic_apm/span.rb +20 -2
- data/lib/elastic_apm/span/context.rb +43 -44
- data/lib/elastic_apm/span/context/db.rb +43 -0
- data/lib/elastic_apm/span/context/destination.rb +77 -0
- data/lib/elastic_apm/span/context/http.rb +43 -0
- data/lib/elastic_apm/span_helpers.rb +17 -0
- data/lib/elastic_apm/spies.rb +33 -14
- data/lib/elastic_apm/spies/action_dispatch.rb +17 -0
- data/lib/elastic_apm/spies/delayed_job.rb +17 -0
- data/lib/elastic_apm/spies/elasticsearch.rb +49 -5
- data/lib/elastic_apm/spies/faraday.rb +53 -18
- data/lib/elastic_apm/spies/http.rb +35 -3
- data/lib/elastic_apm/spies/json.rb +17 -0
- data/lib/elastic_apm/spies/mongo.rb +23 -1
- data/lib/elastic_apm/spies/net_http.rb +50 -8
- data/lib/elastic_apm/spies/rake.rb +17 -0
- data/lib/elastic_apm/spies/redis.rb +17 -0
- data/lib/elastic_apm/spies/resque.rb +53 -0
- data/lib/elastic_apm/spies/sequel.rb +52 -15
- data/lib/elastic_apm/spies/shoryuken.rb +65 -0
- data/lib/elastic_apm/spies/sidekiq.rb +17 -0
- data/lib/elastic_apm/spies/sinatra.rb +17 -0
- data/lib/elastic_apm/spies/sneakers.rb +74 -0
- data/lib/elastic_apm/spies/sucker_punch.rb +54 -0
- data/lib/elastic_apm/spies/tilt.rb +17 -0
- data/lib/elastic_apm/sql.rb +36 -0
- data/lib/elastic_apm/sql/signature.rb +169 -0
- data/lib/elastic_apm/sql/tokenizer.rb +264 -0
- data/lib/elastic_apm/sql/tokens.rb +63 -0
- data/lib/elastic_apm/sql_summarizer.rb +18 -2
- data/lib/elastic_apm/stacktrace.rb +17 -0
- data/lib/elastic_apm/stacktrace/frame.rb +17 -0
- data/lib/elastic_apm/stacktrace_builder.rb +23 -1
- data/lib/elastic_apm/subscriber.rb +17 -0
- data/lib/elastic_apm/trace_context.rb +85 -49
- data/lib/elastic_apm/trace_context/traceparent.rb +113 -0
- data/lib/elastic_apm/trace_context/tracestate.rb +43 -0
- data/lib/elastic_apm/transaction.rb +43 -15
- data/lib/elastic_apm/transport/base.rb +39 -23
- data/lib/elastic_apm/transport/connection.rb +17 -0
- data/lib/elastic_apm/transport/connection/http.rb +17 -0
- data/lib/elastic_apm/transport/connection/proxy_pipe.rb +24 -2
- data/lib/elastic_apm/transport/filters.rb +17 -0
- data/lib/elastic_apm/transport/filters/hash_sanitizer.rb +77 -0
- data/lib/elastic_apm/transport/filters/secrets_filter.rb +29 -53
- data/lib/elastic_apm/transport/headers.rb +21 -0
- data/lib/elastic_apm/transport/serializers.rb +17 -0
- data/lib/elastic_apm/transport/serializers/context_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/error_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/metadata_serializer.rb +44 -20
- data/lib/elastic_apm/transport/serializers/metricset_serializer.rb +17 -0
- data/lib/elastic_apm/transport/serializers/span_serializer.rb +45 -8
- data/lib/elastic_apm/transport/serializers/transaction_serializer.rb +17 -0
- data/lib/elastic_apm/transport/user_agent.rb +17 -0
- data/lib/elastic_apm/transport/worker.rb +17 -0
- data/lib/elastic_apm/util.rb +17 -0
- data/lib/elastic_apm/util/inflector.rb +17 -0
- data/lib/elastic_apm/util/lru_cache.rb +17 -0
- data/lib/elastic_apm/util/throttle.rb +17 -0
- data/lib/elastic_apm/version.rb +18 -1
- metadata +36 -7
- data/.ci/downstreamTests.groovy +0 -185
- data/.ci/prepare-git-context.sh +0 -24
- data/.github/workflows/main.yml +0 -14
- data/CHANGELOG.md +0 -1
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.
|
4
|
+
version: 3.8.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:
|
11
|
+
date: 2020-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
@@ -51,21 +51,29 @@ files:
|
|
51
51
|
- ".ci/.jenkins_master_framework.yml"
|
52
52
|
- ".ci/.jenkins_ruby.yml"
|
53
53
|
- ".ci/Jenkinsfile"
|
54
|
-
- ".ci/
|
54
|
+
- ".ci/docker/jruby/11-jdk/Dockerfile"
|
55
|
+
- ".ci/docker/jruby/12-jdk/Dockerfile"
|
56
|
+
- ".ci/docker/jruby/13-jdk/Dockerfile"
|
57
|
+
- ".ci/docker/jruby/7-jdk/Dockerfile"
|
58
|
+
- ".ci/docker/jruby/8-jdk/Dockerfile"
|
59
|
+
- ".ci/docker/jruby/README.md"
|
60
|
+
- ".ci/docker/jruby/run.sh"
|
61
|
+
- ".ci/docker/jruby/test.sh"
|
55
62
|
- ".ci/jobs/apm-agent-ruby-downstream.yml"
|
56
63
|
- ".ci/jobs/apm-agent-ruby-linting-mbp.yml"
|
57
64
|
- ".ci/jobs/apm-agent-ruby-mbp.yml"
|
58
65
|
- ".ci/jobs/apm-agent-ruby.yml"
|
59
66
|
- ".ci/jobs/defaults.yml"
|
60
67
|
- ".ci/linting.groovy"
|
61
|
-
- ".ci/
|
62
|
-
- ".github/
|
68
|
+
- ".ci/packer_cache.sh"
|
69
|
+
- ".github/ISSUE_TEMPLATE/Bug_report.md"
|
70
|
+
- ".github/ISSUE_TEMPLATE/Feature_request.md"
|
71
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
63
72
|
- ".gitignore"
|
64
73
|
- ".pre-commit-config.yaml"
|
65
74
|
- ".rspec"
|
66
75
|
- ".rubocop.yml"
|
67
76
|
- CHANGELOG.asciidoc
|
68
|
-
- CHANGELOG.md
|
69
77
|
- CODE_OF_CONDUCT.md
|
70
78
|
- CONTRIBUTING.md
|
71
79
|
- Dockerfile
|
@@ -78,6 +86,7 @@ files:
|
|
78
86
|
- bench/benchmark.rb
|
79
87
|
- bench/report.rb
|
80
88
|
- bench/rubyprof.rb
|
89
|
+
- bench/sql.rb
|
81
90
|
- bench/stackprof.rb
|
82
91
|
- bench/tmp/.gitkeep
|
83
92
|
- bin/build_docs
|
@@ -95,14 +104,18 @@ files:
|
|
95
104
|
- docs/debugging.asciidoc
|
96
105
|
- docs/getting-started-rack.asciidoc
|
97
106
|
- docs/getting-started-rails.asciidoc
|
107
|
+
- docs/graphql.asciidoc
|
108
|
+
- docs/images/dynamic-config.svg
|
98
109
|
- docs/index.asciidoc
|
99
110
|
- docs/introduction.asciidoc
|
100
111
|
- docs/log-correlation.asciidoc
|
101
112
|
- docs/metrics.asciidoc
|
102
113
|
- docs/opentracing.asciidoc
|
114
|
+
- docs/performance-tuning.asciidoc
|
103
115
|
- docs/release-notes.asciidoc
|
104
116
|
- docs/set-up.asciidoc
|
105
117
|
- docs/supported-technologies.asciidoc
|
118
|
+
- docs/upgrading.asciidoc
|
106
119
|
- elastic-apm.gemspec
|
107
120
|
- lib/elastic-apm.rb
|
108
121
|
- lib/elastic_apm.rb
|
@@ -129,6 +142,8 @@ files:
|
|
129
142
|
- lib/elastic_apm/error/log.rb
|
130
143
|
- lib/elastic_apm/error_builder.rb
|
131
144
|
- lib/elastic_apm/grape.rb
|
145
|
+
- lib/elastic_apm/graphql.rb
|
146
|
+
- lib/elastic_apm/grpc.rb
|
132
147
|
- lib/elastic_apm/instrumenter.rb
|
133
148
|
- lib/elastic_apm/internal_error.rb
|
134
149
|
- lib/elastic_apm/logging.rb
|
@@ -159,9 +174,13 @@ files:
|
|
159
174
|
- lib/elastic_apm/opentracing.rb
|
160
175
|
- lib/elastic_apm/rails.rb
|
161
176
|
- lib/elastic_apm/railtie.rb
|
177
|
+
- lib/elastic_apm/resque.rb
|
162
178
|
- lib/elastic_apm/sinatra.rb
|
163
179
|
- lib/elastic_apm/span.rb
|
164
180
|
- lib/elastic_apm/span/context.rb
|
181
|
+
- lib/elastic_apm/span/context/db.rb
|
182
|
+
- lib/elastic_apm/span/context/destination.rb
|
183
|
+
- lib/elastic_apm/span/context/http.rb
|
165
184
|
- lib/elastic_apm/span_helpers.rb
|
166
185
|
- lib/elastic_apm/spies.rb
|
167
186
|
- lib/elastic_apm/spies/action_dispatch.rb
|
@@ -174,22 +193,33 @@ files:
|
|
174
193
|
- lib/elastic_apm/spies/net_http.rb
|
175
194
|
- lib/elastic_apm/spies/rake.rb
|
176
195
|
- lib/elastic_apm/spies/redis.rb
|
196
|
+
- lib/elastic_apm/spies/resque.rb
|
177
197
|
- lib/elastic_apm/spies/sequel.rb
|
198
|
+
- lib/elastic_apm/spies/shoryuken.rb
|
178
199
|
- lib/elastic_apm/spies/sidekiq.rb
|
179
200
|
- lib/elastic_apm/spies/sinatra.rb
|
201
|
+
- lib/elastic_apm/spies/sneakers.rb
|
202
|
+
- lib/elastic_apm/spies/sucker_punch.rb
|
180
203
|
- lib/elastic_apm/spies/tilt.rb
|
204
|
+
- lib/elastic_apm/sql.rb
|
205
|
+
- lib/elastic_apm/sql/signature.rb
|
206
|
+
- lib/elastic_apm/sql/tokenizer.rb
|
207
|
+
- lib/elastic_apm/sql/tokens.rb
|
181
208
|
- lib/elastic_apm/sql_summarizer.rb
|
182
209
|
- lib/elastic_apm/stacktrace.rb
|
183
210
|
- lib/elastic_apm/stacktrace/frame.rb
|
184
211
|
- lib/elastic_apm/stacktrace_builder.rb
|
185
212
|
- lib/elastic_apm/subscriber.rb
|
186
213
|
- lib/elastic_apm/trace_context.rb
|
214
|
+
- lib/elastic_apm/trace_context/traceparent.rb
|
215
|
+
- lib/elastic_apm/trace_context/tracestate.rb
|
187
216
|
- lib/elastic_apm/transaction.rb
|
188
217
|
- lib/elastic_apm/transport/base.rb
|
189
218
|
- lib/elastic_apm/transport/connection.rb
|
190
219
|
- lib/elastic_apm/transport/connection/http.rb
|
191
220
|
- lib/elastic_apm/transport/connection/proxy_pipe.rb
|
192
221
|
- lib/elastic_apm/transport/filters.rb
|
222
|
+
- lib/elastic_apm/transport/filters/hash_sanitizer.rb
|
193
223
|
- lib/elastic_apm/transport/filters/secrets_filter.rb
|
194
224
|
- lib/elastic_apm/transport/headers.rb
|
195
225
|
- lib/elastic_apm/transport/serializers.rb
|
@@ -206,7 +236,6 @@ files:
|
|
206
236
|
- lib/elastic_apm/util/lru_cache.rb
|
207
237
|
- lib/elastic_apm/util/throttle.rb
|
208
238
|
- lib/elastic_apm/version.rb
|
209
|
-
- vendor/.gitkeep
|
210
239
|
homepage: https://github.com/elastic/apm-agent-ruby
|
211
240
|
licenses:
|
212
241
|
- Apache-2.0
|
data/.ci/downstreamTests.groovy
DELETED
@@ -1,185 +0,0 @@
|
|
1
|
-
#!/usr/bin/env groovy
|
2
|
-
@Library('apm@current') _
|
3
|
-
|
4
|
-
import co.elastic.matrix.*
|
5
|
-
import groovy.transform.Field
|
6
|
-
|
7
|
-
/**
|
8
|
-
This is the parallel tasks generator,
|
9
|
-
it is need as field to store the results of the tests.
|
10
|
-
*/
|
11
|
-
@Field def rubyTasksGen
|
12
|
-
|
13
|
-
pipeline {
|
14
|
-
agent { label 'linux && immutable' }
|
15
|
-
environment {
|
16
|
-
REPO="git@github.com:elastic/apm-agent-ruby.git"
|
17
|
-
BASE_DIR="src/github.com/elastic/apm-agent-ruby"
|
18
|
-
PIPELINE_LOG_LEVEL='INFO'
|
19
|
-
NOTIFY_TO = credentials('notify-to')
|
20
|
-
JOB_GCS_BUCKET = credentials('gcs-bucket')
|
21
|
-
JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
|
22
|
-
DOCKER_REGISTRY = 'docker.elastic.co'
|
23
|
-
DOCKER_SECRET = 'secret/apm-team/ci/docker-registry/prod'
|
24
|
-
CODECOV_SECRET = 'secret/apm-team/ci/apm-agent-ruby-codecov'
|
25
|
-
}
|
26
|
-
options {
|
27
|
-
timeout(time: 2, unit: 'HOURS')
|
28
|
-
buildDiscarder(logRotator(numToKeepStr: '300', artifactNumToKeepStr: '20', daysToKeepStr: '30'))
|
29
|
-
timestamps()
|
30
|
-
ansiColor('xterm')
|
31
|
-
disableResume()
|
32
|
-
durabilityHint('PERFORMANCE_OPTIMIZED')
|
33
|
-
rateLimitBuilds(throttle: [count: 60, durationName: 'hour', userBoost: true])
|
34
|
-
quietPeriod(10)
|
35
|
-
}
|
36
|
-
parameters {
|
37
|
-
string(name: 'RUBY_VERSION', defaultValue: "ruby:2.6", description: "Ruby version to test")
|
38
|
-
string(name: 'BRANCH_SPECIFIER', defaultValue: "master", description: "Git branch/tag to use")
|
39
|
-
}
|
40
|
-
stages {
|
41
|
-
/**
|
42
|
-
Checkout the code and stash it, to use it on other stages.
|
43
|
-
*/
|
44
|
-
stage('Checkout') {
|
45
|
-
options { skipDefaultCheckout() }
|
46
|
-
steps {
|
47
|
-
deleteDir()
|
48
|
-
gitCheckout(basedir: "${BASE_DIR}",
|
49
|
-
branch: "${params.BRANCH_SPECIFIER}",
|
50
|
-
repo: "${REPO}",
|
51
|
-
credentialsId: "${JOB_GIT_CREDENTIALS}")
|
52
|
-
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
|
53
|
-
}
|
54
|
-
}
|
55
|
-
stage('Test') {
|
56
|
-
options { skipDefaultCheckout() }
|
57
|
-
steps {
|
58
|
-
runTests('.ci/.jenkins_framework.yml')
|
59
|
-
}
|
60
|
-
}
|
61
|
-
stage('Master Test') {
|
62
|
-
options { skipDefaultCheckout() }
|
63
|
-
steps {
|
64
|
-
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: "The tests for the master framework have failed. Let's warn instead.") {
|
65
|
-
runTests('.ci/.jenkins_master_framework.yml')
|
66
|
-
}
|
67
|
-
}
|
68
|
-
}
|
69
|
-
}
|
70
|
-
post {
|
71
|
-
cleanup {
|
72
|
-
script{
|
73
|
-
if(rubyTasksGen?.results){
|
74
|
-
writeJSON(file: 'results.json', json: toJSON(rubyTasksGen.results), pretty: 2)
|
75
|
-
def mapResults = ["Ruby": rubyTasksGen.results]
|
76
|
-
def processor = new ResultsProcessor()
|
77
|
-
processor.processResults(mapResults)
|
78
|
-
archiveArtifacts allowEmptyArchive: true, artifacts: 'results.json,results.html', defaultExcludes: false
|
79
|
-
catchError(buildResult: 'SUCCESS') {
|
80
|
-
def datafile = readFile(file: "results.json")
|
81
|
-
def json = getVaultSecret(secret: 'secret/apm-team/ci/jenkins-stats-cloud')
|
82
|
-
sendDataToElasticsearch(es: json.data.url, data: datafile, restCall: '/jenkins-builds-ruby-test-results/_doc/')
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
86
|
-
notifyBuildResult()
|
87
|
-
}
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
/**
|
92
|
-
Parallel task generator for the integration tests.
|
93
|
-
*/
|
94
|
-
class RubyParallelTaskGenerator extends DefaultParallelTaskGenerator {
|
95
|
-
|
96
|
-
public RubyParallelTaskGenerator(Map params){
|
97
|
-
super(params)
|
98
|
-
}
|
99
|
-
|
100
|
-
/**
|
101
|
-
build a clousure that launch and agent and execute the corresponding test script,
|
102
|
-
then store the results.
|
103
|
-
*/
|
104
|
-
public Closure generateStep(x, y){
|
105
|
-
return {
|
106
|
-
steps.sleep steps.randomNumber(min:10, max: 30)
|
107
|
-
steps.node('linux && immutable'){
|
108
|
-
// Label is transformed to avoid using the internal docker registry in the x coordinate
|
109
|
-
// TODO: def label = "${tag}:${x?.drop(x?.lastIndexOf('/')+1)}#${y}"
|
110
|
-
def label = "${tag}:${x}#${y}"
|
111
|
-
try {
|
112
|
-
steps.runScript(label: label, ruby: x, framework: y)
|
113
|
-
saveResult(x, y, 1)
|
114
|
-
} catch(e){
|
115
|
-
saveResult(x, y, 0)
|
116
|
-
steps.error("${label} tests failed : ${e.toString()}\n")
|
117
|
-
} finally {
|
118
|
-
steps.junit(allowEmptyResults: true,
|
119
|
-
keepLongStdio: true,
|
120
|
-
testResults: "**/spec/junit-reports/**/ruby-agent-junit.xml")
|
121
|
-
if (steps.isCodecovEnabled(x, y)) {
|
122
|
-
steps.codecov(repo: "${steps.env.REPO}", basedir: "${steps.env.BASE_DIR}",
|
123
|
-
secret: "${steps.env.CODECOV_SECRET}")
|
124
|
-
}
|
125
|
-
}
|
126
|
-
}
|
127
|
-
}
|
128
|
-
}
|
129
|
-
}
|
130
|
-
|
131
|
-
/**
|
132
|
-
Run tests for a Ruby version and framework version.
|
133
|
-
*/
|
134
|
-
def runScript(Map params = [:]){
|
135
|
-
def label = params.label
|
136
|
-
def ruby = params.ruby
|
137
|
-
def framework = params.framework
|
138
|
-
log(level: 'INFO', text: "${label}")
|
139
|
-
env.HOME = "${env.WORKSPACE}"
|
140
|
-
env.PATH = "${env.PATH}:${env.WORKSPACE}/bin"
|
141
|
-
deleteDir()
|
142
|
-
unstash 'source'
|
143
|
-
dir("${BASE_DIR}"){
|
144
|
-
retry(2){
|
145
|
-
sleep randomNumber(min:10, max: 30)
|
146
|
-
dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
|
147
|
-
sh("./spec/scripts/spec.sh ${ruby} ${framework}")
|
148
|
-
}
|
149
|
-
}
|
150
|
-
}
|
151
|
-
|
152
|
-
/**
|
153
|
-
* Whether the given ruby version and framework are in charge of sending the
|
154
|
-
* codecov results. It does require the workspace.
|
155
|
-
*/
|
156
|
-
def isCodecovEnabled(ruby, framework){
|
157
|
-
dir(BASE_DIR){
|
158
|
-
def codecovVersions = readYaml(file: '.ci/.jenkins_codecov.yml')
|
159
|
-
return codecovVersions['ENABLED'].any { it.trim() == "${ruby?.trim()}#${framework?.trim()}" }
|
160
|
-
}
|
161
|
-
}
|
162
|
-
|
163
|
-
/**
|
164
|
-
Run all the tests for the given ruby version and file with the frameworks to test
|
165
|
-
*/
|
166
|
-
def runTests(frameworkFile) {
|
167
|
-
deleteDir()
|
168
|
-
unstash "source"
|
169
|
-
dir("${BASE_DIR}"){
|
170
|
-
script {
|
171
|
-
rubyTasksGen = new RubyParallelTaskGenerator(
|
172
|
-
xVersions: [ "${params.RUBY_VERSION}" ],
|
173
|
-
xKey: 'RUBY_VERSION',
|
174
|
-
yKey: 'FRAMEWORK',
|
175
|
-
yFile: frameworkFile,
|
176
|
-
exclusionFile: '.ci/.jenkins_exclude.yml',
|
177
|
-
tag: 'Ruby',
|
178
|
-
name: 'Ruby',
|
179
|
-
steps: this
|
180
|
-
)
|
181
|
-
def mapPatallelTasks = rubyTasksGen.generateParallelTests()
|
182
|
-
parallel(mapPatallelTasks)
|
183
|
-
}
|
184
|
-
}
|
185
|
-
}
|
data/.ci/prepare-git-context.sh
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
set -exo pipefail
|
3
|
-
|
4
|
-
# Enable git+ssh. Env variables are created on the fly with the gitCheckout
|
5
|
-
git config remote.origin.url "git@github.com:${ORG_NAME}/${REPO_NAME}.git"
|
6
|
-
|
7
|
-
# Enable to fetch branches when cloning with a detached and shallow clone
|
8
|
-
git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
|
9
|
-
|
10
|
-
# Force the git user details when pushing using the last commit details
|
11
|
-
USER_MAIL=$(git log -1 --pretty=format:'%ae')
|
12
|
-
USER_NAME=$(git log -1 --pretty=format:'%an')
|
13
|
-
git config --global user.email "${USER_MAIL}"
|
14
|
-
git config --global user.name "${USER_NAME}"
|
15
|
-
|
16
|
-
# Checkout the branch as it's detached based by default.
|
17
|
-
# See https://issues.jenkins-ci.org/browse/JENKINS-33171
|
18
|
-
git fetch --all
|
19
|
-
git checkout "${BRANCH_NAME}"
|
20
|
-
|
21
|
-
# Ensure the master branch points to the original commit to avoid commit injection
|
22
|
-
# when running the release pipeline.
|
23
|
-
# used GIT_BASE_COMMIT instead GIT_COMMIT to support the MultiBranchPipelines.
|
24
|
-
git reset --hard "${GIT_BASE_COMMIT}"
|
data/.github/workflows/main.yml
DELETED
data/CHANGELOG.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Release notes are now available in our documentation at ([elastic.co](https://www.elastic.co/guide/en/apm/agent/ruby/current/release-notes.html))
|