Skip to content

Commit 2548445

Browse files
committed
test
1 parent ba70622 commit 2548445

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,31 @@ unzip genai-service.zip
8484
cd genai-service
8585
npm install
8686
87+
# Download and install ADOT instrumentation
88+
${var.get_adot_wheel_command}
89+
8790
export AWS_REGION=${var.aws_region}
91+
export OTEL_PROPAGATORS=tracecontext,xray,baggage
8892
export OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-aws-log-group=test/genesis,x-aws-log-stream=default,x-aws-metric-namespace=genesis"
8993
export OTEL_RESOURCE_ATTRIBUTES="service.name=langchain-traceloop-app"
9094
export AGENT_OBSERVABILITY_ENABLED="true"
9195
9296
# Run the genai service from the genai-service directory
9397
cd /app/genai-service
98+
echo "Starting Node.js service..."
9499
nohup node --require '@aws/aws-distro-opentelemetry-node-autoinstrumentation/register' --require ./customInstrumentation.js index.js > /var/log/langchain-service.log 2>&1 &
100+
echo "Service started with PID: $!"
95101
96102
# Wait for service to be ready
97103
echo "Waiting for service to be ready..."
98-
for i in {1..3}; do
104+
for i in {1..60}; do
99105
if curl -s http://localhost:8000/health > /dev/null 2>&1; then
100106
echo "Service is ready!"
101107
break
102108
fi
103109
echo "Attempt $i: Service not ready, waiting 5 seconds..."
110+
echo "Checking service logs:"
111+
tail -5 /var/log/langchain-service.log
104112
sleep 5
105113
done
106114

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ variable "trace_id" {
3939
}
4040

4141
variable "get_adot_wheel_command" {
42-
description = "Command to get and install ADOT wheel"
43-
default = "python3.12 -m pip install aws-opentelemetry-distro"
42+
description = "Command to get and install ADOT instrumentation"
43+
default = "npm install @aws/aws-distro-opentelemetry-node-autoinstrumentation"
4444
}

0 commit comments

Comments
 (0)