elastic-apm 3.6.0 → 3.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/Jenkinsfile +183 -100
- data/.ci/jobs/defaults.yml +1 -1
- data/.ci/packer_cache.sh +12 -10
- data/.rspec +0 -1
- data/.rubocop.yml +3 -0
- data/CHANGELOG.asciidoc +84 -0
- data/Gemfile +22 -1
- data/Rakefile +28 -1
- data/bin/run-tests +4 -1
- data/docker-compose.yml +2 -0
- data/docs/configuration.asciidoc +117 -16
- data/docs/debugging.asciidoc +14 -0
- data/docs/getting-started-rails.asciidoc +2 -0
- data/docs/images/dynamic-config.svg +1 -0
- data/docs/index.asciidoc +2 -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 +18 -1
- data/elastic-apm.gemspec +17 -0
- data/lib/elastic-apm.rb +17 -0
- data/lib/elastic_apm.rb +18 -1
- data/lib/elastic_apm/agent.rb +48 -2
- 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 +17 -0
- data/lib/elastic_apm/config.rb +52 -2
- 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 +18 -1
- data/lib/elastic_apm/config/regexp_list.rb +17 -0
- data/lib/elastic_apm/config/wildcard_pattern_list.rb +28 -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 +17 -0
- data/lib/elastic_apm/context/user.rb +17 -0
- data/lib/elastic_apm/context_builder.rb +18 -1
- 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 +17 -0
- data/lib/elastic_apm/grpc.rb +19 -2
- data/lib/elastic_apm/instrumenter.rb +29 -4
- 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 +22 -3
- data/lib/elastic_apm/metadata/system_info/container_info.rb +45 -4
- 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 +17 -0
- 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 +25 -2
- 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 +17 -0
- data/lib/elastic_apm/opentracing.rb +64 -23
- data/lib/elastic_apm/rails.rb +17 -0
- data/lib/elastic_apm/railtie.rb +17 -0
- data/lib/elastic_apm/resque.rb +17 -0
- data/lib/elastic_apm/sinatra.rb +17 -0
- data/lib/elastic_apm/span.rb +20 -2
- data/lib/elastic_apm/span/context.rb +17 -0
- data/lib/elastic_apm/span/context/db.rb +17 -0
- data/lib/elastic_apm/span/context/destination.rb +17 -0
- data/lib/elastic_apm/span/context/http.rb +17 -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/dynamo_db.rb +58 -0
- data/lib/elastic_apm/spies/elasticsearch.rb +37 -2
- data/lib/elastic_apm/spies/faraday.rb +17 -0
- data/lib/elastic_apm/spies/http.rb +17 -0
- data/lib/elastic_apm/spies/json.rb +17 -0
- data/lib/elastic_apm/spies/mongo.rb +18 -1
- data/lib/elastic_apm/spies/net_http.rb +23 -2
- 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 +19 -9
- data/lib/elastic_apm/spies/sequel.rb +18 -1
- data/lib/elastic_apm/spies/shoryuken.rb +17 -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 +17 -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 +17 -0
- data/lib/elastic_apm/sql/signature.rb +17 -0
- data/lib/elastic_apm/sql/tokenizer.rb +17 -0
- data/lib/elastic_apm/sql/tokens.rb +17 -0
- data/lib/elastic_apm/sql_summarizer.rb +17 -0
- data/lib/elastic_apm/stacktrace.rb +17 -0
- data/lib/elastic_apm/stacktrace/frame.rb +17 -0
- data/lib/elastic_apm/stacktrace_builder.rb +17 -0
- data/lib/elastic_apm/subscriber.rb +17 -0
- data/lib/elastic_apm/trace_context.rb +17 -0
- data/lib/elastic_apm/trace_context/traceparent.rb +17 -0
- data/lib/elastic_apm/trace_context/tracestate.rb +17 -0
- data/lib/elastic_apm/transaction.rb +33 -5
- 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 +22 -0
- 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 +30 -56
- data/lib/elastic_apm/transport/headers.rb +17 -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 +17 -0
- 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 +21 -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 +12 -11
- data/.ci/downstreamTests.groovy +0 -185
- data/.ci/prepare-git-context.sh +0 -27
- data/codecov.yml +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6db74de4a0201f5b5dd7e9f96b7ec383ce3276a56d7f9d57e64617dd7cf1a28
|
4
|
+
data.tar.gz: '0319a664e07b2411428134e24ed58f21049acf856cf163c6434fb66934e4cd1f'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bc1dfb374ea6107f07f690d764205f44c00a588eed767d7621b42640bf00f322d5e8b7c6a3d4958b0753b4755722836a05577fcee5b1a15207a355860a1f71b
|
7
|
+
data.tar.gz: 780227ecdd4592d5f3aaa87b54824b4ed36dc9686052b51314815ebbf3152855dc5ff186c69deb88b86f2eab1d7aa9e4170bfd1454b2fdca3ab82d513eb0280a
|
data/.ci/Jenkinsfile
CHANGED
@@ -5,21 +5,17 @@ import co.elastic.matrix.*
|
|
5
5
|
import groovy.transform.Field
|
6
6
|
|
7
7
|
/**
|
8
|
-
|
8
|
+
This is the parallel tasks generator,
|
9
|
+
it is need as field to store the results of the tests.
|
9
10
|
*/
|
10
|
-
@Field def
|
11
|
-
|
12
|
-
/**
|
13
|
-
This is required to store the build status for the downstream jobs.
|
14
|
-
*/
|
15
|
-
@Field def rubyDownstreamJobs = [:]
|
11
|
+
@Field def rubyTasksGen
|
16
12
|
|
17
13
|
pipeline {
|
18
14
|
agent { label 'linux && immutable' }
|
19
15
|
environment {
|
20
16
|
REPO = 'apm-agent-ruby'
|
21
17
|
BASE_DIR = "src/github.com/elastic/${env.REPO}"
|
22
|
-
PIPELINE_LOG_LEVEL='
|
18
|
+
PIPELINE_LOG_LEVEL = 'INFO'
|
23
19
|
NOTIFY_TO = credentials('notify-to')
|
24
20
|
JOB_GCS_BUCKET = credentials('gcs-bucket')
|
25
21
|
CODECOV_SECRET = 'secret/apm-team/ci/apm-agent-ruby-codecov'
|
@@ -42,7 +38,7 @@ pipeline {
|
|
42
38
|
quietPeriod(10)
|
43
39
|
}
|
44
40
|
triggers {
|
45
|
-
issueCommentTrigger('(?i).*(?:jenkins\\W+)?run\\W+(?:the\\W+)?tests(?:\\W+please)?.*')
|
41
|
+
issueCommentTrigger('(?i).*(?:jenkins\\W+)?run\\W+(?:the\\W+)?(?:benchmark\\W+)?tests(?:\\W+please)?.*')
|
46
42
|
}
|
47
43
|
parameters {
|
48
44
|
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.')
|
@@ -59,14 +55,23 @@ pipeline {
|
|
59
55
|
deleteDir()
|
60
56
|
gitCheckout(basedir: "${BASE_DIR}", githubNotifyFirstTimeContributor: true, reference: "${env.REFERENCE_REPO}")
|
61
57
|
stash allowEmpty: true, name: 'source', useDefaultExcludes: false
|
58
|
+
script {
|
59
|
+
dir("${BASE_DIR}"){
|
60
|
+
// Skip all the stages except docs for PR's with asciidoc and md changes only
|
61
|
+
env.ONLY_DOCS = isGitRegionMatch(patterns: [ '.*\\.(asciidoc|md)' ], shouldMatchAll: true)
|
62
|
+
}
|
63
|
+
}
|
62
64
|
}
|
63
65
|
}
|
64
66
|
stage('Sanity checks') {
|
65
67
|
when {
|
66
68
|
beforeAgent true
|
67
|
-
|
68
|
-
|
69
|
-
|
69
|
+
allOf {
|
70
|
+
expression { return env.ONLY_DOCS == "false" }
|
71
|
+
anyOf {
|
72
|
+
not { changeRequest() }
|
73
|
+
expression { return params.Run_As_Master_Branch }
|
74
|
+
}
|
70
75
|
}
|
71
76
|
}
|
72
77
|
options { skipDefaultCheckout() }
|
@@ -89,43 +94,53 @@ pipeline {
|
|
89
94
|
/**
|
90
95
|
Execute unit tests.
|
91
96
|
*/
|
92
|
-
stage('
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
97
|
+
stage('Tests') {
|
98
|
+
when {
|
99
|
+
beforeAgent true
|
100
|
+
expression { return env.ONLY_DOCS == "false" }
|
101
|
+
}
|
102
|
+
failFast false
|
103
|
+
parallel {
|
104
|
+
stage('Tests') {
|
105
|
+
options { skipDefaultCheckout() }
|
106
|
+
steps {
|
107
|
+
withGithubNotify(context: 'Tests', tab: 'tests') {
|
108
|
+
runTests('.ci/.jenkins_framework.yml')
|
109
|
+
}
|
110
|
+
}
|
111
|
+
post {
|
112
|
+
always {
|
113
|
+
convergeCoverage()
|
107
114
|
}
|
108
115
|
}
|
109
116
|
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
117
|
+
stage('Master Tests frameworks') {
|
118
|
+
options { skipDefaultCheckout() }
|
119
|
+
steps {
|
120
|
+
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE', message: "The tests for the master framework have failed. Let's warn instead.") {
|
121
|
+
runTests('.ci/.jenkins_master_framework.yml')
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
stage('Integration Tests') {
|
126
|
+
agent none
|
127
|
+
when {
|
128
|
+
beforeAgent true
|
129
|
+
anyOf {
|
130
|
+
changeRequest()
|
131
|
+
expression { return !params.Run_As_Master_Branch }
|
132
|
+
}
|
133
|
+
}
|
134
|
+
steps {
|
135
|
+
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('/','+')}")
|
136
|
+
build(job: env.ITS_PIPELINE, propagate: false, wait: true,
|
137
|
+
parameters: [ string(name: 'INTEGRATION_TEST', value: 'Ruby'),
|
138
|
+
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}"),
|
139
|
+
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_ITS_NAME),
|
140
|
+
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
|
141
|
+
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT) ])
|
142
|
+
}
|
119
143
|
}
|
120
|
-
}
|
121
|
-
steps {
|
122
|
-
build(job: env.ITS_PIPELINE, propagate: false, wait: false,
|
123
|
-
parameters: [string(name: 'INTEGRATION_TEST', value: 'Ruby'),
|
124
|
-
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}"),
|
125
|
-
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_ITS_NAME),
|
126
|
-
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
|
127
|
-
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT)])
|
128
|
-
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('/','+')}")
|
129
144
|
}
|
130
145
|
}
|
131
146
|
stage('Benchmarks') {
|
@@ -137,8 +152,9 @@ pipeline {
|
|
137
152
|
branch 'master'
|
138
153
|
branch "\\d+\\.\\d+"
|
139
154
|
branch "v\\d?"
|
140
|
-
tag
|
155
|
+
tag pattern: 'v\\d+.*', comparator: "REGEXP"
|
141
156
|
expression { return params.Run_As_Master_Branch }
|
157
|
+
expression { return env.GITHUB_COMMENT?.contains('benchmark tests') }
|
142
158
|
}
|
143
159
|
expression { return params.bench_ci }
|
144
160
|
}
|
@@ -179,20 +195,6 @@ pipeline {
|
|
179
195
|
}
|
180
196
|
}
|
181
197
|
}
|
182
|
-
stage('Populate Downstream failures') {
|
183
|
-
when {
|
184
|
-
expression { return rubyTasksFailed }
|
185
|
-
}
|
186
|
-
steps {
|
187
|
-
script {
|
188
|
-
def message = 'Failures when running the "Test" stage'
|
189
|
-
if (notifyBuildResult.isAnyDownstreamJobFailedWithTimeout(rubyDownstreamJobs)) {
|
190
|
-
message += ' related to a timeout issue'
|
191
|
-
}
|
192
|
-
error(message)
|
193
|
-
}
|
194
|
-
}
|
195
|
-
}
|
196
198
|
stage('Release') {
|
197
199
|
options { skipDefaultCheckout() }
|
198
200
|
environment {
|
@@ -238,7 +240,10 @@ pipeline {
|
|
238
240
|
steps {
|
239
241
|
deleteDir()
|
240
242
|
// Let's wait for the Gem to be available
|
241
|
-
sh
|
243
|
+
sh label: 'Wait for gem', script: """#!/usr/bin/env bash
|
244
|
+
source /usr/local/bin/bash_standard_lib.sh
|
245
|
+
(retry 10 curl --silent --show-error --fail -I https://rubygems.org/gems/elastic-apm/versions/${env.VERSION})
|
246
|
+
"""
|
242
247
|
dir("${OPBEANS_REPO}"){
|
243
248
|
git credentialsId: 'f6c7695a-671e-4f4f-a331-acdce44ff9ba',
|
244
249
|
url: "git@github.com:elastic/${OPBEANS_REPO}.git"
|
@@ -256,7 +261,7 @@ pipeline {
|
|
256
261
|
}
|
257
262
|
post {
|
258
263
|
cleanup {
|
259
|
-
notifyBuildResult(
|
264
|
+
notifyBuildResult()
|
260
265
|
}
|
261
266
|
}
|
262
267
|
}
|
@@ -271,26 +276,64 @@ def runBenchmark(version){
|
|
271
276
|
// - docker.elastic.co/observability-ci/jruby:9.2-12-jdk to jruby-9.2-12-jdk
|
272
277
|
// - jruby:9.1 to jruby-9.1
|
273
278
|
def transformedVersion = version.replaceAll('.*/', '').replaceAll(':', '-')
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
279
|
+
withEnv(["HOME=${env.WORKSPACE}/${transformedVersion}"]){
|
280
|
+
dir("${transformedVersion}"){
|
281
|
+
deleteDir()
|
282
|
+
unstash 'source'
|
283
|
+
dir("${BASE_DIR}"){
|
284
|
+
retry(2){
|
285
|
+
sleep randomNumber(min:10, max: 30)
|
286
|
+
dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
|
287
|
+
}
|
288
|
+
try{
|
289
|
+
sh """./spec/scripts/benchmarks.sh "${version}" "${REFERENCE_REPO}" """
|
290
|
+
} catch(e){
|
291
|
+
throw e
|
292
|
+
} finally {
|
293
|
+
archiveArtifacts(
|
294
|
+
allowEmptyArchive: true,
|
295
|
+
artifacts: "**/benchmark-${transformedVersion}.raw,**/benchmark-${transformedVersion}.error",
|
296
|
+
onlyIfSuccessful: false)
|
297
|
+
sendBenchmarks(file: "benchmark-${transformedVersion}.bulk",
|
298
|
+
index: "benchmark-ruby", archive: true)
|
299
|
+
}
|
282
300
|
}
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
301
|
+
}
|
302
|
+
}
|
303
|
+
}
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
class RubyParallelTaskGenerator extends DefaultParallelTaskGenerator {
|
308
|
+
|
309
|
+
public RubyParallelTaskGenerator(Map params){
|
310
|
+
super(params)
|
311
|
+
}
|
312
|
+
|
313
|
+
/**
|
314
|
+
build a clousure that launch and agent and execute the corresponding test script,
|
315
|
+
then store the results.
|
316
|
+
*/
|
317
|
+
public Closure generateStep(x, y){
|
318
|
+
return {
|
319
|
+
steps.sleep steps.randomNumber(min:10, max: 30)
|
320
|
+
steps.node('linux && immutable'){
|
321
|
+
// Label is transformed to avoid using the internal docker registry in the x coordinate
|
322
|
+
// TODO: def label = "${tag}:${x?.drop(x?.lastIndexOf('/')+1)}#${y}"
|
323
|
+
def label = "${tag}:${x}#${y}"
|
324
|
+
try {
|
325
|
+
steps.runScript(label: label, ruby: x, framework: y)
|
326
|
+
saveResult(x, y, 1)
|
327
|
+
} catch(e){
|
328
|
+
saveResult(x, y, 0)
|
329
|
+
steps.error("${label} tests failed : ${e.toString()}\n")
|
330
|
+
} finally {
|
331
|
+
steps.junit(allowEmptyResults: false,
|
332
|
+
keepLongStdio: true,
|
333
|
+
testResults: "**/spec/junit-reports/**/ruby-agent-junit.xml")
|
334
|
+
steps.dir("${steps.env.BASE_DIR}"){
|
335
|
+
steps.archiveArtifacts(artifacts: 'coverage/matrix_results/', defaultExcludes: false)
|
336
|
+
steps.stash(name: steps.normalise("coverage-${x}-${y}"), includes: 'coverage/matrix_results/', allowEmpty: true)
|
294
337
|
}
|
295
338
|
}
|
296
339
|
}
|
@@ -298,24 +341,58 @@ def runBenchmark(version){
|
|
298
341
|
}
|
299
342
|
}
|
300
343
|
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
344
|
+
/**
|
345
|
+
Run all the tests for the given file with the frameworks to test
|
346
|
+
*/
|
347
|
+
def runTests(frameworkFile) {
|
348
|
+
deleteDir()
|
349
|
+
unstash "source"
|
350
|
+
dir("${BASE_DIR}"){
|
351
|
+
rubyTasksGen = new RubyParallelTaskGenerator(
|
352
|
+
xKey: 'RUBY_VERSION',
|
353
|
+
yKey: 'FRAMEWORK',
|
354
|
+
xFile: ".ci/.jenkins_ruby.yml",
|
355
|
+
yFile: frameworkFile,
|
356
|
+
exclusionFile: ".ci/.jenkins_exclude.yml",
|
357
|
+
tag: "Ruby",
|
358
|
+
name: "Ruby",
|
359
|
+
steps: this
|
360
|
+
)
|
361
|
+
def testTasks = rubyTasksGen.generateParallelTests()
|
362
|
+
parallel(testTasks)
|
363
|
+
}
|
364
|
+
}
|
365
|
+
|
366
|
+
/**
|
367
|
+
Run tests for a Ruby version and framework version.
|
368
|
+
*/
|
369
|
+
def runScript(Map params = [:]){
|
370
|
+
def label = params.label
|
371
|
+
def ruby = params.ruby
|
372
|
+
def framework = params.framework
|
373
|
+
log(level: 'INFO', text: "${label}")
|
374
|
+
retry(2){
|
375
|
+
withEnv(["HOME=${env.WORKSPACE}", "PATH=${env.PATH}:${env.WORKSPACE}/bin"]) {
|
376
|
+
deleteDir()
|
377
|
+
unstash 'source'
|
378
|
+
dir("${BASE_DIR}"){
|
379
|
+
sleep randomNumber(min:10, max: 30)
|
380
|
+
dockerLogin(secret: "${DOCKER_SECRET}", registry: "${DOCKER_REGISTRY}")
|
381
|
+
sh("./spec/scripts/spec.sh ${ruby} ${framework}")
|
382
|
+
}
|
383
|
+
}
|
384
|
+
}
|
385
|
+
}
|
386
|
+
|
387
|
+
def convergeCoverage() {
|
388
|
+
deleteDir()
|
389
|
+
unstash('source')
|
390
|
+
dir("${BASE_DIR}"){
|
391
|
+
rubyTasksGen.dumpMatrix('-')?.each {
|
392
|
+
unstash(normalise("coverage-${it}"))
|
316
393
|
}
|
317
|
-
|
318
|
-
|
394
|
+
sh(script: './spec/scripts/coverage_converge.sh')
|
395
|
+
cobertura coberturaReportFile: 'coverage/coverage.xml', onlyStable: false
|
319
396
|
}
|
320
397
|
}
|
321
398
|
|
@@ -324,8 +401,7 @@ def prepareRelease(Closure body){
|
|
324
401
|
docker.image("${env.RUBY_DOCKER_TAG}").inside('-v ${REFERENCE_REPO}:${REFERENCE_REPO} -v /etc/passwd:/etc/passwd -v ${HOME}/.ssh:${HOME}/.ssh') {
|
325
402
|
withEnv(["HOME=${env.WORKSPACE}/${env.BASE_DIR ?: ''}"]) {
|
326
403
|
rubygemsLogin.withApi(secret: "${env.RELEASE_SECRET}") {
|
327
|
-
|
328
|
-
sh '.ci/prepare-git-context.sh'
|
404
|
+
withGitRelease(credentialsId: '2a9602aa-ab9f-4e52-baf3-b71ca88469c7-UserAndToken') {
|
329
405
|
sh 'gem install rake yard rspec'
|
330
406
|
body()
|
331
407
|
}
|
@@ -334,3 +410,10 @@ def prepareRelease(Closure body){
|
|
334
410
|
}
|
335
411
|
}
|
336
412
|
}
|
413
|
+
|
414
|
+
// Transform the versions like:
|
415
|
+
// - docker.elastic.co/observability-ci/jruby:9.2-12-jdk to jruby-9.2-12-jdk
|
416
|
+
// - jruby:9.1 to jruby-9.1
|
417
|
+
def normalise(def what) {
|
418
|
+
return what.replaceAll('.*/', '').replaceAll(':', '-')
|
419
|
+
}
|
data/.ci/jobs/defaults.yml
CHANGED
data/.ci/packer_cache.sh
CHANGED
@@ -2,13 +2,15 @@
|
|
2
2
|
|
3
3
|
source /usr/local/bin/bash_standard_lib.sh
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
if [ -x "$(command -v docker)" ]; then
|
6
|
+
grep "-" .ci/.jenkins_ruby.yml | grep -v 'observability-ci' | cut -d'-' -f2- | \
|
7
|
+
while read -r version;
|
8
|
+
do
|
9
|
+
transformedName=${version/:/-}
|
10
|
+
transformedVersion=$(echo "${version}" | cut -d":" -f2)
|
11
|
+
imageName="apm-agent-ruby"
|
12
|
+
registryImageName="docker.elastic.co/observability-ci/${imageName}:${transformedName}"
|
13
|
+
(retry 2 docker pull "${registryImageName}")
|
14
|
+
docker tag "${registryImageName}" "${imageName}:${transformedVersion}"
|
15
|
+
done
|
16
|
+
fi
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
data/CHANGELOG.asciidoc
CHANGED
@@ -35,6 +35,90 @@ endif::[]
|
|
35
35
|
[[release-notes-3.x]]
|
36
36
|
=== Ruby Agent version 3.x
|
37
37
|
|
38
|
+
[[release-notes-3.10.1]]
|
39
|
+
==== 3.10.1 (2020-08-26)
|
40
|
+
|
41
|
+
[float]
|
42
|
+
===== Fixed
|
43
|
+
|
44
|
+
- Remove secrets from cookies in errors {pull}863[#863]
|
45
|
+
|
46
|
+
[[release-notes-3.10.0]]
|
47
|
+
==== 3.10.0 (2020-08-26)
|
48
|
+
|
49
|
+
[float]
|
50
|
+
===== Added
|
51
|
+
|
52
|
+
- Config option `transaction_ignore_urls` to replace `ignore_url_patterns` {pull}844[#844]
|
53
|
+
- Prepend `(?-i)` to patterns to make them case-sensitive {pull}846[#846]
|
54
|
+
|
55
|
+
[float]
|
56
|
+
===== Fixed
|
57
|
+
|
58
|
+
- Reverted {pull}839[#839]
|
59
|
+
- Improved Kubernetes pod ID detection {pull}859[#859]
|
60
|
+
|
61
|
+
[[release-notes-3.9.0]]
|
62
|
+
==== 3.9.0 (2020-08-04)
|
63
|
+
|
64
|
+
[float]
|
65
|
+
===== Fixed
|
66
|
+
- Scrub request body of illegal UTF-8 characters {pull}832[#832]
|
67
|
+
|
68
|
+
[float]
|
69
|
+
===== Added
|
70
|
+
|
71
|
+
- Support for DynamoDB {pull}827[#827]
|
72
|
+
|
73
|
+
[float]
|
74
|
+
===== Fixed
|
75
|
+
|
76
|
+
- Fix Rails Engine views' paths being reported as absolute {pull}839[#839]
|
77
|
+
- Fix an issue when using Elasticsearch spy without a running agent {pull}830[#830]
|
78
|
+
|
79
|
+
[[release-notes-3.8.0]]
|
80
|
+
==== 3.8.0 (2020-06-18)
|
81
|
+
|
82
|
+
[float]
|
83
|
+
===== Added
|
84
|
+
|
85
|
+
- Add the option `capture_elasticsearch_queries` {pull}789[#789]
|
86
|
+
- Add option to skip patching Kernal#require {pull}812[#812]
|
87
|
+
- Add option `service_node_name` {pull}820[#820]
|
88
|
+
|
89
|
+
[float]
|
90
|
+
===== Fixed
|
91
|
+
|
92
|
+
- Allow underscores in hostnames in Net::HTTP spy {pull}804[#804]
|
93
|
+
- Don't change log level on logger object via remote config {pull}809[#809]
|
94
|
+
- Update and fix the Opentracing bridge {pull}791[#791]
|
95
|
+
|
96
|
+
[[release-notes-3.7.0]]
|
97
|
+
==== 3.7.0 (2020-05-14)
|
98
|
+
|
99
|
+
[float]
|
100
|
+
===== Changed
|
101
|
+
|
102
|
+
- Make config values dynamic so they can be changed via the remote config {pull}747[#747]
|
103
|
+
- Log the updated options from central config in addition to cumulative modifications {pull}758[#758]
|
104
|
+
|
105
|
+
[float]
|
106
|
+
===== Fixed
|
107
|
+
|
108
|
+
- Ensure that the log level is updated for the config's logger when value is changed {pull}755[#755]
|
109
|
+
- Set config `false` values to `false`, not `nil` {pull}761[#761]
|
110
|
+
- Ensure that the previously running agent's config is used in `ElasticAPM.restart` {pull}763[#763]
|
111
|
+
- Handle the Resque spy's payload class value being a String or Class and update docs {pull}768[#768]
|
112
|
+
- Add finalizer on ProxyPipe::Write so Zlib::GzipWriter is properly closed {pull}787[#787]
|
113
|
+
|
114
|
+
[float]
|
115
|
+
===== Added
|
116
|
+
|
117
|
+
- Add enabled config option, replacing active {pull}669[#669]
|
118
|
+
- Add recording config option {pull}765[#765]
|
119
|
+
- Add support for `SuckerPunch` {pull}775[#775]
|
120
|
+
- Support forking: Detect forking and restart agent tasks and background threads {pull}783[#783]
|
121
|
+
|
38
122
|
[[release-notes-3.6.0]]
|
39
123
|
==== 3.6.0 (2020-03-10)
|
40
124
|
|