1
1
name : Build, Test, and Publish ADOT OTLP UDP Exporter
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - " udp-*"
4
7
workflow_dispatch :
5
8
inputs :
6
9
version :
@@ -22,93 +25,62 @@ jobs:
22
25
- name : Install dependencies
23
26
run : |
24
27
python -m pip install --upgrade pip
25
- pip install hatch pytest
28
+ pip install hatch pytest flask
26
29
27
30
- name : Build package
28
31
working-directory : exporters/aws-otel-otlp-udp-exporter
29
32
run : hatch build
30
33
31
- - name : Setup X-Ray daemon
34
+ - name : Download and run X-Ray Daemon
32
35
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 &
45
41
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
59
56
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"
90
57
91
- - name : Setup validation app
58
+ - name : Call Sample App Endpoint
92
59
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
94
63
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
98
68
99
69
- name : Verify X-Ray daemon received traces
100
70
run : |
101
71
echo "X-Ray daemon logs:"
102
- cat daemon-logs/ xray-daemon.log
72
+ cat xray-daemon/daemon-logs .log
103
73
104
74
# 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
106
76
echo "✅ X-Ray daemon processed trace data (AWS upload errors are expected)"
107
77
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
109
79
echo "✅ X-Ray daemon processed segment data (AWS upload errors are expected)"
110
80
exit 0
111
81
else
112
82
echo "❌ No evidence of traces being received by X-Ray daemon"
113
83
exit 1
114
84
fi
85
+
86
+ # TODO: Steps to publish to PyPI
0 commit comments