Skip to content
GitHubLog inStart free
cetra is not released yet. These docs describe the development version.

Bedrock AgentCore

cetra traces an Amazon Bedrock AgentCore agent through the Strands code it runs, so the spans are the Strands spans.

Terminal window
pip install cetra-sdk "strands-agents[openai]"

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()

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.

  • 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-agents 1.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.