# Bedrock AgentCore Trace Amazon Bedrock AgentCore agents with cetra from Python. The agent code is Strands, so its spans are the Strands spans. cetra traces an Amazon Bedrock AgentCore agent through the Strands code it runs, so the spans are the Strands spans. ## Install **Python** ```bash pip install cetra-sdk "strands-agents[openai]" ``` ## Set up Write the agent as a Strands agent, as on the [Strands Agents](https://cetra.sh/docs/integrations/strands/) 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. **Python** ```python 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 An AgentCore agent that runs Strands code produces the spans listed on the [Strands Agents](https://cetra.sh/docs/integrations/strands/) 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 - 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](https://cetra.sh/docs/reference/attributes/). ## Next - [Strands Agents](https://cetra.sh/docs/integrations/strands/): the spans, the session and the message formats. - [Traces](https://cetra.sh/docs/tracing/traces/): read the trace as a tree and a timeline. - [Cost and tokens](https://cetra.sh/docs/tracing/cost-and-tokens/): how cost is computed from the token counts.