Update Sonatype publishing URL to Central Portal (#1090) #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test ADOT X-Ray UDP Exporter | |
on: | |
workflow_call: | |
push: | |
branches: | |
- main | |
permissions: | |
id-token: write | |
jobs: | |
udp-exporter-e2e-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repo @ SHA - ${{ github.sha }} | |
uses: actions/checkout@v4 | |
- name: Set up Java | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: 'gradle' | |
- name: Configure AWS credentials for Testing Tracing | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.XRAY_UDP_EXPORTER_TEST_ROLE }} | |
aws-region: 'us-east-1' | |
- name: Download and run X-Ray Daemon | |
run: | | |
mkdir xray-daemon | |
cd xray-daemon | |
wget https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip | |
unzip aws-xray-daemon-linux-3.x.zip | |
./xray -o -n us-east-2 -f ./daemon-logs.log --log-level debug & | |
- name: Publish UDP exporter to Maven Local | |
id: build-udp-exporter | |
run: | | |
./gradlew build -p exporters/aws-distro-opentelemetry-xray-udp-span-exporter | |
./gradlew publishToMavenLocal -p exporters/aws-distro-opentelemetry-xray-udp-span-exporter | |
echo "xrayUdpSpanExporterVersion=$(./gradlew -q printVersion -p exporters/aws-distro-opentelemetry-xray-udp-span-exporter)" >> $GITHUB_OUTPUT | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Setup and Run Sample App in Background | |
working-directory: sample-apps/udp-exporter-test-app | |
run: | | |
export XRAY_UDP_SPAN_EXPORTER_VERSION=${{ steps.build-udp-exporter.outputs.xrayUdpSpanExporterVersion }} | |
echo "Running Sample App against X-Ray UDP Span Exporter version: $XRAY_UDP_SPAN_EXPORTER_VERSION" | |
gradle build | |
gradle bootRun & | |
sleep 5 | |
- name: Call Sample App Endpoint | |
id: call-endpoint | |
run: | | |
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT | |
- name: Check if traces are successfully sent to AWS X-Ray | |
run: | | |
sleep 20 | |
# # Print Daemon Logs for debugging | |
# cat xray-daemon/daemon-logs.log | |
traceId=${{ steps.call-endpoint.outputs.traceId }} | |
numTracesFound=$(aws xray batch-get-traces --trace-ids $traceId --region us-east-2 | jq '.Traces' | jq length) | |
if [[ numTracesFound -ne "1" ]]; then | |
echo "TraceId $traceId not found in X-Ray." | |
exit 1 | |
else | |
echo "TraceId $traceId found in X-Ray." | |
fi |