Skip to content

Commit 78548ec

Browse files
committed
test
1 parent 99a9ed2 commit 78548ec

File tree

6 files changed

+24
-22
lines changed

6 files changed

+24
-22
lines changed

.github/workflows/python-ec2-genesis-test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,16 @@ jobs:
4141
- name: Generate testing id
4242
run: echo TESTING_ID="${{ github.run_id }}-${{ github.run_number }}-${RANDOM}" >> $GITHUB_ENV
4343

44-
- name: Generate XRay and W3C trace ID and baggage
44+
- name: Generate XRay and W3C trace ID
4545
run: |
4646
ID_1="$(printf '%08x' $(date +%s))"
4747
ID_2="$(openssl rand -hex 12)"
4848
W3C_TRACE_ID="${ID_1}${ID_2}"
4949
XRAY_TRACE_ID="1-${ID_1}-${ID_2}"
50-
BAGGAGE="test_session_$(openssl rand -hex 4)"
5150
echo "XRAY_TRACE_ID=${XRAY_TRACE_ID}" >> $GITHUB_ENV
5251
echo "W3C_TRACE_ID=${W3C_TRACE_ID}" >> $GITHUB_ENV
53-
echo "BAGGAGE=${BAGGAGE}" >> $GITHUB_ENV
5452
echo "Generated XRay Trace ID: ${XRAY_TRACE_ID}"
5553
echo "Generated W3C Trace ID: ${W3C_TRACE_ID}"
56-
echo "Generated Baggage: ${BAGGAGE}"
5754
5855
- name: Configure AWS Credentials
5956
uses: aws-actions/configure-aws-credentials@v4
@@ -116,7 +113,6 @@ jobs:
116113
export DELAY_SECONDS="5"
117114
export TIMEOUT="30"
118115
export TRACE_ID="Root=${XRAY_TRACE_ID};Parent=$(openssl rand -hex 8);Sampled=1"
119-
export BAGGAGE="${{ env.BAGGAGE }}"
120116
./generate_traffic.sh
121117
122118
- name: Validate generated logs

sample-apps/traffic-generator/langchain/generate_traffic.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,13 @@ send_request() {
4242
echo "Message: \"$message\""
4343

4444
# Use environment variables or defaults for headers
45-
local baggage_header="${BAGGAGE:-session.id=test_session}"
4645
local trace_id_header="${TRACE_ID:-Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1}"
4746

48-
echo "Using Baggage: $baggage_header"
4947
echo "Using Trace ID: $trace_id_header"
5048

5149
# Send request with timeout
5250
response=$(curl -s -X POST "$ENDPOINT" \
5351
-H "Content-Type: application/json" \
54-
-H "baggage: $baggage_header" \
5552
-H "X-Amzn-Trace-Id: $trace_id_header" \
5653
-d "{\"message\": \"$message\"}" \
5754
-m "$TIMEOUT" \

validator/src/main/java/com/amazon/aoc/App.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ public class App implements Callable<Integer> {
160160
@CommandLine.Option(names = {"--trace-id"})
161161
private String traceId;
162162

163-
@CommandLine.Option(names = {"--baggage"})
164-
private String baggage;
165-
166163
private static final String TEST_CASE_DIM_KEY = "testcase";
167164
private static final String CANARY_NAMESPACE = "Otel/Canary";
168165
private static final String CANARY_METRIC_NAME = "Success";
@@ -203,7 +200,6 @@ public Integer call() throws Exception {
203200
context.setInstanceId(this.instanceId);
204201
context.setPrivateDnsName(this.privateDnsName);
205202
context.setTraceId(this.traceId);
206-
context.setBaggage(this.baggage);
207203

208204
log.info(context);
209205

validator/src/main/java/com/amazon/aoc/models/Context.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public class Context {
6969

7070
private String traceId;
7171

72-
private String baggage;
73-
7472
private ECSContext ecsContext;
7573

7674
private CloudWatchContext cloudWatchContext;

validator/src/main/java/com/amazon/aoc/validators/TraceValidator.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ private Map<String, Object> getTrace() throws Exception {
147147
validationConfig.getHttpMethod().toUpperCase(),
148148
validationConfig.getHttpPath()));
149149
}
150+
151+
if (validationConfig.getHttpPath().contains("chat")) {
152+
if (context.getTraceId() != null) {
153+
traceFilter += String.format(" AND id = \"%s\"", context.getTraceId());
154+
}
155+
}
150156
log.info("Trace Filter: {}", traceFilter);
151157
List<TraceSummary> retrieveTraceLists = xrayService.searchTraces(traceFilter);
152158
List<String> traceIdLists = Collections.singletonList(retrieveTraceLists.get(0).getId());
Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
[{
2-
"resource": {
3-
"attributes": {
4-
"aws.local.service": "{{serviceName}}",
5-
"aws.service.type": "gen_ai_agent",
6-
"service.name": "{{serviceName}}"
2+
"name": "^{{serviceName}}$",
3+
"trace_id": "^{{traceId}}$",
4+
"http": {
5+
"request": {
6+
"url": "^.*/chat$",
7+
"method": "^POST$"
78
}
89
},
9-
"attributes": {
10-
"session.id": "{{baggage}}"
10+
"aws": {
11+
"service.type": "^gen_ai_agent$"
1112
},
12-
"traceId": "{{traceId}}"
13+
"annotations": {
14+
"aws.local.service": "^{{serviceName}}$",
15+
"aws.local.operation": "^POST /chat$"
16+
},
17+
"metadata": {
18+
"default": {
19+
"service.name": "^{{serviceName}}$"
20+
}
21+
}
1322
}]

0 commit comments

Comments
 (0)