elastic-apm 4.6.2 → 4.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.ci/.exclude.yml +193 -0
  3. data/.ci/.ruby.yml +10 -0
  4. data/.ci/scripts/bench.sh +52 -0
  5. data/.ci/scripts/install-build-system.sh +5 -0
  6. data/.ci/snapshoty.yml +2 -3
  7. data/.ci/updatecli.d/update-gherkin-specs.yml +126 -0
  8. data/.ci/updatecli.d/update-json-specs.yml +130 -0
  9. data/.ci/{update-specs.yml → updatecli.d/update-specs.yml} +10 -0
  10. data/.github/dependabot.yml +17 -1
  11. data/.github/workflows/README.md +58 -0
  12. data/.github/workflows/ci-docs.yml +20 -0
  13. data/.github/workflows/ci.yml +70 -0
  14. data/.github/workflows/coverage-reporter.yml +34 -0
  15. data/.github/workflows/microbenchmark.yml +48 -0
  16. data/.github/workflows/opentelemetry.yml +27 -0
  17. data/.github/workflows/release.yml +71 -0
  18. data/.github/workflows/run-matrix.yml +56 -0
  19. data/.github/workflows/snapshoty.yml +35 -0
  20. data/.github/workflows/test-reporter.yml +24 -0
  21. data/.github/workflows/{update-specs.yml → updatecli.yml} +2 -4
  22. data/.pre-commit-config.yaml +0 -2
  23. data/CHANGELOG.asciidoc +25 -0
  24. data/Gemfile +16 -3
  25. data/README.md +1 -1
  26. data/bench/rubyprof.rb +1 -0
  27. data/bin/run-tests +10 -1
  28. data/docker-compose.yml +4 -1
  29. data/docs/configuration.asciidoc +6 -5
  30. data/docs/index.asciidoc +2 -2
  31. data/docs/{log-correlation.asciidoc → logs.asciidoc} +29 -2
  32. data/docs/opentracing.asciidoc +1 -1
  33. data/docs/redirects.asciidoc +9 -0
  34. data/lib/elastic_apm/context_builder.rb +6 -3
  35. data/lib/elastic_apm/metadata/cloud_info.rb +3 -4
  36. data/lib/elastic_apm/metrics.rb +24 -20
  37. data/lib/elastic_apm/span_helpers.rb +6 -6
  38. data/lib/elastic_apm/spies/action_dispatch.rb +11 -3
  39. data/lib/elastic_apm/spies/faraday.rb +8 -1
  40. data/lib/elastic_apm/version.rb +1 -1
  41. metadata +25 -19
  42. data/.ci/.jenkins_exclude.yml +0 -191
  43. data/.ci/.jenkins_ruby.yml +0 -10
  44. data/.ci/.jenkins_ruby_benchmarks.yml +0 -6
  45. data/.ci/Jenkinsfile +0 -450
  46. data/.ci/jobs/apm-agent-ruby-downstream.yml +0 -38
  47. data/.ci/jobs/apm-agent-ruby-linting-mbp.yml +0 -39
  48. data/.ci/jobs/apm-agent-ruby-mbp.yml +0 -43
  49. data/.ci/jobs/apm-agent-ruby.yml +0 -4
  50. data/.ci/jobs/defaults.yml +0 -24
  51. data/.ci/linting.groovy +0 -32
  52. data/.ci/packer_cache.sh +0 -16
  53. /data/.ci/{.jenkins_codecov.yml → .codecov.yml} +0 -0
  54. /data/.ci/{.jenkins_framework.yml → .framework.yml} +0 -0
  55. /data/.ci/{.jenkins_main_framework.yml → .main_framework.yml} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7c28585ab44cfdb7a4eb8c32b8dd60e1ecb10c091357c25a6b13f35a0fe2ffc
4
- data.tar.gz: 3aad55a03f8c2a4d824ea09731be304e7712ee306dc4e585c5cc29ba11e25413
3
+ metadata.gz: 2a42c0ce245df1d22209302a5047957fdc35532ef06e0834078200305377df50
4
+ data.tar.gz: 43cbfaca9d8b8d382bb95c42559a7a497e28926bf7067558741b57aa036842e0
5
5
  SHA512:
6
- metadata.gz: eb6480a61567bd000e5325e12702c46882a42a9c452a60bd7af997b7138b076cd332d853f101b694af30d120bdd3b48f1b911feb6ecf12e94cdfc58ba096855c
7
- data.tar.gz: e626d4a1cb9370780d764385585fb4c4025d612a84b7ef36ae0525f6d6f6a83ddf7d5aa670ccf2610bf10f9e2c2d9a87f2f97818cc9e8de27153c3a85cd34875
6
+ metadata.gz: fe8f8a3f6228788632530c5ee4ecfcf8ade01e199aa5cc06bc40e1af68a54f75266d5fcae91aa4d2357bb57fbd54c62f357b24a6e89b841ac449ae75199b1603
7
+ data.tar.gz: 2d3f2ece8d92db1a43475384e284fc82678ca5bf8352ce3b5d384e682dfbf55c6324886de1a94f95641861ce808cadaa1f057e7956c2b46fe4ab39db213fa0c1
data/.ci/.exclude.yml ADDED
@@ -0,0 +1,193 @@
1
+ exclude:
2
+ # Ruby 2.4
3
+ # Only test on rails-4.2, sinatra-1.4
4
+ - VERSION: ruby:2.4
5
+ FRAMEWORK: rails-7.0
6
+ - VERSION: ruby:2.4
7
+ FRAMEWORK: rails-6.1
8
+ - VERSION: ruby:2.4
9
+ FRAMEWORK: rails-6.0
10
+ - VERSION: ruby:2.4
11
+ FRAMEWORK: rails-5.2
12
+ - VERSION: ruby:2.4
13
+ FRAMEWORK: sinatra-2.2
14
+ - VERSION: ruby:2.4
15
+ FRAMEWORK: grape-1.6
16
+ - VERSION: ruby:2.4
17
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.0
18
+ - VERSION: ruby:2.4
19
+ FRAMEWORK: rails-main
20
+ - VERSION: ruby:2.4
21
+ FRAMEWORK: sinatra-main
22
+ - VERSION: ruby:2.4
23
+ FRAMEWORK: grape-master
24
+
25
+ # rails-4.2 exclusions
26
+ # Only test on ruby 2.4
27
+ - VERSION: ruby:3.1
28
+ FRAMEWORK: rails-4.2
29
+ - VERSION: ruby:3.0
30
+ FRAMEWORK: rails-4.2
31
+ - VERSION: ruby:2.7
32
+ FRAMEWORK: rails-4.2
33
+ - VERSION: ruby:2.6
34
+ FRAMEWORK: rails-4.2
35
+ - VERSION: jruby:9.2
36
+ FRAMEWORK: rails-4.2
37
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
38
+ FRAMEWORK: rails-4.2
39
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
40
+ FRAMEWORK: rails-4.2
41
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
42
+ FRAMEWORK: rails-4.2
43
+ # sinatra-1.4 exclusions
44
+ - VERSION: ruby:3.1
45
+ FRAMEWORK: sinatra-1.4
46
+ - VERSION: ruby:3.0
47
+ FRAMEWORK: sinatra-1.4
48
+ - VERSION: ruby:2.7
49
+ FRAMEWORK: sinatra-1.4
50
+ - VERSION: jruby:9.2
51
+ FRAMEWORK: sinatra-1.4
52
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
53
+ FRAMEWORK: sinatra-1.4
54
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
55
+ FRAMEWORK: sinatra-1.4
56
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
57
+ FRAMEWORK: sinatra-1.4
58
+
59
+ # rails-6.0 and rails-6.1 exclusions
60
+ # Don't test on ruby 2.4
61
+ - VERSION: ruby:2.4
62
+ FRAMEWORK: rails-6.1
63
+ - VERSION: ruby:2.4
64
+ FRAMEWORK: rails-6.0
65
+
66
+ # Only test rails main on ruby 3.1
67
+ - VERSION: ruby:3.0
68
+ FRAMEWORK: rails-main
69
+ - VERSION: ruby:2.7
70
+ FRAMEWORK: rails-main
71
+ - VERSION: ruby:2.6
72
+ FRAMEWORK: rails-main
73
+ - VERSION: ruby:2.5
74
+ FRAMEWORK: rails-main
75
+ - VERSION: ruby:2.4
76
+ FRAMEWORK: rails-main
77
+ - VERSION: jruby:9.2
78
+ FRAMEWORK: rails-main
79
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
80
+ FRAMEWORK: rails-main
81
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
82
+ FRAMEWORK: rails-main
83
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
84
+ FRAMEWORK: rails-main
85
+
86
+ # Only test rails 7.0 on ruby >= 2.7
87
+ - VERSION: ruby:2.6
88
+ FRAMEWORK: rails-7.0
89
+ - VERSION: ruby:2.5
90
+ FRAMEWORK: rails-7.0
91
+ - VERSION: ruby:2.4
92
+ FRAMEWORK: rails-7.0
93
+ - VERSION: jruby:9.2
94
+ FRAMEWORK: rails-7.0
95
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
96
+ FRAMEWORK: rails-7.0
97
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
98
+ FRAMEWORK: rails-7.0
99
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
100
+ FRAMEWORK: rails-7.0
101
+
102
+ # Only test sinatra main on ruby 2.7 and ruby 3.1
103
+ - VERSION: ruby:3.0
104
+ FRAMEWORK: sinatra-main
105
+ - VERSION: ruby:2.6
106
+ FRAMEWORK: sinatra-main
107
+ - VERSION: ruby:2.5
108
+ FRAMEWORK: sinatra-main
109
+ - VERSION: ruby:2.4
110
+ FRAMEWORK: sinatra-main
111
+ - VERSION: jruby:9.2
112
+ FRAMEWORK: sinatra-main
113
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
114
+ FRAMEWORK: sinatra-main
115
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
116
+ FRAMEWORK: sinatra-main
117
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
118
+ FRAMEWORK: sinatra-main
119
+
120
+ # Only test grape master on ruby 2.7 and ruby 3.0
121
+ - VERSION: ruby:2.6
122
+ FRAMEWORK: grape-master
123
+ - VERSION: ruby:2.5
124
+ FRAMEWORK: grape-master
125
+ - VERSION: ruby:2.4
126
+ FRAMEWORK: grape-master
127
+ - VERSION: jruby:9.2
128
+ FRAMEWORK: grape-master
129
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
130
+ FRAMEWORK: grape-master
131
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
132
+ FRAMEWORK: grape-master
133
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
134
+ FRAMEWORK: grape-master
135
+
136
+ # grape 1.5 doesn't support ruby 3.0
137
+ - VERSION: ruby:3.1
138
+ FRAMEWORK: grape-1.6
139
+ - VERSION: ruby:3.1
140
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
141
+ - VERSION: ruby:3.1
142
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
143
+ - VERSION: ruby:3.0
144
+ FRAMEWORK: grape-1.6
145
+ - VERSION: ruby:3.0
146
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
147
+
148
+ # only test ruby >= 3.0 with rails 6.0 and rails 6.1
149
+ - VERSION: ruby:3.1
150
+ FRAMEWORK: rails-5.2
151
+ - VERSION: ruby:3.1
152
+ FRAMEWORK: rails-5.1
153
+ - VERSION: ruby:3.0
154
+ FRAMEWORK: rails-5.2
155
+ - VERSION: ruby:3.0
156
+ FRAMEWORK: rails-5.1
157
+
158
+ # Unsupported
159
+ # Ruby 2.6
160
+ - VERSION: ruby:2.6
161
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
162
+ - VERSION: ruby:2.6
163
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
164
+ # Ruby 2.5
165
+ - VERSION: ruby:2.5
166
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
167
+ - VERSION: ruby:2.5
168
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
169
+ # Ruby 2.4
170
+ - VERSION: ruby:2.4
171
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
172
+ - VERSION: ruby:2.4
173
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
174
+ # JRuby 9.2
175
+ - VERSION: jruby:9.2
176
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
177
+ - VERSION: jruby:9.2
178
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
179
+ # JRuby 9.2-13-jdk
180
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
181
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
182
+ - VERSION: elasticobservability/jruby:9.2-13-jdk
183
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
184
+ # JRuby 9.2-11-jdk
185
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
186
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
187
+ - VERSION: elasticobservability/jruby:9.2-11-jdk
188
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
189
+ # JRuby 9.2-8-jdk
190
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
191
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-6.1
192
+ - VERSION: elasticobservability/jruby:9.2-8-jdk
193
+ FRAMEWORK: grape-1.6,sinatra-2.2,rails-7.0
data/.ci/.ruby.yml ADDED
@@ -0,0 +1,10 @@
1
+ VERSION:
2
+ - ruby:3.1
3
+ - ruby:3.0
4
+ - ruby:2.7
5
+ - ruby:2.6
6
+ - ruby:2.4
7
+ - jruby:9.2
8
+ - elasticobservability/jruby:9.2-13-jdk
9
+ - elasticobservability/jruby:9.2-11-jdk
10
+ - elasticobservability/jruby:9.2-8-jdk
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Bash strict mode
4
+ set -eo pipefail
5
+
6
+ # Found current script directory
7
+ RELATIVE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8
+
9
+ # Found project directory
10
+ BASE_PROJECT="$(dirname "$(dirname "${RELATIVE_DIR}")")"
11
+
12
+ ## Buildkite specific configuration
13
+ if [ "$CI" == "true" ] ; then
14
+ # If HOME is not set then use the Buildkite workspace
15
+ # that's normally happening when running in the CI
16
+ # owned by Elastic.
17
+ if [ -z "$HOME" ] ; then
18
+ HOME=$BUILDKITE_BUILD_CHECKOUT_PATH
19
+ export HOME
20
+ fi
21
+
22
+ # required when running the benchmark
23
+ PATH=$PATH:$HOME/.local/bin
24
+ export PATH
25
+
26
+ echo 'Docker login is done in the Buildkite hooks'
27
+ fi
28
+
29
+ # It does not fail so it runs for every single version and then we report the error at the end.
30
+ set +e
31
+ status=0
32
+
33
+ for VERSION in "ruby:3.1" "ruby:3.0" "ruby:2.7" "ruby:2.6" "jruby:9.2" ; do
34
+ ## Transform the versions like:
35
+ ## jruby:9.1 to jruby-9.1
36
+ echo "--- Benchmark for :ruby: ${VERSION}"
37
+ OUTPUT_NAME=benchmark-$(echo "${VERSION//:/-}")
38
+
39
+ # TBC, maybe a timeout could help so it can run the other versions?
40
+ ${BASE_PROJECT}/spec/scripts/benchmarks.sh "${VERSION}" "${OUTPUT_NAME}"
41
+
42
+ # Gather error if any
43
+ if [ $? -gt 0 ] ; then
44
+ status=1
45
+ fi
46
+
47
+ # Then we ship the data using the helper
48
+ sendBenchmark "${ES_USER_SECRET}" "${ES_PASS_SECRET}" "${ES_URL_SECRET}" "${BASE_PROJECT}/spec/${OUTPUT_NAME}.bulk"
49
+ done
50
+
51
+ # Report status
52
+ exit $status
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -euxo pipefail
4
+
5
+ gem install rake yard rspec
data/.ci/snapshoty.yml CHANGED
@@ -23,12 +23,11 @@ artifacts:
23
23
  # Files pattern to match
24
24
  files_pattern: 'elastic-apm-(?P<app_version>\d+\.\d+\.\d+)\.gem'
25
25
  # File layout on GCS bucket
26
- output_pattern: '{project}/{jenkins_branch_name}/elastic-apm-ruby-{app_version}-{jenkins_git_commit_short}.gem'
26
+ output_pattern: '{project}/{github_branch_name}/elastic-apm-ruby-{app_version}-{github_sha_short}.gem'
27
27
  # List of metadata processors to use.
28
28
  metadata:
29
29
  # Define static custom metadata
30
30
  - name: 'custom'
31
31
  data:
32
32
  project: 'apm-agent-ruby'
33
- # Add jenkins metadata
34
- - name: 'jenkins'
33
+ - name: 'github_actions'
@@ -0,0 +1,126 @@
1
+ name: update-gherkin-specs
2
+ pipelineid: update-gherkin-specs
3
+ title: synchronize gherkin 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
+ pull_request:
27
+ kind: shell
28
+ dependson:
29
+ - sha
30
+ spec:
31
+ command: gh api /repos/elastic/apm/commits/{{ source "sha" }}/pulls --jq '.[].html_url'
32
+ environments:
33
+ - name: GITHUB_TOKEN
34
+ - name: PATH
35
+ api_key.feature:
36
+ kind: file
37
+ spec:
38
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/api_key.feature
39
+ azure_app_service_metadata.feature:
40
+ kind: file
41
+ spec:
42
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/azure_app_service_metadata.feature
43
+ azure_functions_metadata.feature:
44
+ kind: file
45
+ spec:
46
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/azure_functions_metadata.feature
47
+ otel_bridge.feature:
48
+ kind: file
49
+ spec:
50
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/otel_bridge.feature
51
+ outcome.feature:
52
+ kind: file
53
+ spec:
54
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/outcome.feature
55
+ user_agent.feature:
56
+ kind: file
57
+ spec:
58
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/gherkin-specs/user_agent.feature
59
+
60
+ actions:
61
+ pr:
62
+ kind: "github/pullrequest"
63
+ scmid: default
64
+ title: '[Automation] Update Gherkin specs'
65
+ spec:
66
+ automerge: false
67
+ draft: false
68
+ labels:
69
+ - "automation"
70
+ description: |-
71
+ ### What
72
+ APM agent Gherkin specs automatic sync
73
+ ### Why
74
+ *Changeset*
75
+ * https://github.com/elastic/apm/commit/{{ source "sha" }}
76
+ * {{ source "pull_request" }}
77
+
78
+ targets:
79
+ api_key.feature:
80
+ name: api_key.feature
81
+ scmid: default
82
+ sourceid: api_key.feature
83
+ kind: file
84
+ spec:
85
+ file: features/api_key.feature
86
+ forcecreate: true
87
+ azure_app_service_metadata.feature:
88
+ name: azure_app_service_metadata.feature
89
+ scmid: default
90
+ sourceid: azure_app_service_metadata.feature
91
+ kind: file
92
+ spec:
93
+ file: features/azure_app_service_metadata.feature
94
+ forcecreate: true
95
+ azure_functions_metadata.feature:
96
+ name: azure_functions_metadata.feature
97
+ scmid: default
98
+ sourceid: azure_functions_metadata.feature
99
+ kind: file
100
+ spec:
101
+ file: features/azure_functions_metadata.feature
102
+ forcecreate: true
103
+ otel_bridge.feature:
104
+ name: otel_bridge.feature
105
+ scmid: default
106
+ sourceid: otel_bridge.feature
107
+ kind: file
108
+ spec:
109
+ file: features/otel_bridge.feature
110
+ forcecreate: true
111
+ outcome.feature:
112
+ name: outcome.feature
113
+ scmid: default
114
+ sourceid: outcome.feature
115
+ kind: file
116
+ spec:
117
+ file: features/outcome.feature
118
+ forcecreate: true
119
+ user_agent.feature:
120
+ name: user_agent.feature
121
+ scmid: default
122
+ sourceid: user_agent.feature
123
+ kind: file
124
+ spec:
125
+ file: features/user_agent.feature
126
+ forcecreate: true
@@ -0,0 +1,130 @@
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
+ pull_request:
27
+ kind: shell
28
+ dependson:
29
+ - sha
30
+ spec:
31
+ command: gh api /repos/elastic/apm/commits/{{ source "sha" }}/pulls --jq '.[].html_url'
32
+ environments:
33
+ - name: GITHUB_TOKEN
34
+ - name: PATH
35
+ container_metadata_discovery.json:
36
+ kind: file
37
+ spec:
38
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/container_metadata_discovery.json
39
+ service_resource_inference.json:
40
+ kind: file
41
+ spec:
42
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/service_resource_inference.json
43
+ span_types.json:
44
+ kind: file
45
+ spec:
46
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/span_types.json
47
+ sql_signature_examples.json:
48
+ kind: file
49
+ spec:
50
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/sql_signature_examples.json
51
+ sql_token_examples.json:
52
+ kind: file
53
+ spec:
54
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/sql_token_examples.json
55
+ w3c_distributed_tracing.json:
56
+ kind: file
57
+ spec:
58
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/w3c_distributed_tracing.json
59
+ wildcard_matcher_tests.json:
60
+ kind: file
61
+ spec:
62
+ file: https://raw.githubusercontent.com/elastic/apm/main/tests/agents/json-specs/wildcard_matcher_tests.json
63
+ actions:
64
+ pr:
65
+ kind: "github/pullrequest"
66
+ scmid: default
67
+ title: '[Automation] Update JSON specs'
68
+ spec:
69
+ automerge: false
70
+ draft: false
71
+ labels:
72
+ - "automation"
73
+ description: |-
74
+ ### What
75
+ APM agent specs automatic sync
76
+ ### Why
77
+ *Changeset*
78
+ * https://github.com/elastic/apm/commit/{{ source "sha" }}
79
+ * {{ source "pull_request" }}
80
+
81
+ targets:
82
+ container_metadata_discovery.json:
83
+ name: container_metadata_discovery.json
84
+ scmid: default
85
+ sourceid: container_metadata_discovery.json
86
+ kind: file
87
+ spec:
88
+ file: spec/fixtures/container_metadata_discovery.json
89
+ service_resource_inference.json:
90
+ name: service_resource_inference.json
91
+ scmid: default
92
+ sourceid: service_resource_inference.json
93
+ kind: file
94
+ spec:
95
+ file: spec/fixtures/service_resource_inference.json
96
+ span_types.json:
97
+ name: span_types.json
98
+ scmid: default
99
+ sourceid: span_types.json
100
+ kind: file
101
+ spec:
102
+ file: spec/fixtures/span_types.json
103
+ sql_signature_examples.json:
104
+ name: sql_signature_examples.json
105
+ scmid: default
106
+ sourceid: sql_signature_examples.json
107
+ kind: file
108
+ spec:
109
+ file: spec/fixtures/sql_signature_examples.json
110
+ sql_token_examples.json:
111
+ name: sql_token_examples.json
112
+ scmid: default
113
+ sourceid: sql_token_examples.json
114
+ kind: file
115
+ spec:
116
+ file: spec/fixtures/sql_token_examples.json
117
+ w3c_distributed_tracing.json:
118
+ name: w3c_distributed_tracing.json
119
+ scmid: default
120
+ sourceid: w3c_distributed_tracing.json
121
+ kind: file
122
+ spec:
123
+ file: spec/fixtures/w3c_distributed_tracing.json
124
+ wildcard_matcher_tests.json:
125
+ name: wildcard_matcher_tests.json
126
+ scmid: default
127
+ sourceid: wildcard_matcher_tests.json
128
+ kind: file
129
+ spec:
130
+ file: spec/fixtures/wildcard_matcher_tests.json
@@ -23,6 +23,15 @@ sources:
23
23
  transformers:
24
24
  - findsubmatch:
25
25
  pattern: "[0-9a-f]{40}"
26
+ pull_request:
27
+ kind: shell
28
+ dependson:
29
+ - sha
30
+ spec:
31
+ command: gh api /repos/elastic/apm-data/commits/{{ source "sha" }}/pulls --jq '.[].html_url'
32
+ environments:
33
+ - name: GITHUB_TOKEN
34
+ - name: PATH
26
35
  error.json:
27
36
  kind: file
28
37
  spec:
@@ -64,6 +73,7 @@ actions:
64
73
  ### Why
65
74
  *Changeset*
66
75
  * https://github.com/elastic/apm-data/commit/{{ source "sha" }}
76
+ * {{ source "pull_request" }}
67
77
 
68
78
  targets:
69
79
  error.json:
@@ -3,7 +3,9 @@ updates:
3
3
  - package-ecosystem: bundler
4
4
  directory: "/"
5
5
  schedule:
6
- interval: daily
6
+ interval: "weekly"
7
+ day: "sunday"
8
+ time: "22:00"
7
9
  open-pull-requests-limit: 10
8
10
  ignore:
9
11
  - dependency-name: sucker_punch
@@ -14,3 +16,17 @@ updates:
14
16
  - 1.8.10
15
17
  - 1.8.8
16
18
  - 1.8.9
19
+
20
+ # GitHub actions
21
+ - package-ecosystem: "github-actions"
22
+ directory: "/"
23
+ reviewers:
24
+ - "elastic/observablt-ci"
25
+ schedule:
26
+ interval: "weekly"
27
+ day: "sunday"
28
+ time: "22:00"
29
+ groups:
30
+ github-actions:
31
+ patterns:
32
+ - "*"
@@ -0,0 +1,58 @@
1
+ ## CI/CD
2
+
3
+ There are 5 main stages that run on GitHub actions:
4
+
5
+ * Linting
6
+ * Test
7
+ * Test `main` versions
8
+ * Package
9
+ * Release
10
+
11
+ There are some other stages that run for every push on the main branches:
12
+
13
+ * [Microbenchmark](./microbenchmark.yml)
14
+ * [Snapshoty](./snapshoty.yml)
15
+
16
+ ### Scenarios
17
+
18
+ * Compatibility matrix runs on branches, tags and PRs basis.
19
+ * Tests should be triggered on branch, tag and PR basis.
20
+ * Commits that are only affecting the docs files should not trigger any test or similar stages that are not required.
21
+ * Automated release in the CI gets triggered when a tag release is created.
22
+ * **This is not the case yet**, but if Github secrets are required then Pull Requests from forked repositories won't run any build accessing those secrets. If needed, then create a feature branch.
23
+
24
+ ### Compatibility matrix
25
+
26
+ Ruby agent supports compatibility to different ruby versions and frameworks, those are defined in:
27
+
28
+ * [frameworks](../../.ci/.framework.yml) for all the PRs.
29
+ * [frameworks](../../.ci/.main_framework.yml) for all the PRs using the `main` branches.
30
+ * Ruby [versions](../../.ci/.ruby.yml) for all the `*nix` builds.
31
+ * [Exclude list](../../.ci/.exclude.yml) for the above entries.
32
+
33
+ ### How to interact with the CI?
34
+
35
+ #### On a PR basis
36
+
37
+ Once a PR has been opened then there are two different ways you can trigger builds in the CI:
38
+
39
+ 1. Commit based
40
+ 1. UI based, any Elasticians can force a build through the GitHub UI
41
+
42
+ #### Branches
43
+
44
+ Every time there is a merge to main or any release branches the whole workflow will compile and test every entry in the compatibility matrix for Linux.
45
+
46
+ ### Release process
47
+
48
+ This process has been fully automated and it gets triggered when a tag release has been created.
49
+ The tag release follows the naming convention: `v.<major>.<minor>.<patch>`, where `<major>`, `<minor>` and `<patch>`.
50
+
51
+ ### OpenTelemetry
52
+
53
+ There is a GitHub workflow in charge to populate what the workflow run in terms of jobs and steps. Those details can be seen in [here](https://ela.st/oblt-ci-cd-stats) (**NOTE**: only available for Elasticians).
54
+
55
+ ## Bump automation
56
+
57
+ [updatecli](https://www.updatecli.io/) is the tool we use to automatically update the specs
58
+ the [APM agents](./updatecli.yml) use.
@@ -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"'