Spring AI with Amazon Bedrock - Part 6 Adding AgentCore Observability
Introduction In part 5, we showed how to implement a Custom Agent written in Java with Spring AI and use its MCP Client based on HTTP Streamable transport protocol. We deployed our agent on the Ama...

Source: DEV Community
Introduction In part 5, we showed how to implement a Custom Agent written in Java with Spring AI and use its MCP Client based on HTTP Streamable transport protocol. We deployed our agent on the Amazon Bedrock AgentCore Runtime. What we didn't show in that part was how to implement AgentCore Observability. And this is what we'll cover now. Adding AgentCore Observability If we follow the steps described in the articles AgentCore Runtime Observability and AgentCore Gateway Observability and activate logging and tracing for both AgentCore Gateway and Runtime, like this: we'll only see the basic AgentCore metrics, but completely miss Sessions and Traces. The reason for this is that we provided the examples using the Strands Agents SDK. It works well with AgentCore Observability (baked by CloudWatch Generative AI Observability). We only had to add the dependency to aws-opentelemetry-distro and instrument our code, as shown below in the Docker file. Strands Agent has all the information on wh