Skip to content

Commit a42cfe0

Browse files
committed
update UDP Exporter test/release
1 parent 4ef1cff commit a42cfe0

File tree

3 files changed

+109
-51
lines changed

3 files changed

+109
-51
lines changed
Lines changed: 33 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,29 @@
1-
name: Release ADOT OTLP UDP Exporter
1+
name: Release ADOT X-Ray UDP Exporter
2+
23
on:
34
workflow_dispatch:
45
inputs:
5-
version:
6+
udp-exporter-version:
67
description: The version to tag the release with, e.g., 1.2.0
78
required: true
9+
type: string
10+
11+
permissions:
12+
id-token: write
13+
contents: write
814

915
jobs:
16+
validate-udp-exporter-e2e-test:
17+
name: "Validate X-Ray UDP Exporter E2E Test Succeeds"
18+
uses: ./.github/workflows/udp-exporter-e2e-test.yml
19+
secrets: inherit
20+
permissions:
21+
id-token: write
22+
1023
build:
1124
environment: Release
1225
runs-on: ubuntu-latest
26+
needs: validate-udp-exporter-e2e-test
1327
steps:
1428
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
1529
uses: actions/checkout@v4
@@ -30,54 +44,22 @@ jobs:
3044
cd exporters/aws-distro-opentelemetry-exporter-xray-udp
3145
npm pack
3246
33-
- name: Download and run X-Ray Daemon
34-
run: |
35-
mkdir xray-daemon
36-
cd xray-daemon
37-
wget https://s3.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
38-
unzip aws-xray-daemon-linux-3.x.zip
39-
./xray -o -n us-west-2 -f ./daemon-logs.log --log-level debug &
40-
41-
- name: Setup Sample App
42-
run: |
43-
cd sample-applications/integ-test-http-server
44-
npm install
45-
npm install ../../exporters/aws-distro-opentelemetry-exporter-xray-udp/aws-aws-distro-opentelemetry-exporter-xray-udp-*.tgz
47+
# Publish OTLP UDP Exporter to npm
48+
- name: Publish to npm
49+
working-directory: exporters/aws-distro-opentelemetry-exporter-xray-udp
50+
env:
51+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
52+
NPM_CONFIG_PROVENANCE: true
53+
run: npx publish
4654

47-
- name: Run Sample App in Background
55+
# Publish to GitHub releases
56+
- name: Create GH release
57+
id: create_release
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
4860
run: |
49-
cd sample-applications/integ-test-http-server
50-
node udp-exporter-test-server.js &
51-
# Wait for test server to initialize
52-
sleep 5
53-
54-
- name: Call Sample App Endpoint
55-
id: call-endpoint
56-
run: |
57-
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
58-
59-
- name: Verify X-Ray daemon received traces
60-
run: |
61-
sleep 10
62-
echo "X-Ray daemon logs:"
63-
cat xray-daemon/daemon-logs.log
64-
# Check if the daemon received and processed some data
65-
if grep -q "sending.*batch" xray-daemon/daemon-logs.log; then
66-
echo "✅ X-Ray daemon processed trace data (AWS upload errors are expected)"
67-
exit 0
68-
elif grep -q "processor:.*segment" xray-daemon/daemon-logs.log; then
69-
echo "✅ X-Ray daemon processed segment data (AWS upload errors are expected)"
70-
exit 0
71-
else
72-
echo "❌ No evidence of traces being received by X-Ray daemon"
73-
exit 1
74-
fi
75-
76-
# TODO: Uncomment when we make the first release
77-
# # Publish OTLP UDP Exporter to npm
78-
# - name: Publish to npm
79-
# working-directory: exporters/aws-distro-opentelemetry-exporter-xray-udp
80-
# env:
81-
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
82-
# NPM_CONFIG_PROVENANCE: true
83-
# run: npx publish
61+
gh release create --target "$GITHUB_REF_NAME" \
62+
--title "Release @aws/aws-distro-opentelemetry-exporter-xray-udp v${{ inputs.udp-exporter-version }}" \
63+
--notes "Please refer to the [Changelog](https://github.com/aws-observability/aws-otel-java-instrumentation/blob/main/exporters/aws-distro-opentelemetry-xray-udp-span-exporter/CHANGELOG.md) for more details" \
64+
--draft \
65+
"aws-distro-opentelemetry-xray-udp-span-exporter/v${{ inputs.udp-exporter-version }}"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17+
18+
- name: Set up Node and run Unit Tests
19+
uses: ./.github/actions/set_up
20+
with:
21+
node_version: "20"
22+
package_name: "@aws/aws-distro-opentelemetry-exporter-xray-udp"
23+
os: ubuntu-latest
24+
run_unit_tests: true
25+
26+
# Project dependencies and compilation are already done in the previous step
27+
- name: Install Dependencies, Compile, and Build Tarball
28+
id: staging_tarball_build
29+
shell: bash
30+
run: |
31+
cd exporters/aws-distro-opentelemetry-exporter-xray-udp
32+
npm pack
33+
34+
- name: Configure AWS credentials for Testing Tracing
35+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
36+
with:
37+
role-to-assume: ${{ secrets.XRAY_UDP_EXPORTER_TEST_ROLE }}
38+
aws-region: 'us-east-1'
39+
40+
- name: Download and run X-Ray Daemon
41+
run: |
42+
mkdir xray-daemon
43+
cd xray-daemon
44+
wget https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
45+
unzip aws-xray-daemon-linux-3.x.zip
46+
./xray -o -n us-east-2 -f ./daemon-logs.log --log-level debug &
47+
48+
- name: Setup Sample App
49+
working-directory: sample-apps/udp-exporter-test-app
50+
run: |
51+
npm install ../../exporters/aws-distro-opentelemetry-exporter-xray-udp/aws-aws-distro-opentelemetry-exporter-xray-udp-*.tgz
52+
npm install
53+
node udp-exporter-test-server.js &
54+
# Wait for test server to initialize
55+
sleep 5
56+
57+
- name: Call Sample App Endpoint
58+
id: call-endpoint
59+
run: |
60+
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
61+
62+
- name: Check if traces are successfully sent to AWS X-Ray
63+
run: |
64+
sleep 20
65+
# # Print Daemon Logs for debugging
66+
# cat xray-daemon/daemon-logs.log
67+
68+
traceId=${{ steps.call-endpoint.outputs.traceId }}
69+
numTracesFound=$(aws xray batch-get-traces --trace-ids $traceId --region us-east-2 | jq '.Traces' | jq length)
70+
if [[ numTracesFound -ne "1" ]]; then
71+
echo "TraceId $traceId not found in X-Ray."
72+
exit 1
73+
else
74+
echo "TraceId $traceId found in X-Ray."
75+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Release History: @aws/aws-distro-opentelemetry-exporter-xray-udp

0 commit comments

Comments
 (0)