Skip to content

Commit f4f4d09

Browse files
committed
test
1 parent d1d542e commit f4f4d09

File tree

2 files changed

+5
-32
lines changed
  • terraform/node/ec2/adot-genai
  • validator/src/main/resources/expected-data-template/node/ec2/adot-genai

2 files changed

+5
-32
lines changed

terraform/node/ec2/adot-genai/main.tf

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ npm install
8686
npm install express @langchain/community @langchain/core @traceloop/node-server-sdk pino
8787
8888
# Download and install ADOT instrumentation
89-
echo "Installing ADOT instrumentation..."
9089
${var.get_adot_wheel_command}
91-
echo "ADOT installation completed"
92-
echo "Checking installed packages:"
93-
npm list --depth=0
9490
9591
export AWS_REGION=${var.aws_region}
9692
export OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-aws-log-group=test/genesis,x-aws-log-stream=default,x-aws-metric-namespace=genesis"
@@ -99,50 +95,28 @@ export AGENT_OBSERVABILITY_ENABLED="true"
9995
10096
# Run the genai service from the genai-service directory
10197
cd /app/genai-service
102-
echo "Starting Node.js service..."
103-
echo "Current directory: $(pwd)"
104-
echo "Files in directory:"
105-
ls -la
106-
echo "Checking if ADOT module exists:"
107-
node -e "try { require('@aws/aws-distro-opentelemetry-node-autoinstrumentation/register'); console.log('ADOT module found'); } catch(e) { console.log('ADOT module not found:', e.message); }"
108-
echo "Starting service with ADOT instrumentation:"
10998
nohup node --require '@aws/aws-distro-opentelemetry-node-autoinstrumentation/register' --require ./customInstrumentation.js index.js > /var/log/langchain-service.log 2>&1 &
110-
echo "Service started with PID: $!"
11199
112100
# Wait for service to be ready
113-
echo "Waiting for service to be ready..."
114-
for i in {1..10}; do
101+
for i in {1..60}; do
115102
if curl -s http://localhost:8000/health > /dev/null 2>&1; then
116-
echo "Service is ready!"
117103
break
118104
fi
119-
echo "Attempt $i: Service not ready, waiting 5 seconds..."
120-
echo "Checking service logs:"
121-
tail -5 /var/log/langchain-service.log
122105
sleep 5
123106
done
124107
125108
# Generate traffic directly
126-
echo "Starting traffic generator..."
127109
nohup bash -c '
128110
for i in {1..5}; do
129111
message="What is the weather like today?"
130-
echo "[$(date)] Request $i: $message"
131112
curl -s -X POST http://localhost:8000/ai-chat \
132113
-H "Content-Type: application/json" \
133114
-H "X-Amzn-Trace-Id: ${var.trace_id}" \
134115
-d "{\"message\": \"$message\"}" \
135-
-m 30 \
136-
echo "Request $i completed"
116+
-m 30 > /dev/null 2>&1
137117
sleep 10
138118
done
139-
echo "Traffic generator completed"
140-
' > /var/log/traffic-generator.log 2>&1 &
141-
142-
# Upload cloud-init logs to S3
143-
aws s3 cp /var/log/cloud-init.log s3://adot-genai-js-test/cloud-init-logs/${var.test_id}/cloud-init.log
144-
aws s3 cp /var/log/cloud-init-output.log s3://adot-genai-js-test/cloud-init-logs/${var.test_id}/cloud-init-output.log
145-
119+
' > /dev/null 2>&1 &
146120
EOF
147121
)
148122

validator/src/main/resources/expected-data-template/node/ec2/adot-genai/genai-log.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
[{
22
"resource": {
33
"attributes": {
4-
"aws.local.service": "{{serviceName}}",
54
"aws.service.type": "gen_ai_agent",
65
"service.name": "{{serviceName}}"
76
}
87
},
98
"scope": {
10-
"name": "openinference.instrumentation.langchain"
9+
"name": "@traceloop/instrumentation-langchain"
1110
},
1211
"severityNumber": "^[0-9]+$",
1312
"severityText": ".*",
@@ -30,7 +29,7 @@
3029
}
3130
},
3231
"attributes": {
33-
"event.name": "openinference.instrumentation.langchain"
32+
"event.name": "@traceloop/instrumentation-langchain"
3433
},
3534
"traceId": "{{traceId}}"
3635
}]

0 commit comments

Comments
 (0)