elastic-apm 4.6.1 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ci/.exclude.yml +193 -0
- data/.ci/.main_framework.yml +4 -0
- data/.ci/.ruby.yml +10 -0
- data/.ci/docker/jruby/11-jdk/Dockerfile +5 -3
- data/.ci/docker/jruby/12-jdk/Dockerfile +2 -2
- data/.ci/docker/jruby/13-jdk/Dockerfile +2 -2
- data/.ci/docker/jruby/7-jdk/Dockerfile +3 -3
- data/.ci/docker/jruby/8-jdk/Dockerfile +5 -3
- data/.ci/docker/jruby/README.md +1 -1
- data/.ci/docker/jruby/run.sh +33 -9
- data/.ci/docker/jruby/test.sh +17 -2
- data/.ci/scripts/bench.sh +52 -0
- data/.ci/scripts/install-build-system.sh +5 -0
- data/.ci/snapshoty.yml +2 -3
- data/.ci/updatecli.d/update-gherkin-specs.yml +117 -0
- data/.ci/updatecli.d/update-json-specs.yml +121 -0
- data/.github/workflows/ci-docs.yml +20 -0
- data/.github/workflows/ci.yml +70 -0
- data/.github/workflows/coverage-reporter.yml +34 -0
- data/.github/workflows/microbenchmark.yml +48 -0
- data/.github/workflows/opentelemetry.yml +27 -0
- data/.github/workflows/release.yml +71 -0
- data/.github/workflows/run-matrix.yml +56 -0
- data/.github/workflows/snapshoty.yml +35 -0
- data/.github/workflows/test-reporter.yml +24 -0
- data/.github/workflows/{update-specs.yml → updatecli.yml} +2 -4
- data/.pre-commit-config.yaml +0 -2
- data/CHANGELOG.asciidoc +19 -1
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +6 -2
- data/README.md +1 -1
- data/Rakefile +2 -2
- data/bench/rubyprof.rb +1 -0
- data/bin/run-tests +10 -1
- data/docker-compose.yml +4 -1
- data/docs/configuration.asciidoc +6 -5
- data/docs/index.asciidoc +2 -2
- data/docs/{log-correlation.asciidoc → logs.asciidoc} +29 -2
- data/docs/opentracing.asciidoc +1 -1
- data/docs/redirects.asciidoc +9 -0
- data/lib/elastic_apm/context_builder.rb +3 -3
- data/lib/elastic_apm/metrics.rb +24 -20
- data/lib/elastic_apm/span_helpers.rb +6 -6
- data/lib/elastic_apm/spies/faraday.rb +13 -27
- data/lib/elastic_apm/version.rb +1 -1
- metadata +24 -19
- data/.ci/.jenkins_exclude.yml +0 -191
- data/.ci/.jenkins_main_framework.yml +0 -4
- data/.ci/.jenkins_ruby.yml +0 -10
- data/.ci/.jenkins_ruby_benchmarks.yml +0 -6
- data/.ci/Jenkinsfile +0 -450
- data/.ci/jobs/apm-agent-ruby-downstream.yml +0 -38
- data/.ci/jobs/apm-agent-ruby-linting-mbp.yml +0 -39
- data/.ci/jobs/apm-agent-ruby-mbp.yml +0 -43
- data/.ci/jobs/apm-agent-ruby.yml +0 -4
- data/.ci/jobs/defaults.yml +0 -24
- data/.ci/linting.groovy +0 -32
- data/.ci/packer_cache.sh +0 -16
- /data/.ci/{.jenkins_codecov.yml → .codecov.yml} +0 -0
- /data/.ci/{.jenkins_framework.yml → .framework.yml} +0 -0
- /data/.ci/{update-specs.yml → updatecli.d/update-specs.yml} +0 -0
@@ -0,0 +1,121 @@
|
|
1
|
+
name: update-json-specs
|
2
|
+
pipelineid: update-json-specs
|
3
|
+
title: synchronize json specs
|
4
|
+
|
5
|
+
scms:
|
6
|
+
default:
|
7
|
+
kind: github
|
8
|
+
spec:
|
9
|
+
user: '{{ requiredEnv "GIT_USER" }}'
|
10
|
+
email: '{{ requiredEnv "GIT_EMAIL" }}'
|
11
|
+
owner: elastic
|
12
|
+
repository: apm-agent-ruby
|
13
|
+
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
|
14
|
+
username: '{{ requiredEnv "GIT_USER" }}'
|
15
|
+
branch: main
|
16
|
+
|
17
|
+
sources:
|
18
|
+
sha:
|
19
|
+
kind: file
|
20
|
+
spec:
|
21
|
+
file: 'https://github.com/elastic/apm/commit/main.patch'
|
22
|
+
matchpattern: "^From\\s([0-9a-f]{40})\\s"
|
23
|
+
transformers:
|
24
|
+
- findsubmatch:
|
25
|
+
pattern: "[0-9a-f]{40}"
|
26
|
+
|
27
|
+
container_metadata_discovery.json:
|
28
|
+
kind: file
|
29
|
+
spec:
|
30
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/container_metadata_discovery.json
|
31
|
+
service_resource_inference.json:
|
32
|
+
kind: file
|
33
|
+
spec:
|
34
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/service_resource_inference.json
|
35
|
+
span_types.json:
|
36
|
+
kind: file
|
37
|
+
spec:
|
38
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/span_types.json
|
39
|
+
sql_signature_examples.json:
|
40
|
+
kind: file
|
41
|
+
spec:
|
42
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/sql_signature_examples.json
|
43
|
+
sql_token_examples.json:
|
44
|
+
kind: file
|
45
|
+
spec:
|
46
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/sql_token_examples.json
|
47
|
+
w3c_distributed_tracing.json:
|
48
|
+
kind: file
|
49
|
+
spec:
|
50
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/w3c_distributed_tracing.json
|
51
|
+
wildcard_matcher_tests.json:
|
52
|
+
kind: file
|
53
|
+
spec:
|
54
|
+
file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/wildcard_matcher_tests.json
|
55
|
+
actions:
|
56
|
+
pr:
|
57
|
+
kind: "github/pullrequest"
|
58
|
+
scmid: default
|
59
|
+
title: '[Automation] Update JSON specs'
|
60
|
+
spec:
|
61
|
+
automerge: false
|
62
|
+
draft: false
|
63
|
+
labels:
|
64
|
+
- "automation"
|
65
|
+
description: |-
|
66
|
+
### What
|
67
|
+
APM agent specs automatic sync
|
68
|
+
### Why
|
69
|
+
*Changeset*
|
70
|
+
* https://github.com/elastic/apm/commit/{{ source "sha" }}
|
71
|
+
|
72
|
+
targets:
|
73
|
+
container_metadata_discovery.json:
|
74
|
+
name: container_metadata_discovery.json
|
75
|
+
scmid: default
|
76
|
+
sourceid: container_metadata_discovery.json
|
77
|
+
kind: file
|
78
|
+
spec:
|
79
|
+
file: spec/fixtures/container_metadata_discovery.json
|
80
|
+
service_resource_inference.json:
|
81
|
+
name: service_resource_inference.json
|
82
|
+
scmid: default
|
83
|
+
sourceid: service_resource_inference.json
|
84
|
+
kind: file
|
85
|
+
spec:
|
86
|
+
file: spec/fixtures/service_resource_inference.json
|
87
|
+
span_types.json:
|
88
|
+
name: span_types.json
|
89
|
+
scmid: default
|
90
|
+
sourceid: span_types.json
|
91
|
+
kind: file
|
92
|
+
spec:
|
93
|
+
file: spec/fixtures/span_types.json
|
94
|
+
sql_signature_examples.json:
|
95
|
+
name: sql_signature_examples.json
|
96
|
+
scmid: default
|
97
|
+
sourceid: sql_signature_examples.json
|
98
|
+
kind: file
|
99
|
+
spec:
|
100
|
+
file: spec/fixtures/sql_signature_examples.json
|
101
|
+
sql_token_examples.json:
|
102
|
+
name: sql_token_examples.json
|
103
|
+
scmid: default
|
104
|
+
sourceid: sql_token_examples.json
|
105
|
+
kind: file
|
106
|
+
spec:
|
107
|
+
file: spec/fixtures/sql_token_examples.json
|
108
|
+
w3c_distributed_tracing.json:
|
109
|
+
name: w3c_distributed_tracing.json
|
110
|
+
scmid: default
|
111
|
+
sourceid: w3c_distributed_tracing.json
|
112
|
+
kind: file
|
113
|
+
spec:
|
114
|
+
file: spec/fixtures/w3c_distributed_tracing.json
|
115
|
+
wildcard_matcher_tests.json:
|
116
|
+
name: wildcard_matcher_tests.json
|
117
|
+
scmid: default
|
118
|
+
sourceid: wildcard_matcher_tests.json
|
119
|
+
kind: file
|
120
|
+
spec:
|
121
|
+
file: spec/fixtures/wildcard_matcher_tests.json
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
# This workflow sets the test / all status check to success in case it's a docs only PR and ci.yml is not triggered
|
3
|
+
# https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/troubleshooting-required-status-checks#handling-skipped-but-required-checks
|
4
|
+
name: ci # The name must be the same as in ci.yml
|
5
|
+
|
6
|
+
on:
|
7
|
+
pull_request:
|
8
|
+
paths-ignore: # This expression needs to match the paths ignored on ci.yml.
|
9
|
+
- '**'
|
10
|
+
- '!**/*.md'
|
11
|
+
- '!**/*.asciidoc'
|
12
|
+
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
all:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
steps:
|
20
|
+
- run: 'echo "No build required"'
|
@@ -0,0 +1,70 @@
|
|
1
|
+
name: ci
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
paths-ignore:
|
6
|
+
- "**/*.asciidoc"
|
7
|
+
- "**/*.md"
|
8
|
+
push:
|
9
|
+
branches:
|
10
|
+
- main
|
11
|
+
paths-ignore:
|
12
|
+
- "**/*.asciidoc"
|
13
|
+
- "**/*.md"
|
14
|
+
|
15
|
+
permissions:
|
16
|
+
contents: read
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
sanity-checks:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
steps:
|
22
|
+
- uses: elastic/apm-pipeline-library/.github/actions/pre-commit@current
|
23
|
+
|
24
|
+
# Invokes the actual matrix workflow with the provided files.
|
25
|
+
matrix:
|
26
|
+
uses: ./.github/workflows/run-matrix.yml
|
27
|
+
with:
|
28
|
+
versionsFile: .ci/.ruby.yml
|
29
|
+
frameworksFile: .ci/.framework.yml
|
30
|
+
excludedFile: .ci/.exclude.yml
|
31
|
+
|
32
|
+
# Invokes the actual matrix workflow with the provided files.
|
33
|
+
# In this case it's for the main frameworks.
|
34
|
+
matrix-main-frameworks:
|
35
|
+
uses: ./.github/workflows/run-matrix.yml
|
36
|
+
with:
|
37
|
+
versionsFile: .ci/.ruby.yml
|
38
|
+
frameworksFile: .ci/.main_framework.yml
|
39
|
+
excludedFile: .ci/.exclude.yml
|
40
|
+
|
41
|
+
package:
|
42
|
+
runs-on: ubuntu-latest
|
43
|
+
steps:
|
44
|
+
- uses: actions/checkout@v3
|
45
|
+
- uses: ruby/setup-ruby@v1
|
46
|
+
with:
|
47
|
+
ruby-version: 2.6
|
48
|
+
- name: Install build system
|
49
|
+
run: .ci/scripts/install-build-system.sh
|
50
|
+
- name: Create gem
|
51
|
+
run: rake build
|
52
|
+
- uses: actions/upload-artifact@v3
|
53
|
+
with:
|
54
|
+
name: package
|
55
|
+
path: ./pkg/**/*
|
56
|
+
|
57
|
+
all:
|
58
|
+
if: always()
|
59
|
+
runs-on: ubuntu-latest
|
60
|
+
needs:
|
61
|
+
- sanity-checks
|
62
|
+
- matrix
|
63
|
+
- matrix-main-frameworks
|
64
|
+
- package
|
65
|
+
steps:
|
66
|
+
- id: check
|
67
|
+
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
|
68
|
+
with:
|
69
|
+
needs: ${{ toJSON(needs) }}
|
70
|
+
- run: ${{ steps.check.outputs.isSuccess }}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
---
|
2
|
+
## Workflow to process coverage report
|
3
|
+
## For now the coverage is not reported. This workflow is just here as preparation for
|
4
|
+
## https://github.com/elastic/observability-robots/issues/1546
|
5
|
+
name: coverage-reporter
|
6
|
+
on:
|
7
|
+
workflow_run:
|
8
|
+
workflows:
|
9
|
+
- test
|
10
|
+
types:
|
11
|
+
- completed
|
12
|
+
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
report:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v3
|
21
|
+
- name: Download artifacts
|
22
|
+
run: >
|
23
|
+
gh run download ${{ github.event.workflow_run.id }}
|
24
|
+
--name coverage
|
25
|
+
--repo "${GITHUB_REPOSITORY}"
|
26
|
+
--dir coverage
|
27
|
+
env:
|
28
|
+
GH_TOKEN: ${{ github.token }}
|
29
|
+
- run: ls -l coverage/matrix_results
|
30
|
+
# - run: ./spec/scripts/coverage_converge.sh
|
31
|
+
# - uses: actions/upload-artifact@v3
|
32
|
+
# with:
|
33
|
+
# name: coverage-report
|
34
|
+
# path: coverage/coverage.xml
|
@@ -0,0 +1,48 @@
|
|
1
|
+
name: microbenchmark
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- main
|
8
|
+
paths-ignore:
|
9
|
+
- '**.md'
|
10
|
+
- '**.asciidoc'
|
11
|
+
|
12
|
+
# limit the access of the generated GITHUB_TOKEN
|
13
|
+
permissions:
|
14
|
+
contents: read
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
microbenchmark:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
# wait up to 1 hour
|
20
|
+
timeout-minutes: 60
|
21
|
+
steps:
|
22
|
+
- id: buildkite
|
23
|
+
name: Run buildkite pipeline
|
24
|
+
uses: elastic/apm-pipeline-library/.github/actions/buildkite@current
|
25
|
+
with:
|
26
|
+
vaultUrl: ${{ secrets.VAULT_ADDR }}
|
27
|
+
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
|
28
|
+
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
|
29
|
+
pipeline: apm-agent-microbenchmark
|
30
|
+
triggerMessage: "${{ github.repository }}@${{ github.ref_name }}"
|
31
|
+
waitFor: true
|
32
|
+
printBuildLogs: true
|
33
|
+
buildEnvVars: |
|
34
|
+
script=.ci/scripts/bench.sh
|
35
|
+
repo=apm-agent-ruby
|
36
|
+
sha=${{ github.sha }}
|
37
|
+
BRANCH_NAME=${{ github.ref_name }}
|
38
|
+
|
39
|
+
- if: ${{ failure() }}
|
40
|
+
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
|
41
|
+
with:
|
42
|
+
url: ${{ secrets.VAULT_ADDR }}
|
43
|
+
roleId: ${{ secrets.VAULT_ROLE_ID }}
|
44
|
+
secretId: ${{ secrets.VAULT_SECRET_ID }}
|
45
|
+
channel: "#apm-agent-ruby"
|
46
|
+
message: |
|
47
|
+
:ghost: [${{ github.repository }}] microbenchmark *${{ github.ref_name }}* failed to run in Buildkite.
|
48
|
+
Build: (<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>)
|
@@ -0,0 +1,27 @@
|
|
1
|
+
---
|
2
|
+
name: OpenTelemetry Export Trace
|
3
|
+
|
4
|
+
on:
|
5
|
+
workflow_run:
|
6
|
+
workflows:
|
7
|
+
- Auto Assign to Project(s)
|
8
|
+
- Issue Labeler
|
9
|
+
- ci
|
10
|
+
- coverage-reporter
|
11
|
+
- microbenchmark
|
12
|
+
- release
|
13
|
+
- run-matrix
|
14
|
+
- snapshoty
|
15
|
+
- test-reporter
|
16
|
+
- updatecli
|
17
|
+
types: [completed]
|
18
|
+
|
19
|
+
jobs:
|
20
|
+
otel-export-trace:
|
21
|
+
runs-on: ubuntu-latest
|
22
|
+
steps:
|
23
|
+
- uses: elastic/apm-pipeline-library/.github/actions/opentelemetry@current
|
24
|
+
with:
|
25
|
+
vaultUrl: ${{ secrets.VAULT_ADDR }}
|
26
|
+
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
|
27
|
+
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
name: release
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v[0-9]+*"
|
7
|
+
|
8
|
+
permissions:
|
9
|
+
contents: write
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
release:
|
13
|
+
runs-on: ubuntu-latest
|
14
|
+
steps:
|
15
|
+
- uses: actions/checkout@v3
|
16
|
+
- uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
ruby-version: 2.6
|
19
|
+
- uses: hashicorp/vault-action@v2.4.2
|
20
|
+
with:
|
21
|
+
url: ${{ secrets.VAULT_ADDR }}
|
22
|
+
method: approle
|
23
|
+
roleId: ${{ secrets.VAULT_ROLE_ID }}
|
24
|
+
secretId: ${{ secrets.VAULT_SECRET_ID }}
|
25
|
+
secrets: |
|
26
|
+
secret/apm-team/ci/apm-agent-ruby-rubygems-release apiKey | API_KEY ;
|
27
|
+
- name: RubyGems login
|
28
|
+
run: |
|
29
|
+
RUBY_HOME="${HOME}/.gem"
|
30
|
+
RUBY_CREDENTIALS_FILE="${RUBY_HOME}/credentials"
|
31
|
+
mkdir -p "${RUBY_HOME}"
|
32
|
+
echo '---' > "${RUBY_CREDENTIALS_FILE}"
|
33
|
+
echo ":rubygems_api_key: ${API_KEY}" >> "${RUBY_CREDENTIALS_FILE}"
|
34
|
+
chmod 0600 "${RUBY_CREDENTIALS_FILE}"
|
35
|
+
- name: Install build system
|
36
|
+
run: .ci/scripts/install-build-system.sh
|
37
|
+
- run: rake release
|
38
|
+
update-branch:
|
39
|
+
needs:
|
40
|
+
- release
|
41
|
+
runs-on: ubuntu-latest
|
42
|
+
steps:
|
43
|
+
- uses: actions/checkout@v3
|
44
|
+
- uses: ruby/setup-ruby@v1
|
45
|
+
with:
|
46
|
+
ruby-version: 2.6
|
47
|
+
- name: Setup Git
|
48
|
+
uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
|
49
|
+
- name: Install build system
|
50
|
+
run: .ci/scripts/install-build-system.sh
|
51
|
+
- run: rake release:update_branch
|
52
|
+
|
53
|
+
status:
|
54
|
+
if: always()
|
55
|
+
runs-on: ubuntu-latest
|
56
|
+
needs:
|
57
|
+
- release
|
58
|
+
- update-branch
|
59
|
+
steps:
|
60
|
+
- id: check
|
61
|
+
uses: elastic/apm-pipeline-library/.github/actions/check-dependent-jobs@current
|
62
|
+
with:
|
63
|
+
needs: ${{ toJSON(needs) }}
|
64
|
+
- run: ${{ steps.check.outputs.isSuccess }}
|
65
|
+
- if: always()
|
66
|
+
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
|
67
|
+
with:
|
68
|
+
vaultUrl: ${{ secrets.VAULT_ADDR }}
|
69
|
+
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
|
70
|
+
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
|
71
|
+
slackChannel: "#apm-agent-ruby"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
# Runs the tests based on the provided files in ci.yml
|
3
|
+
name: run-matrix
|
4
|
+
|
5
|
+
on:
|
6
|
+
workflow_call:
|
7
|
+
inputs:
|
8
|
+
versionsFile:
|
9
|
+
required: true
|
10
|
+
type: string
|
11
|
+
frameworksFile:
|
12
|
+
required: true
|
13
|
+
type: string
|
14
|
+
excludedFile:
|
15
|
+
required: true
|
16
|
+
type: string
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
create-test-matrix:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
outputs:
|
22
|
+
matrix: ${{ steps.generate.outputs.matrix }}
|
23
|
+
steps:
|
24
|
+
- uses: actions/checkout@v3
|
25
|
+
- id: generate
|
26
|
+
uses: elastic/apm-pipeline-library/.github/actions/version-framework@current
|
27
|
+
with:
|
28
|
+
versionsFile: ${{ inputs.versionsFile }}
|
29
|
+
frameworksFile: ${{ inputs.frameworksFile }}
|
30
|
+
excludedFile: ${{ inputs.excludedFile }}
|
31
|
+
test:
|
32
|
+
needs:
|
33
|
+
- create-test-matrix
|
34
|
+
runs-on: ubuntu-latest
|
35
|
+
strategy:
|
36
|
+
fail-fast: false
|
37
|
+
max-parallel: 20
|
38
|
+
matrix: ${{ fromJSON(needs.create-test-matrix.outputs.matrix) }}
|
39
|
+
steps:
|
40
|
+
- uses: actions/checkout@v3
|
41
|
+
- name: Run BDD tests
|
42
|
+
run: ./spec/scripts/features.sh ${{ matrix.version }}
|
43
|
+
- name: Run test
|
44
|
+
run: ./spec/scripts/spec.sh ${{ matrix.version }} ${{ matrix.framework }}
|
45
|
+
env:
|
46
|
+
JUNIT_PREFIX: ${{ matrix.version }}-${{ matrix.framework }}
|
47
|
+
- if: success() || failure()
|
48
|
+
uses: actions/upload-artifact@v3
|
49
|
+
with:
|
50
|
+
name: test-results
|
51
|
+
path: "**/spec/junit-reports/**/*ruby-agent-junit.xml"
|
52
|
+
- if: success() || failure()
|
53
|
+
uses: actions/upload-artifact@v3
|
54
|
+
with:
|
55
|
+
name: coverage
|
56
|
+
path: "coverage/"
|
@@ -0,0 +1,35 @@
|
|
1
|
+
name: snapshoty
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_run:
|
5
|
+
workflows:
|
6
|
+
- ci
|
7
|
+
types:
|
8
|
+
- completed
|
9
|
+
branches:
|
10
|
+
- main
|
11
|
+
|
12
|
+
permissions:
|
13
|
+
contents: read
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
publish:
|
17
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
steps:
|
20
|
+
- uses: actions/checkout@v3
|
21
|
+
- name: Download artifacts
|
22
|
+
run: >
|
23
|
+
gh run download ${{ github.event.workflow_run.id }}
|
24
|
+
--name package
|
25
|
+
--repo "${GITHUB_REPOSITORY}"
|
26
|
+
--dir pkg
|
27
|
+
env:
|
28
|
+
GH_TOKEN: ${{ github.token }}
|
29
|
+
- name: Publish snapshot
|
30
|
+
uses: elastic/apm-pipeline-library/.github/actions/snapshoty-simple@current
|
31
|
+
with:
|
32
|
+
config: '.ci/snapshoty.yml'
|
33
|
+
vaultUrl: ${{ secrets.VAULT_ADDR }}
|
34
|
+
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
|
35
|
+
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
## Workflow to process the JUnit test results and add a report to the checks.
|
3
|
+
name: test-reporter
|
4
|
+
on:
|
5
|
+
workflow_run:
|
6
|
+
workflows:
|
7
|
+
- ci
|
8
|
+
types:
|
9
|
+
- completed
|
10
|
+
|
11
|
+
permissions:
|
12
|
+
contents: read
|
13
|
+
checks: write
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
report:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
steps:
|
19
|
+
- uses: elastic/apm-pipeline-library/.github/actions/test-report@current
|
20
|
+
with:
|
21
|
+
artifact: test-results
|
22
|
+
name: test-report
|
23
|
+
path: "**/*ruby-agent-junit.xml"
|
24
|
+
reporter: java-junit
|
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: updatecli
|
2
2
|
|
3
3
|
on:
|
4
4
|
workflow_dispatch: ~
|
@@ -14,13 +14,11 @@ jobs:
|
|
14
14
|
steps:
|
15
15
|
- uses: actions/checkout@v3
|
16
16
|
- uses: elastic/apm-pipeline-library/.github/actions/updatecli@current
|
17
|
-
env:
|
18
|
-
BRANCH_NAME: ${{ github.ref_name }}
|
19
17
|
with:
|
20
18
|
vaultUrl: ${{ secrets.VAULT_ADDR }}
|
21
19
|
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
|
22
20
|
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
|
23
|
-
pipeline:
|
21
|
+
pipeline: .ci/updatecli.d
|
24
22
|
- if: failure()
|
25
23
|
uses: elastic/apm-pipeline-library/.github/actions/notify-build-status@current
|
26
24
|
with:
|
data/.pre-commit-config.yaml
CHANGED
data/CHANGELOG.asciidoc
CHANGED
@@ -25,7 +25,6 @@ endif::[]
|
|
25
25
|
|
26
26
|
[float]
|
27
27
|
===== Fixed
|
28
|
-
- Fix {pull}2526[#2526]
|
29
28
|
|
30
29
|
[float]
|
31
30
|
[[unreleased]]
|
@@ -35,6 +34,25 @@ endif::[]
|
|
35
34
|
[[release-notes-4.x]]
|
36
35
|
=== Ruby Agent version 4.x
|
37
36
|
|
37
|
+
[[release-notes-4.7.0]]
|
38
|
+
==== 4.7.0
|
39
|
+
|
40
|
+
[float]
|
41
|
+
===== Fixed
|
42
|
+
- Handle Faraday response being nil {pull}1382[#1382]
|
43
|
+
- Fix error with invalid %-encoding {pull}1400[#1400]
|
44
|
+
|
45
|
+
[float]
|
46
|
+
===== Added
|
47
|
+
- Add keyword args for span_method helper {pull}1395[#1395]
|
48
|
+
|
49
|
+
[[release-notes-4.6.2]]
|
50
|
+
==== 4.6.2
|
51
|
+
|
52
|
+
[float]
|
53
|
+
===== Fixed
|
54
|
+
- Fix Faraday::RackBuilder::StackLocked {pull}1371[#1371]
|
55
|
+
|
38
56
|
[[release-notes-4.6.1]]
|
39
57
|
==== 4.6.1
|
40
58
|
|
data/CONTRIBUTING.md
CHANGED
@@ -49,4 +49,4 @@ To release a new version:
|
|
49
49
|
2. Push the tag to GitHub.
|
50
50
|
3. Build the gem and upload to Rubygems (local user needs to be signed in and authorized.)
|
51
51
|
1. Run `rake release:update_branch`. This will...
|
52
|
-
1. Update `
|
52
|
+
1. Update `4.x` branch to be at released commit and push it to GitHub.
|
data/Gemfile
CHANGED
@@ -62,6 +62,10 @@ gem 'sucker_punch', '~> 2.0', require: nil
|
|
62
62
|
gem 'yard', require: nil
|
63
63
|
gem 'yarjuf'
|
64
64
|
|
65
|
+
if RUBY_VERSION < '2.5'
|
66
|
+
gem 'loofah', '~> 2.20.0', require: nil
|
67
|
+
end
|
68
|
+
|
65
69
|
## Install Framework
|
66
70
|
GITHUB_REPOS = {
|
67
71
|
'grape' => 'ruby-grape/grape',
|
@@ -83,9 +87,9 @@ frameworks_versions.each do |framework, version|
|
|
83
87
|
end
|
84
88
|
|
85
89
|
case version
|
86
|
-
when 'master' #
|
90
|
+
when 'master' # grape
|
87
91
|
gem framework, github: GITHUB_REPOS.fetch(framework)
|
88
|
-
when 'main' # rails
|
92
|
+
when 'main' # sinatra, rails
|
89
93
|
gem framework, github: GITHUB_REPOS.fetch(framework), branch: 'main'
|
90
94
|
when /.+/
|
91
95
|
gem framework, "~> #{version}.0"
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
## Elastic APM agent for Ruby
|
4
4
|
|
5
|
-
[![
|
5
|
+
[![ci](https://github.com/elastic/apm-agent-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/elastic/apm-agent-ruby/actions/workflows/ci.yml) [![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
data/bench/rubyprof.rb
CHANGED
data/bin/run-tests
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
set -e
|
3
3
|
|
4
|
+
JUNIT_PREFIX=${JUNIT_PREFIX:-""}
|
5
|
+
|
4
6
|
runRspec(){
|
5
7
|
local case=${1:-""}
|
6
8
|
local bn=${case}
|
@@ -8,9 +10,16 @@ runRspec(){
|
|
8
10
|
if [ -n "${case}" ]; then
|
9
11
|
bn="$(basename ${case} _spec.rb)/"
|
10
12
|
fi
|
13
|
+
# If working on an isolated environment then copy the file to
|
14
|
+
# the original location
|
15
|
+
TEST_REPORT_DIR=spec/junit-reports/${JUNIT_PREFIX}${bn}
|
16
|
+
if [ -n "$APP_PATH" ] ; then
|
17
|
+
TEST_REPORT_DIR=$APP_PATH/$TEST_REPORT_DIR
|
18
|
+
mkdir -p $TEST_REPORT_DIR
|
19
|
+
fi
|
11
20
|
bundle exec rspec \
|
12
21
|
-f progress \
|
13
|
-
-r yarjuf -f JUnit -o
|
22
|
+
-r yarjuf -f JUnit -o ${TEST_REPORT_DIR}ruby-agent-junit.xml \
|
14
23
|
${case}
|
15
24
|
}
|
16
25
|
specific_spec=$1
|
data/docker-compose.yml
CHANGED
@@ -35,8 +35,11 @@ services:
|
|
35
35
|
ruby_rspec:
|
36
36
|
image: apm-agent-ruby:${RUBY_VERSION}
|
37
37
|
environment:
|
38
|
+
APP_PATH: /opt/app
|
39
|
+
FRAMEWORK: rails
|
40
|
+
LOCAL_USER_ID: ${LOCAL_USER_ID}
|
41
|
+
LOCAL_GROUP_ID: ${LOCAL_GROUP_ID}
|
38
42
|
MONGODB_URL: 'mongodb:27017'
|
39
|
-
user: ${USER_ID}
|
40
43
|
security_opt:
|
41
44
|
- no-new-privileges
|
42
45
|
|