
Where Did the Two Minutes Go? Reading a Strands Agent's Traces on Amazon Bedrock AgentCore
A worksheet agent's promise of under three minutes a page hid a 13-second median and five jobs stuck behind throttled Nova Pro calls. AgentCore Observability had recorded every model call and AWS SDK call all along. Reading those traces showed two retry layers that multiplied, tokens and time to first token per model, and a log group keeping every prompt and worksheet photo with no expiry. Includes a small open-source trace report and a test of Strands' redaction setting.
Senior Software AI Engineer | AI & FinTech | .NET, Python | Cloud
In my first BrailleBridge article I wrote that a page goes from photo to a locked copy in under three minutes of processing on Amazon Bedrock AgentCore. That held, and it wasn't the useful number. When I finally read the traces, the median page took 13 seconds. Five pages took between 51 and 140 seconds, and every one of those five was waiting on throttled model calls, not working.
The traces had been there the whole time. AgentCore Observability records every agent invocation, every model call and every AWS SDK call, with no tracing code in the agent. This article shows what that data looks like for a Strands Agents graph, what it said about BrailleBridge, and one thing it was quietly storing that it shouldn't have been: every prompt and every worksheet photo, kept forever.
The tool I wrote to read the traces is small and works on any AgentCore runtime: https://github.com/Mohammad-Yasfo/agentcore-trace-report
What AgentCore records, without new code
BrailleBridge runs as one container on AgentCore Runtime: a Strands Graph with two page readers, a picture describer and a blind checker, plus a reader agent for students. Two settings, both in place before I ever looked at a trace, turned on everything below:
- CloudWatch Transaction Search, a one-time setup per account, which the AgentCore documentation lists as the first step to see spans and traces. The AgentCore CLI turned it on during my first deploy.
- The AWS Distro for OpenTelemetry (ADOT) in the image, with the container started through it:
CMD ["opentelemetry-instrument", "python", "-m", "braillebridge.app"].
From then on, three kinds of data flowed into Amazon CloudWatch.

- Spans from Strands, following the OpenTelemetry GenAI conventions:
invoke_graph,invoke_agent,execute_event_loop_cycle,chatfor each model call, andexecute_tool. Eachchatspan carries the model ID, input and output tokens, and the time to first token.
- Spans from ADOT for every AWS SDK call: Bedrock Runtime, Textract, S3 and Polly, with HTTP status codes.
- Log records in an
otel-rt-logsstream, plus the container's standard output.
For agents created recently, all of it lands in the agent's own log group,
/aws/bedrock-agentcore/runtimes/<agent>-DEFAULT , with spans in a stream called spans . Older agents send spans to the shared aws/spans log group instead. Mine was new enough that aws/spans stayed empty, which confused me for a few minutes.You can browse it on the AgentCore observability page or in the CloudWatch console. To analyze it, though, I wanted the raw spans, and the X-Ray trace APIs return them:
GetTraceSummaries finds traces by service name, and BatchGetTraces returns every segment.One job, as spans
Here is a real page job, simplified.

The
POST /invocations span is AgentCore's. Inside it, invoke_graph is the Strands Graph. Each agent the graph runs is an invoke_agent span, each model turn an execute_event_loop_cycle , each model call a chat span, and inside that the Bedrock Runtime SDK call. Structured output shows up as an execute_tool span named after the Pydantic model: PageRead , Description , Answer .A failed model call is easy to spot. Its
chat span has the fault and throttle flags set and a ModelThrottledException , and the SDK span under it shows HTTP 429 and how many times the SDK retried.Where the time went
I pulled every trace from the BrailleBridge runtime over two days: 196 traces, for well under a cent in X-Ray reads. Twenty-one of them were page jobs:
Page jobs | Jobs | Duration |
|---|---|---|
No throttled model calls | 16 | median 11.1 s, slowest 15.4 s |
At least one throttled model call | 5 | 51.0 s, 58.8 s, 107.7 s, 113.6 s, 140.3 s |
Nothing else separates the two groups. The slow jobs are exactly the throttled ones. The timeline view makes the difference obvious. Teal bars are model calls that succeeded, orange bars ended throttled, and the pale band is an agent waiting. A number on a bar is how many times the AWS SDK retried that call before it returned; more on that below.


In the throttled job, the trouble starts before the picture step. The Nova Pro page reader takes 13.4 seconds, where it took a median of 4.8 seconds in the fast jobs, and the number on its bar says why: the SDK retried that call four times before it went through. Then the picture step starts a description for every picture at once, three Nova Pro calls, and the account's Nova Pro quota pushes back harder. One description finishes in 4 seconds. One is throttled twice and finishes at 51 seconds. The third is throttled four times and finally gets through at 100 seconds. Its last model call took 11.2 seconds; the agent around it took 97.4.
The gaps between its attempts are 4, 8, 16 and 32 seconds. That's Strands' default
ModelRetryStrategy : wait 4, 8, 16, 32, then 64 seconds, up to six attempts. Across every throttled trace, the waits after a throttled call were 4 seconds 18 times, 8 seconds 6 times, 16 seconds 3 times and 32 seconds twice.
The traces also show a second layer of retries that I hadn't thought about. The throttled calls didn't fail fast. Each one ran 4 to 9 seconds before the 429 came back, 271 seconds across the 29 throttled calls. Strands' Bedrock client keeps the AWS SDK's default retry settings, and ADOT records what the SDK did as
retry_attempts on the SDK span. On every one of the 29 throttled calls, it's 4: the SDK sent the request five times, was refused five times, and only then did Strands see the error and start its own wait.Calls that succeeded weren't always clean either. Of the 250 successful model calls, 37 had been retried by the SDK first, 94 retries in all, and every one of them was in the five slow jobs. The 16 fast jobs had no retries at either layer.
So the two layers multiply. The description that waited longest made five model calls, and the SDK tried each of them five times: 25 requests to Bedrock for one picture description.
The account these ran on allowed 25 cross-Region Nova Pro requests a minute, and that quota is shared by everything in the account and Region that calls the model. The traces point to three fixes, none of which I've made yet:
- Cap concurrent Nova Pro calls in the picture step. The re-read step already handles one flagged item at a time, two calls per item, and the normal timeline shows it. The picture step has no such limit.
- Request a higher quota before real classroom use.
- Choose which layer retries, and how long it waits. Strands' strategy can be subclassed, and
BedrockModeltakes aboto_client_config, which is where the SDK's retries are set. A job with a teacher waiting would rather fail one picture early and flag it than wait out a 32-second backoff on top of five SDK attempts.
Tokens, cost and latency per call
Every successful
chat span carries its token counts and time to first token, so cost and latency come from the same data:Model | Calls | Input tokens | Output tokens | Cost | Median time to first token | 90th percentile |
|---|---|---|---|---|---|---|
Amazon Nova Lite | 119 | 180,146 | 16,245 | $0.015 | 0.49 s | 1.20 s |
Amazon Nova Pro | 131 | 200,985 | 18,664 | $0.221 | 1.00 s | 3.92 s |
Costs use on-demand prices in US East. A page job's model calls cost a median of 1.1 cents, and 2.0 cents at most. That's lower than the 1.5 to 5 cents a page in my first article, which came from end-to-end test runs on the sample worksheets. A student's reader command that needed the model took a median of 1.2 seconds inside AgentCore. That one number answers a question I'd only guessed at during testing: whether the reader responds quickly enough.
What the telemetry was keeping
While looking for where the spans were stored, I opened the agent's log group. It held 134 MB after two days of a hackathon, with retention set to "never expire". The records in its
otel-rt-logs stream had the system prompts, the models' replies and the worksheet photos themselves, as base64 JPEG bytes. The largest single record in the hour I sampled was 262 KB.That's the default. Strands records message content on its spans, and on AgentCore it ends up in CloudWatch Logs next to the traces. For a demo, that's handy for debugging. For an app that reads a child's schoolwork, it means every worksheet photo a teacher uploads is copied into a log group nobody set a retention period on.
Two changes fix it, and I'd make both before real use:
Set a retention period. One command per log group:
aws logs put-retention-policy --log-group-name /aws/bedrock-agentcore/runtimes/<agent>-DEFAULT --retention-in-days 30Redact message content at the source. Strands Agents 1.63 has an opt-in redaction setting in the same environment variable that selects its telemetry conventions. An empty allow-list redacts everything sensitive: system prompts, user messages, model replies, and tool inputs and outputs.
OTEL_SEMCONV_STABILITY_OPT_IN=gen_ai_unredacted_attributes=I didn't want to trust a setting I hadn't seen work, so the repo has a test for it. The test runs a real Strands Agent against a scripted model, exports every span and event to memory, and checks the result. By default, the prompt and the reply appear in the exported data. With the setting, they're replaced with
[REDACTED] , and the model ID, token counts and timings are all still there, which is everything this article used.The tool
agentcore-trace-report does three things:uv run python -m trace_report.cli fetch --service my_agent.DEFAULT --start 2026-11-03T00:00Z --end 2026-11-05T00:00Z --out traces/run.jsonluv run python -m trace_report.cli report traces/run.jsonluv run python -m trace_report.cli timeline traces/run.jsonl --out slowest-trace.svg-
fetchcallsGetTraceSummariesin six-hour windows, filtered to the runtime's service name, andBatchGetTracesfive IDs at a time. It writes one trace per line, with account IDs and access key IDs replaced by zeros. Span attributes include ARNs with the account ID, and ADOT records the caller's access key ID on every AWS SDK span. I found that one in my own saved traces. An access key ID isn't a secret, butaws sts get-access-key-inforeturns the account it belongs to.
-
reportreads the saved file, without calling AWS. It shows durations by kind of request, throttled calls, the SDK's retries and the waits after them, tokens and cost per model, time to first token, and the slowest traces with their slowest agent.
-
timelinedraws one trace as an SVG, like the two above.
Fetching once and analyzing offline is the same pattern as my evals article: the API calls happen once, and every question after that is free. Reading traces needs
xray:GetTraceSummaries and xray:BatchGetTraces .A checklist
- Turn on Transaction Search and start the container through ADOT. That's all it takes to get spans for every agent, model call and SDK call.
- Read the spans for the slowest requests before you tune anything. Mine said "waiting", not "slow model".
- Look for stacked retries: the SDK's inside each call, recorded as
retry_attempts, and the framework's between calls.
- Count tokens and time to first token from the
chatspans, instead of estimating.
- Open the agent's log group, see what it keeps, and set a retention period.
- Decide whether message content belongs in your telemetry. If it doesn't, redact it at the source, and test that the redaction works.
- Save traces once, with account IDs and access key IDs removed, and analyze the saved copy.
Sources
- Amazon Bedrock AgentCore Developer Guide, "Observability, audit logging, and tracing for your agents": https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability.html
- Amazon Bedrock AgentCore Developer Guide, "Add observability to your Amazon Bedrock AgentCore resources": https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/observability-configure.html
- OpenTelemetry, "Semantic conventions for generative AI systems": https://opentelemetry.io/docs/specs/semconv/gen-ai/
- The trace report and its test of the redaction setting: https://github.com/Mohammad-Yasfo/agentcore-trace-report
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article