Skip to content

fix: use aws-opentelemetry-distro and add input/output logging for LangGraph agent#552

Open
tejaskash wants to merge 1 commit intomainfrom
fix-langgraph-observability
Open

fix: use aws-opentelemetry-distro and add input/output logging for LangGraph agent#552
tejaskash wants to merge 1 commit intomainfrom
fix-langgraph-observability

Conversation

@tejaskash
Copy link
Contributor

@tejaskash tejaskash commented Mar 17, 2026

Summary

  • Replace generic opentelemetry-distro + opentelemetry-exporter-otlp with aws-opentelemetry-distro in the LangGraph template, matching the Strands and OpenAI Agents templates
  • Add input/output logging (log.info) to the LangGraph agent entrypoint so invocation details appear in the runtime log group

Root Cause

The LangGraph template used the generic OpenTelemetry distro which doesn't integrate with the AWS X-Ray/CloudWatch observability pipeline. This resulted in only 1 span and no input/output logs. The aws-opentelemetry-distro enables botocore auto-instrumentation that captures Bedrock model calls, tool usage, and trace context propagation.

Verified

Deployed a CodeZip LangGraph agent and confirmed:

  • Multiple spans generated (3+ unique spanIds) with opentelemetry.instrumentation.botocore.bedrock-runtime scope
  • Input/output messages visible in runtime logs with traceId correlation
  • Tool call details (function name, arguments, results) captured in OTEL logs
  • telemetry.auto.version: "0.16.0-aws" confirming AWS OTEL distro is active

Test plan

  • Snapshot tests updated and passing
  • End-to-end deploy + invoke verified with CloudWatch log inspection

Closes #551

…ngGraph agent

The LangGraph template was using the generic opentelemetry-distro which
doesn't integrate properly with AWS X-Ray and CloudWatch. This resulted
in only 1 span and no input/output logs in the runtime log group.

Switch to aws-opentelemetry-distro (matching the Strands template) to
enable proper AWS-native telemetry with botocore instrumentation that
captures Bedrock model calls, tool usage, and trace context. Also add
input/output logging to the agent entrypoint.

Fixes #551
@tejaskash tejaskash requested a review from a team March 17, 2026 21:46
@github-actions github-actions bot added the size/xs PR size: XS label Mar 17, 2026
@github-actions
Copy link
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 42.95% 3839 / 8937
🔵 Statements 42.54% 4049 / 9518
🔵 Functions 44.51% 750 / 1685
🔵 Branches 44.83% 2541 / 5667
Generated in workflow #986 for commit 0cf365f by the Vitest Coverage Report Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Langgraph + langchain agent does not contain input/output logs and spans

1 participant