| 
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:  | 
@@ -28,87 +31,58 @@ jobs:  | 
28 | 31 |         working-directory: exporters/aws-otel-otlp-udp-exporter  | 
29 | 32 |         run: hatch build  | 
30 | 33 | 
 
  | 
31 |  | -      - name: Setup X-Ray daemon  | 
 | 34 | +      # TODO: Add unit tests step  | 
 | 35 | + | 
 | 36 | +      - name: Download and run X-Ray Daemon  | 
32 | 37 |         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  | 
 | 38 | +          mkdir xray-daemon  | 
 | 39 | +          cd xray-daemon  | 
 | 40 | +          wget https://s3.us-west-2.amazonaws.com/aws-xray-assets.us-west-2/xray-daemon/aws-xray-daemon-linux-3.x.zip  | 
 | 41 | +          unzip aws-xray-daemon-linux-3.x.zip  | 
 | 42 | +          ./xray -o -n us-west-2 -f ./daemon-logs.log --log-level debug &  | 
45 | 43 | 
  | 
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..."  | 
 | 44 | +      - name: Install UDP Exporter  | 
 | 45 | +        run: |  | 
 | 46 | +          pip install ./exporters/aws-otel-otlp-udp-exporter/dist/*.whl  | 
 | 47 | +
  | 
 | 48 | +      - name: Install Flask  | 
 | 49 | +        run: |  | 
 | 50 | +          pip install flask  | 
 | 51 | +
  | 
 | 52 | +      - name: Run Sample App in Background  | 
 | 53 | +        working-directory: sample-applications/integ-test-app  | 
 | 54 | +        run: |  | 
 | 55 | +          # Start validation app  | 
 | 56 | +          python udp_exporter_validation_app.py &  | 
 | 57 | +          # Wait for validation app to initialize  | 
59 | 58 |           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 | 59 | 
  | 
91 |  | -      - name: Setup validation app  | 
 | 60 | +      - name: Call Sample App Endpoint  | 
92 | 61 |         run: |  | 
93 |  | -          pip install ./exporters/aws-otel-otlp-udp-exporter/dist/*.whl  | 
 | 62 | +          # Trigger trace generation  | 
 | 63 | +          echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT  | 
 | 64 | +          echo $traceId  | 
94 | 65 | 
  | 
95 |  | -      - name: Run validation test  | 
96 |  | -        working-directory: exporters/aws-otel-otlp-udp-exporter/validation-app  | 
97 |  | -        run: python app.py  | 
 | 66 | +      - name: Print Daemon Logs  | 
 | 67 | +        run: |  | 
 | 68 | +          sleep 20  | 
 | 69 | +          cat xray-daemon/daemon-logs.log  | 
98 | 70 | 
  | 
99 | 71 |       - name: Verify X-Ray daemon received traces  | 
100 | 72 |         run: |  | 
101 | 73 |           echo "X-Ray daemon logs:"  | 
102 |  | -          cat daemon-logs/xray-daemon.log  | 
 | 74 | +          cat xray-daemon/daemon-logs.log  | 
103 | 75 | 
  | 
104 | 76 |           # Check if the daemon received and processed some data  | 
105 |  | -          if grep -q "sending.*batch" daemon-logs/xray-daemon.log; then  | 
 | 77 | +          if grep -q "sending.*batch" xray-daemon/daemon-logs.log; then  | 
106 | 78 |             echo "✅ X-Ray daemon processed trace data (AWS upload errors are expected)"  | 
107 | 79 |             exit 0  | 
108 |  | -          elif grep -q "processor:.*segment" daemon-logs/xray-daemon.log; then  | 
 | 80 | +          elif grep -q "processor:.*segment" xray-daemon/daemon-logs.log; then  | 
109 | 81 |             echo "✅ X-Ray daemon processed segment data (AWS upload errors are expected)"  | 
110 | 82 |             exit 0  | 
111 | 83 |           else  | 
112 | 84 |             echo "❌ No evidence of traces being received by X-Ray daemon"  | 
113 | 85 |             exit 1  | 
114 | 86 |           fi  | 
 | 87 | +
  | 
 | 88 | +      # TODO: Steps to publish to PyPI  | 
0 commit comments