Bedrock AgentCore
cetra traces an Amazon Bedrock AgentCore agent through the Strands code it runs, so the spans are the Strands spans.
Install
Section titled “Install”pip install cetra-sdk "strands-agents[openai]"Set up
Section titled “Set up”Write the agent as a Strands agent, as on the Strands Agents page. Start cetra with use_global_provider=True before you create the agent, because Strands writes its spans to the global tracer provider. Set CETRA_API_KEY to your sk-cetra-… key.
import cetra
cetra.init(use_global_provider=True)
# Create the Strands agent and run it as on the Strands Agents page.
cetra.flush()What you get
Section titled “What you get”An AgentCore agent that runs Strands code produces the spans listed on the Strands Agents page: the agent span, the event loop cycles, a chat llm span for each model call, and a tool span for each tool call.
Limits
Section titled “Limits”- cetra was tested with the Strands cases, not on AgentCore. The spans above come from Strands running locally.
- The export from the AgentCore runtime to cetra is not tested, because the test needs an AWS account.
- The fixtures were captured with
strands-agents1.65.0. - If a field is missing, look at the span’s Attributes tab and compare it with Span attributes.
- Strands Agents: the spans, the session and the message formats.
- Traces: read the trace as a tree and a timeline.
- Cost and tokens: how cost is computed from the token counts.