Skip to content

Commit 1b0d8c4

Browse files
authored
Merge branch 'main' into main
2 parents 66f3ef7 + f63d7d2 commit 1b0d8c4

File tree

70 files changed

+3122
-1563
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+3122
-1563
lines changed

.github/workflows/canary.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
canary-test:
17-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-22.04
1818
name: Canary Test - (${{ matrix.aws_region }} - ${{ matrix.language }} - ${{ matrix.sample-app }} - ${{ matrix.instrumentation-type }} - ${{ matrix.architecture }})
1919
strategy:
2020
fail-fast: false
@@ -65,17 +65,17 @@ jobs:
6565
- uses: actions/checkout@v4
6666
with:
6767
submodules: recursive
68-
- uses: actions/setup-go@v4
68+
- uses: actions/setup-go@v5
6969
with:
70-
go-version: '~1.21.3'
70+
go-version: '~1.23.4'
7171
check-latest: true
72-
- uses: actions/setup-java@v3
72+
- uses: actions/setup-java@v4
7373
if: ${{ matrix.language == 'java' }}
7474
with:
7575
distribution: corretto
7676
java-version: '17'
7777
- name: Cache (Java)
78-
uses: actions/cache@v3
78+
uses: actions/cache@v4
7979
if: ${{ matrix.language == 'java' }}
8080
with:
8181
path: |
@@ -88,9 +88,9 @@ jobs:
8888
- uses: actions/setup-node@v4
8989
if: ${{ matrix.language == 'nodejs' }}
9090
with:
91-
node-version: '14'
91+
node-version: '16'
9292
- name: Cache (NodeJS)
93-
uses: actions/cache@v3
93+
uses: actions/cache@v4
9494
if: ${{ matrix.language == 'nodejs' }}
9595
with:
9696
path: |
@@ -99,12 +99,12 @@ jobs:
9999
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}-go-${{ hashFiles('**/go.sum') }}
100100
restore-keys: |
101101
${{ runner.os }}-node-
102-
- uses: actions/setup-python@v4
102+
- uses: actions/setup-python@v5
103103
if: ${{ matrix.language == 'python' }}
104104
with:
105105
python-version: '3.x'
106106
- name: Cache (Python)
107-
uses: actions/cache@v3
107+
uses: actions/cache@v4
108108
if: ${{ matrix.language == 'python' }}
109109
with:
110110
path: |
@@ -113,7 +113,7 @@ jobs:
113113
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}-go-${{ hashFiles('**/go.sum') }}
114114
restore-keys: |
115115
${{ runner.os }}-pip-
116-
- uses: actions/setup-dotnet@v3
116+
- uses: actions/setup-dotnet@v4
117117
if: ${{ matrix.language == 'dotnet' }}
118118
with:
119119
dotnet-version: '6.0.405'
@@ -122,7 +122,7 @@ jobs:
122122
- name: Build functions
123123
run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }}
124124
working-directory: ${{ matrix.language }}
125-
- uses: aws-actions/[email protected].1
125+
- uses: aws-actions/[email protected].2
126126
with:
127127
role-to-assume: ${{ secrets.INTEG_TEST_LAMBDA_ROLE_ARN }}
128128
role-duration-seconds: 7200
@@ -164,7 +164,7 @@ jobs:
164164
repository: aws-observability/aws-otel-test-framework
165165
path: test-framework
166166
- name: validate trace sample
167-
uses: nick-invision/retry@v2
167+
uses: nick-invision/retry@v3
168168
with:
169169
timeout_seconds: 300
170170
max_attempts: 3

.github/workflows/codeql-analysis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
jobs:
2424
analyze:
2525
name: Analyze
26-
runs-on: ubuntu-latest
26+
runs-on: ubuntu-22.04
2727

2828
strategy:
2929
fail-fast: false
@@ -39,7 +39,7 @@ jobs:
3939

4040
# Initializes the CodeQL tools for scanning.
4141
- name: Initialize CodeQL
42-
uses: github/codeql-action/init@v2
42+
uses: github/codeql-action/init@v3
4343
with:
4444
languages: ${{ matrix.language }}
4545
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -50,7 +50,7 @@ jobs:
5050
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5151
# If this step fails, then you should remove it and run the build manually (see below)
5252
- name: Autobuild
53-
uses: github/codeql-action/autobuild@v2
53+
uses: github/codeql-action/autobuild@v3
5454

5555
# ℹ️ Command-line programs to run using the OS shell.
5656
# 📚 https://git.io/JvXDl
@@ -64,4 +64,4 @@ jobs:
6464
# make release
6565

6666
- name: Perform CodeQL Analysis
67-
uses: github/codeql-action/analyze@v2
67+
uses: github/codeql-action/analyze@v3

.github/workflows/docker-build-lambda-soak.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ permissions:
1111

1212
jobs:
1313
build-lambda-soak:
14-
runs-on: ubuntu-latest
14+
runs-on: ubuntu-22.04
1515
steps:
1616
- uses: actions/checkout@v4
1717
- name: Configure AWS Credentials
18-
uses: aws-actions/[email protected].1
18+
uses: aws-actions/[email protected].2
1919
with:
2020
role-to-assume: ${{ secrets.INTEG_TEST_LAMBDA_ROLE_ARN }}
2121
role-duration-seconds: 1200
@@ -27,18 +27,18 @@ jobs:
2727
- name: Set up Docker Buildx
2828
uses: docker/setup-buildx-action@v3
2929
- name: Cache Docker layers
30-
uses: actions/cache@v3
30+
uses: actions/cache@v4
3131
with:
3232
path: /tmp/.buildx-cache
3333
key: ${{ runner.os }}-buildx-${{ github.sha }}
3434
restore-keys: |
3535
${{ runner.os }}-buildx-
3636
- name: Build docker image
37-
uses: docker/build-push-action@v5
37+
uses: docker/build-push-action@v6
3838
with:
3939
push: true
4040
context: adot/utils/soak
4141
tags: |
4242
public.ecr.aws/aws-otel-test/lambda-soak:latest
4343
cache-from: type=local,src=/tmp/.buildx-cache
44-
cache-to: type=local,dest=/tmp/.buildx-cache
44+
cache-to: type=local,dest=/tmp/.buildx-cache
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
name: Java Layer Integration Test
2+
on:
3+
workflow_call:
4+
inputs:
5+
caller-workflow-name:
6+
required: true
7+
type: string
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: main-build-java-${{ github.ref_name }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
id-token: write
16+
contents: read
17+
18+
jobs:
19+
integration-test:
20+
runs-on: ubuntu-22.04
21+
name: java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-${{ matrix.architecture }}-${{matrix.confmap}}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
architecture: [ amd64, arm64 ]
26+
runtime: [java17, java11]
27+
sample-app: [ aws-sdk, okhttp ]
28+
instrumentation-type: [ wrapper ]
29+
confmap: [ "noop" ]
30+
include:
31+
- sample-app: aws-sdk
32+
instrumentation-type: agent
33+
architecture: amd64
34+
confmap: noop
35+
runtime: java17
36+
- sample-app: aws-sdk
37+
instrumentation-type: agent
38+
architecture: amd64
39+
confmap: noop
40+
runtime: java11
41+
- sample-app: aws-sdk
42+
instrumentation-type: agent
43+
architecture: arm64
44+
confmap: noop
45+
runtime: java17
46+
- sample-app: aws-sdk
47+
instrumentation-type: agent
48+
architecture: arm64
49+
confmap: noop
50+
runtime: java11
51+
- sample-app: aws-sdk
52+
instrumentation-type: agent-confmap
53+
architecture: amd64
54+
confmap: s3
55+
runtime: java11
56+
- sample-app: aws-sdk
57+
instrumentation-type: agent-confmap
58+
architecture: arm64
59+
confmap: s3
60+
runtime: java11
61+
- sample-app: aws-sdk
62+
instrumentation-type: agent-confmap
63+
architecture: amd64
64+
confmap: http
65+
runtime: java11
66+
- sample-app: aws-sdk
67+
instrumentation-type: agent-confmap
68+
architecture: arm64
69+
confmap: http
70+
runtime: java11
71+
- sample-app: aws-sdk
72+
instrumentation-type: agent-confmap
73+
architecture: amd64
74+
confmap: https
75+
runtime: java11
76+
- sample-app: aws-sdk
77+
instrumentation-type: agent-confmap
78+
architecture: arm64
79+
confmap: https
80+
runtime: java11
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
with:
85+
submodules: recursive
86+
- uses: actions/setup-go@v5
87+
with:
88+
go-version: '~1.23.4'
89+
check-latest: true
90+
- uses: actions/setup-java@v4
91+
with:
92+
distribution: corretto
93+
java-version: '17'
94+
- name: Cache (Java)
95+
uses: actions/cache@v4
96+
with:
97+
path: |
98+
~/go/pkg/mod
99+
~/.gradle/caches
100+
~/.gradle/wrapper
101+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}-go-${{ hashFiles('**/go.sum') }}
102+
restore-keys: |
103+
${{ runner.os }}-gradle-
104+
105+
- uses: aws-actions/[email protected]
106+
with:
107+
role-to-assume: ${{ secrets.INTEG_TEST_LAMBDA_ROLE_ARN }}
108+
role-duration-seconds: 7200
109+
aws-region: us-east-1
110+
- name: Generate UUID
111+
id: generate-uuid
112+
run: |
113+
UUID=$(uuidgen | cut -c1-4)
114+
echo "uuid=$UUID" >> $GITHUB_OUTPUT
115+
- name: Patch ADOT
116+
run: ./patch-upstream.sh
117+
- name: Build layers / functions
118+
run: GOARCH=${{ matrix.architecture }} ./build.sh ${{ matrix.architecture }}
119+
working-directory: java
120+
- name: Get Lambda Layer amd64 architecture value
121+
if: ${{ matrix.architecture == 'amd64' }}
122+
run: echo LAMBDA_FUNCTION_ARCH=x86_64 | tee --append $GITHUB_ENV
123+
- name: Get Lambda Layer arm64 architecture value
124+
if: ${{ matrix.architecture == 'arm64' }}
125+
run: echo LAMBDA_FUNCTION_ARCH=arm64 | tee --append $GITHUB_ENV
126+
- name: Get terraform directory
127+
run: |
128+
echo TERRAFORM_DIRECTORY=java/integration-tests/${{ matrix.sample-app }}/${{ matrix.instrumentation-type }} |
129+
tee --append $GITHUB_ENV
130+
- uses: hashicorp/setup-terraform@v2
131+
- name: Initialize terraform
132+
run: terraform init
133+
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
134+
- name: Get terraform Lambda function name
135+
run: |
136+
echo TERRAFORM_LAMBDA_FUNCTION_NAME=lambda-java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-${{ matrix.confmap }}-${{ matrix.architecture }}-${{ steps.generate-uuid.outputs.uuid }} |
137+
tee --append $GITHUB_ENV
138+
- name: Apply terraform
139+
run: terraform apply -auto-approve
140+
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
141+
env:
142+
TF_VAR_sdk_layer_name: opentelemetry-java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-${{ matrix.architecture }}-${{ github.run_id }}
143+
TF_VAR_function_name: ${{ env.TERRAFORM_LAMBDA_FUNCTION_NAME }}
144+
TF_VAR_architecture: ${{ env.LAMBDA_FUNCTION_ARCH }}
145+
TF_VAR_configuration_source: ${{ matrix.confmap }}
146+
TF_VAR_runtime: ${{ matrix.runtime }}
147+
- name: Extract endpoint
148+
id: extract-endpoint
149+
run: terraform output -raw api-gateway-url
150+
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
151+
- name: Extract AMP endpoint
152+
id: extract-amp-endpoint
153+
if: ${{ matrix.sample-app == 'aws-sdk' && startsWith(matrix.instrumentation-type, 'agent') }}
154+
run: terraform output -raw amp_endpoint
155+
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
156+
- name: Extract SDK layer arn
157+
id: extract-sdk-layer-arn
158+
run: terraform output -raw sdk_layer_arn
159+
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
160+
- name: Output annotations
161+
run: |
162+
echo "::warning::Function: ${{ env.TERRAFORM_LAMBDA_FUNCTION_NAME }}"
163+
echo "::warning::SDK Layer ARN: ${{ steps.extract-sdk-layer-arn.outputs.stdout }}"
164+
- name: Send request to endpoint
165+
run: curl -sS ${{ steps.extract-endpoint.outputs.stdout }}
166+
- name: Checkout test framework
167+
uses: actions/checkout@v4
168+
with:
169+
repository: aws-observability/aws-otel-test-framework
170+
path: test-framework
171+
- name: validate trace sample
172+
run: |
173+
cp adot/utils/expected-templates/java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}.json \
174+
test-framework/validator/src/main/resources/expected-data-template/lambdaExpectedTrace.mustache
175+
cd test-framework
176+
./gradlew :validator:run --args="-c default-lambda-validation.yml --endpoint ${{ steps.extract-endpoint.outputs.stdout }} --region $AWS_REGION"
177+
- name: validate java agent metric sample
178+
if: ${{ matrix.sample-app == 'aws-sdk' && startsWith(matrix.instrumentation-type, 'agent') }}
179+
run: |
180+
cp adot/utils/expected-templates/java-${{ matrix.sample-app }}-${{ matrix.instrumentation-type }}-metric.json \
181+
test-framework/validator/src/main/resources/expected-data-template/ampExpectedMetric.mustache
182+
cd test-framework
183+
./gradlew :validator:run --args="-c prometheus-static-metric-validation.yml --cortex-instance-endpoint ${{ steps.extract-amp-endpoint.outputs.stdout }} --region $AWS_REGION"
184+
- name: Destroy terraform
185+
if: always()
186+
run: terraform destroy -auto-approve
187+
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
188+
env:
189+
TF_VAR_architecture: ${{ env.LAMBDA_FUNCTION_ARCH }}

0 commit comments

Comments
 (0)