Skip to content

Commit fa29383

Browse files
authored
Update UDP release workflow to test via batch-get-traces (#272)
* update udp release workflow to test via bath-get-traces * run e2e test on push to main
1 parent daf5241 commit fa29383

File tree

2 files changed

+78
-47
lines changed

2 files changed

+78
-47
lines changed
+13-47
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release ADOT OTLP UDP Exporter
1+
name: Release ADOT X-Ray UDP Exporter
22
on:
33
workflow_dispatch:
44
inputs:
@@ -8,14 +8,21 @@ on:
88
type: string
99

1010
permissions:
11-
id-token: write
1211
contents: write
1312

1413
jobs:
15-
test-and-release:
14+
validate-udp-exporter-e2e-test:
15+
name: "Validate X-Ray UDP Exporter E2E Test Succeeds"
16+
uses: ./.github/workflows/udp-exporter-e2e-test.yml
17+
secrets: inherit
18+
permissions:
19+
id-token: write
20+
21+
release-udp-exporter:
1622
runs-on: ubuntu-latest
23+
needs: validate-udp-exporter-e2e-test
1724
steps:
18-
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
25+
- name: Checkout Repo @ SHA - ${{ github.sha }}
1926
uses: actions/checkout@v4
2027
- name: Install Go
2128
uses: actions/setup-go@v5
@@ -28,51 +35,10 @@ jobs:
2835
cd exporters/xrayudp
2936
go test ./...
3037
31-
- name: Download and run X-Ray Daemon
38+
- name: Tag UDP Exporter module
3239
run: |
33-
mkdir xray-daemon
34-
cd xray-daemon
35-
wget https://s3.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
36-
unzip aws-xray-daemon-linux-3.x.zip
37-
./xray -o -n us-west-2 -f ./daemon-logs.log --log-level debug &
38-
39-
- name: Build Sample App
40-
run: |
41-
cd .github/test-sample-apps/integ-test-http-server
42-
go build -o integ-test-http-server .
43-
44-
- name: Run Sample App in Background
45-
run: |
46-
cd .github/test-sample-apps/integ-test-http-server
47-
./integ-test-http-server &
48-
49-
- name: Call Sample App Endpoint
50-
id: call-endpoint
51-
run: |
52-
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
53-
54-
- name: Verify X-Ray daemon received traces
55-
run: |
56-
sleep 10
57-
echo "X-Ray daemon logs:"
58-
cat xray-daemon/daemon-logs.log
59-
60-
# Check if the daemon received and processed some data
61-
if grep -q "sending.*batch" xray-daemon/daemon-logs.log; then
62-
echo "✅ X-Ray daemon processed trace data (AWS upload errors are expected)"
63-
exit 0
64-
elif grep -q "processor:.*segment" xray-daemon/daemon-logs.log; then
65-
echo "✅ X-Ray daemon processed segment data (AWS upload errors are expected)"
66-
exit 0
67-
else
68-
echo "❌ No evidence of traces being received by X-Ray daemon"
69-
exit 1
70-
fi
40+
git tag exporters/xrayudp/v${{ inputs.udp-exporter-version }}
7141
7242
# TODO: Uncomment when we make the first release
73-
# - name: Tag UDP Exporter module
74-
# run: |
75-
# git tag exporters/xrayudp/v${{ inputs.udp-exporter-version }}
76-
7743
# - name: Publish tag for UDP Exporter module
7844
# run: git push --tags
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Test ADOT X-Ray UDP Exporter
2+
on:
3+
workflow_call:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
id-token: write
10+
11+
jobs:
12+
udp-exporter-e2e-test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo @ SHA - ${{ github.sha }}
16+
uses: actions/checkout@v4
17+
- name: Install Go
18+
uses: actions/setup-go@v5
19+
with:
20+
go-version: "1.24.0"
21+
check-latest: true
22+
23+
- name: Configure AWS credentials for Testing Tracing
24+
uses: aws-actions/configure-aws-credentials@v4
25+
with:
26+
role-to-assume: ${{ secrets.XRAY_UDP_EXPORTER_TEST_ROLE }}
27+
aws-region: 'us-east-1'
28+
29+
- name: Download and run X-Ray Daemon
30+
run: |
31+
mkdir xray-daemon
32+
cd xray-daemon
33+
wget https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
34+
unzip aws-xray-daemon-linux-3.x.zip
35+
./xray -o -n us-east-2 -f ./daemon-logs.log --log-level debug &
36+
37+
- name: Build Sample App
38+
run: |
39+
cd .github/test-sample-apps/integ-test-http-server
40+
go build -o integ-test-http-server .
41+
42+
- name: Run Sample App in Background
43+
run: |
44+
cd .github/test-sample-apps/integ-test-http-server
45+
./integ-test-http-server &
46+
47+
- name: Call Sample App Endpoint
48+
id: call-endpoint
49+
run: |
50+
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
51+
52+
- name: Check if traces are successfully sent to AWS X-Ray
53+
run: |
54+
sleep 20
55+
# # Print Daemon Logs for debugging
56+
# cat xray-daemon/daemon-logs.log
57+
58+
traceId=${{ steps.call-endpoint.outputs.traceId }}
59+
numTracesFound=$(aws xray batch-get-traces --trace-ids $traceId --region us-east-2 | jq '.Traces' | jq length)
60+
if [[ numTracesFound -ne "1" ]]; then
61+
echo "TraceId $traceId not found in X-Ray."
62+
exit 1
63+
else
64+
echo "TraceId $traceId found in X-Ray."
65+
fi

0 commit comments

Comments
 (0)