File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
terraform/node/ec2/adot-genai Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -84,23 +84,31 @@ unzip genai-service.zip
8484cd genai-service
8585npm install
8686
87+ # Download and install ADOT instrumentation
88+ ${ var . get_adot_wheel_command }
89+
8790export AWS_REGION=${ var . aws_region }
91+ export OTEL_PROPAGATORS=tracecontext,xray,baggage
8892export OTEL_EXPORTER_OTLP_LOGS_HEADERS="x-aws-log-group=test/genesis,x-aws-log-stream=default,x-aws-metric-namespace=genesis"
8993export OTEL_RESOURCE_ATTRIBUTES="service.name=langchain-traceloop-app"
9094export AGENT_OBSERVABILITY_ENABLED="true"
9195
9296# Run the genai service from the genai-service directory
9397cd /app/genai-service
98+ echo "Starting Node.js service..."
9499nohup 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
97103echo "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
105113done
106114
Original file line number Diff line number Diff line change @@ -39,6 +39,6 @@ variable "trace_id" {
3939}
4040
4141variable "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}
You can’t perform that action at this time.
0 commit comments