Skip to content

Commit 8a4b42d

Browse files
committed
rename UDP Exporter to AwsXrayUdpSpanExporter, update release process and tests
1 parent adf2273 commit 8a4b42d

File tree

17 files changed

+211
-91
lines changed

17 files changed

+211
-91
lines changed
Lines changed: 41 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
@@ -18,7 +32,7 @@ jobs:
1832
uses: ./.github/actions/set_up
1933
with:
2034
node_version: "20"
21-
package_name: "@aws/aws-otel-otlp-udp-exporter"
35+
package_name: "@aws/aws-distro-opentelemetry-exporter-xray-udp"
2236
os: ubuntu-latest
2337
run_unit_tests: true
2438

@@ -27,57 +41,33 @@ jobs:
2741
id: staging_tarball_build
2842
shell: bash
2943
run: |
30-
cd exporters/aws-otel-otlp-udp-exporter
44+
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-otel-otlp-udp-exporter/aws-aws-otel-otlp-udp-exporter-*.tgz
46-
47-
- name: Run Sample App in Background
47+
- name: Validate project version matches workflow input
4848
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"
49+
xrayUdpSpanExporterVersion=$(node -p "require('./exporters/aws-distro-opentelemetry-exporter-xray-udp/package.json').version")
50+
if [[ ! "$xrayUdpSpanExporterVersion" == "${{ inputs.udp-exporter-version }}" ]]; then
51+
echo "Input version '${{ inputs.udp-exporter-version }}' does not match with the UDP Exporter project version '$xrayUdpSpanExporterVersion'"
7352
exit 1
7453
fi
7554
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-otel-otlp-udp-exporter
80-
# env:
81-
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
82-
# NPM_CONFIG_PROVENANCE: true
83-
# run: npx publish
55+
# Publish OTLP UDP Exporter to npm
56+
- name: Publish to npm
57+
working-directory: exporters/aws-distro-opentelemetry-exporter-xray-udp
58+
env:
59+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
60+
NPM_CONFIG_PROVENANCE: true
61+
run: npx publish
62+
63+
# Publish to GitHub releases
64+
- name: Create GH release
65+
id: create_release
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
68+
run: |
69+
gh release create --target "$GITHUB_REF_NAME" \
70+
--title "Release aws-distro-opentelemetry-exporter-xray-udp v${{ inputs.udp-exporter-version }}" \
71+
--notes "Please refer to the [Changelog](https://github.com/aws-observability/aws-otel-js-instrumentation/blob/main/exporters/aws-distro-opentelemetry-exporter-xray-udp/CHANGELOG.md) for more details" \
72+
--draft \
73+
"aws-distro-opentelemetry-exporter-xray-udp/v${{ inputs.udp-exporter-version }}"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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+
run: |
30+
cd exporters/aws-distro-opentelemetry-exporter-xray-udp
31+
npm pack
32+
33+
- name: Configure AWS credentials for Testing Tracing
34+
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
35+
with:
36+
role-to-assume: ${{ secrets.XRAY_UDP_EXPORTER_TEST_ROLE }}
37+
aws-region: 'us-east-1'
38+
39+
- name: Download and run X-Ray Daemon
40+
run: |
41+
mkdir xray-daemon
42+
cd xray-daemon
43+
wget https://s3.us-east-2.amazonaws.com/aws-xray-assets.us-east-2/xray-daemon/aws-xray-daemon-linux-3.x.zip
44+
unzip aws-xray-daemon-linux-3.x.zip
45+
./xray -o -n us-east-2 -f ./daemon-logs.log --log-level debug &
46+
47+
- name: Setup Sample App
48+
working-directory: sample-applications/udp-exporter-test-app
49+
run: |
50+
npm install ../../exporters/aws-distro-opentelemetry-exporter-xray-udp/aws-aws-distro-opentelemetry-exporter-xray-udp-*.tgz
51+
npm install
52+
node udp-exporter-test-server.js &
53+
# Wait for test server to initialize
54+
sleep 5
55+
56+
- name: Call Sample App Endpoint
57+
id: call-endpoint
58+
run: |
59+
echo "traceId=$(curl localhost:8080/test)" >> $GITHUB_OUTPUT
60+
61+
- name: Check if traces are successfully sent to AWS X-Ray
62+
run: |
63+
sleep 20
64+
# # Print Daemon Logs for debugging
65+
# cat xray-daemon/daemon-logs.log
66+
67+
traceId=${{ steps.call-endpoint.outputs.traceId }}
68+
numTracesFound=$(aws xray batch-get-traces --trace-ids $traceId --region us-east-2 | jq '.Traces' | jq length)
69+
if [[ numTracesFound -ne "1" ]]; then
70+
echo "TraceId $traceId not found in X-Ray."
71+
exit 1
72+
else
73+
echo "TraceId $traceId found in X-Ray."
74+
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
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# AWS Distro for OpenTelemetry (ADOT) X-Ray UDP Exporter
2+
3+
The AWS X-Ray UDP Exporter allows you to send OpenTelemetry Spans to the AWS X-Ray Daemon endpoint.
4+
Notably, this will work with the X-Ray Daemon that runs in an AWS Lambda Environment.
5+
6+
## Installation
7+
8+
Install this package into your NodeJS project with:
9+
10+
```shell
11+
npm install --save @aws/aws-distro-opentelemetry-exporter-xray-udp
12+
```
13+
14+
## Usage
15+
16+
```js
17+
const { AwsXrayUdpSpanExporter } = require("@aws/aws-distro-opentelemetry-exporter-xray-udp")
18+
// ...
19+
20+
const _traceExporter = new AwsXrayUdpSpanExporter();
21+
const _spanProcessor = new SimpleSpanProcessor(_traceExporter);
22+
23+
const sdk = new opentelemetry.NodeSDK({
24+
spanProcessor: _spanProcessor,
25+
// ...
26+
});
27+
```

exporters/aws-otel-otlp-udp-exporter/package.json renamed to exporters/aws-distro-opentelemetry-exporter-xray-udp/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@aws/aws-otel-otlp-udp-exporter",
2+
"name": "@aws/aws-distro-opentelemetry-exporter-xray-udp",
33
"version": "0.0.1",
4-
"description": "This package provides an OTLP UDP Exporter for OpenTelemetry.",
4+
"description": "This package provides an AWS X-Ray UDP Exporter for OpenTelemetry.",
55
"author": {
66
"name": "Amazon Web Services",
77
"url": "http://aws.amazon.com"
88
},
9-
"homepage": "https://github.com/aws-observability/aws-otel-js-instrumentation/tree/main/exporters/aws-otel-otlp-udp-exporter#readme",
9+
"homepage": "https://github.com/aws-observability/aws-otel-js-instrumentation/tree/main/exporters/aws-distro-opentelemetry-exporter-xray-udp#readme",
1010
"license": "Apache-2.0",
1111
"engines": {
1212
"node": ">=14"
@@ -22,7 +22,7 @@
2222
"compile": "tsc -p .",
2323
"lint": "eslint . --ext .ts",
2424
"lint:fix": "eslint . --ext .ts --fix",
25-
"precompile": "tsc --version && lerna run version:update --scope @aws/aws-otel-otlp-udp-exporter --include-dependencies",
25+
"precompile": "tsc --version && lerna run version:update --scope @aws/aws-distro-opentelemetry-exporter-xray-udp --include-dependencies",
2626
"prewatch": "npm run precompile",
2727
"prepublishOnly": "npm run compile",
2828
"tdd": "yarn test -- --watch-extensions ts --watch",

exporters/aws-otel-otlp-udp-exporter/src/otlp-udp-exporter.ts renamed to exporters/aws-distro-opentelemetry-exporter-xray-udp/src/aws-xray-udp-span-exporter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class UdpExporter {
5454
}
5555
}
5656

57-
export class OTLPUdpSpanExporter implements SpanExporter {
57+
export class AwsXrayUdpSpanExporter implements SpanExporter {
5858
private _udpExporter: UdpExporter;
5959
private _signalPrefix: string;
6060
private _endpoint: string;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
export { OTLPUdpSpanExporter } from './otlp-udp-exporter';
4+
export { AwsXrayUdpSpanExporter } from './aws-xray-udp-span-exporter';

0 commit comments

Comments
 (0)