AWS bedrock-agentcore documentation change
Summary
Added new troubleshooting section 'Spans are missing when my runtime is invoked from a Lambda function' explaining why spans disappear and how to resolve via Lambda active tracing
Security assessment
The change addresses observability/tracing configuration issues in Lambda integrations, not a security vulnerability or weakness. No security mechanisms or vulnerabilities are mentioned.
Diff
diff --git a/bedrock-agentcore/latest/devguide/runtime-troubleshooting.md b/bedrock-agentcore/latest/devguide/runtime-troubleshooting.md index eea861c6f..d1073c12e 100644 --- a//bedrock-agentcore/latest/devguide/runtime-troubleshooting.md +++ b//bedrock-agentcore/latest/devguide/runtime-troubleshooting.md @@ -5 +5 @@ -My agent invocations fail with 504 Gateway Timeout errorsMy Docker build fails with "403 Forbidden" when pulling Python base imagesI get "Unknown service: 'bedrock-agent-core-runtime'" error when using boto3I get "AccessDeniedException" when trying to create an Amazon Bedrock AgentCore RuntimeMy Docker build fails with "exec /bin/sh: exec format error"What are the requirements for Docker containers used with Amazon Bedrock AgentCore Runtime?My long-running tool gets interrupted after 15 minutesHow do I access the runtimeSessionId in my agent code for tagging or grouping resources?I have RuntimeClientError (403) issuesI have missing or empty CloudWatch LogsI have payload format issuesI need help understanding HTTP error codesI need recommendations for testing my agentI need help debugging container issuesI need help troubleshooting MCP protocol agentsI need help troubleshooting bidirectional streaming using WebSocketMy code changes aren't reflected in existing sessionsBest practices +My agent invocations fail with 504 Gateway Timeout errorsMy Docker build fails with "403 Forbidden" when pulling Python base imagesI get "Unknown service: 'bedrock-agent-core-runtime'" error when using boto3I get "AccessDeniedException" when trying to create an Amazon Bedrock AgentCore RuntimeMy Docker build fails with "exec /bin/sh: exec format error"What are the requirements for Docker containers used with Amazon Bedrock AgentCore Runtime?My long-running tool gets interrupted after 15 minutesHow do I access the runtimeSessionId in my agent code for tagging or grouping resources?I have RuntimeClientError (403) issuesI have missing or empty CloudWatch LogsI have payload format issuesI need help understanding HTTP error codesI need recommendations for testing my agentI need help debugging container issuesI need help troubleshooting MCP protocol agentsI need help troubleshooting bidirectional streaming using WebSocketMy code changes aren't reflected in existing sessionsSpans are missing when my runtime is invoked from a Lambda functionBest practices @@ -46,0 +47,2 @@ This troubleshooting topic helps you identify and resolve common issues when wor + * Spans are missing when my runtime is invoked from a Lambda function + @@ -464,0 +467,17 @@ To access your updated code, use a new session ID. +## Spans are missing when my runtime is invoked from a Lambda function + +**When this occurs:** When invoking AgentCore Runtime from a Lambda function + +**Why this happens:** Lambda generates its own `X-Amzn-Trace-Id` header. If the Lambda trace has `Sampled=0`, this unsampled context propagates to AgentCore Runtime and the runtime skips span generation for that invocation. + +**Solution:** + + * **Enable Lambda active tracing:** Turn on X-Ray active tracing on your Lambda function so that it produces sampled traces (`Sampled=1`). + + * **Verify CloudWatch Transaction Search:** Ensure you have completed the setup in [Configure observability](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html) and that your trace segment destination is set to CloudWatch Logs. + + * **Check the sampling decision:** Log the `_X_AMZN_TRACE_ID` environment variable inside your Lambda function. If it shows `Sampled=0`, active tracing is not enabled or an upstream caller is making the sampling decision. + + + +