11name : Build, Test, and Publish ADOT OTLP UDP Exporter
22
33on :
4+ push :
5+ branches :
6+ - " udp-*"
47 workflow_dispatch :
58 inputs :
69 version :
@@ -22,93 +25,62 @@ jobs:
2225 - name : Install dependencies
2326 run : |
2427 python -m pip install --upgrade pip
25- pip install hatch pytest
28+ pip install hatch pytest flask
2629
2730 - name : Build package
2831 working-directory : exporters/aws-otel-otlp-udp-exporter
2932 run : hatch build
3033
31- - name : Setup X-Ray daemon
34+ - name : Download and run X-Ray Daemon
3235 run : |
33- # Download X-Ray daemon
34- wget https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
35- unzip -o aws-xray-daemon-linux-3.x.zip
36-
37- # Create config file
38- echo '{
39- "Version": 2,
40- "TotalBufferSizeMB": 10,
41- "Logging": {
42- "LogLevel": "debug"
43- },
44- }' > xray-daemon-config.json
36+ mkdir xray-daemon
37+ cd xray-daemon
38+ wget https://s3.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
39+ unzip aws-xray-daemon-linux-3.x.zip
40+ ./xray -o -n us-west-2 -f ./daemon-logs.log --log-level debug &
4541
46- # Make sure xray is executable
47- chmod +x ./xray
48-
49- # Create logs directory
50- mkdir -p daemon-logs
51-
52- # Start X-Ray daemon
53- ./xray -o -n us-west-2 -c xray-daemon-config.json > daemon-logs/xray-daemon.log 2>&1 &
54- XRAY_PID=$!
55- echo "X-Ray daemon started with PID $XRAY_PID"
56-
57- # Wait for daemon to be ready
58- echo "Waiting for X-Ray daemon to start..."
42+ - name : Install UDP Exporter
43+ run : |
44+ pip install ./exporters/aws-otel-otlp-udp-exporter/dist/*.whl
45+
46+ - name : Ensure Unit Tests are passing
47+ run : |
48+ pytest exporters/aws-otel-otlp-udp-exporter/tests/test_exporter.py
49+
50+ - name : Run Sample App in Background
51+ working-directory : sample-applications/integ-test-app
52+ run : |
53+ # Start validation app
54+ python udp_exporter_validation_app.py &
55+ # Wait for validation app to initialize
5956 sleep 5
60-
61- # Check if process is still running
62- if ps -p $XRAY_PID > /dev/null; then
63- echo "✅ X-Ray daemon process is running"
64- else
65- echo "❌ X-Ray daemon process is not running"
66- echo "Log contents:"
67- cat daemon-logs/xray-daemon.log
68- exit 1
69- fi
70-
71- # Try to connect to the daemon
72- if nc -zv 127.0.0.1 2000 2>&1; then
73- echo "✅ Successfully connected to X-Ray daemon on port 2000"
74- else
75- echo "❌ Cannot connect to X-Ray daemon on port 2000"
76- echo "Log contents:"
77- cat daemon-logs/xray-daemon.log
78- exit 1
79- fi
80-
81- # Extra verification with curl (might not work depending on daemon setup)
82- if curl -s http://localhost:2000/GetDaemonVersion; then
83- echo "✅ X-Ray daemon API responded"
84- else
85- echo "ℹ️ X-Ray daemon doesn't support API or not ready yet"
86- # Don't exit with error as this might not be reliable
87- fi
88-
89- echo "X-Ray daemon setup completed"
9057
91- - name : Setup validation app
58+ - name : Call Sample App Endpoint
9259 run : |
93- pip install ./exporters/aws-otel-otlp-udp-exporter/dist/*.whl
60+ # Trigger trace generation
61+ echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
62+ echo $traceId
9463
95- - name : Run validation test
96- working-directory : exporters/aws-otel-otlp-udp-exporter/validation-app
97- run : python app.py
64+ - name : Print Daemon Logs
65+ run : |
66+ sleep 20
67+ cat xray-daemon/daemon-logs.log
9868
9969 - name : Verify X-Ray daemon received traces
10070 run : |
10171 echo "X-Ray daemon logs:"
102- cat daemon-logs/ xray-daemon.log
72+ cat xray-daemon/daemon-logs .log
10373
10474 # Check if the daemon received and processed some data
105- if grep -q "sending.*batch" daemon-logs/ xray-daemon.log; then
75+ if grep -q "sending.*batch" xray-daemon/daemon-logs .log; then
10676 echo "✅ X-Ray daemon processed trace data (AWS upload errors are expected)"
10777 exit 0
108- elif grep -q "processor:.*segment" daemon-logs/ xray-daemon.log; then
78+ elif grep -q "processor:.*segment" xray-daemon/daemon-logs .log; then
10979 echo "✅ X-Ray daemon processed segment data (AWS upload errors are expected)"
11080 exit 0
11181 else
11282 echo "❌ No evidence of traces being received by X-Ray daemon"
11383 exit 1
11484 fi
85+
86+ # TODO: Steps to publish to PyPI
0 commit comments