AgentCore agent cost visibility: reading estimated cost per agent and session
No cost API in the preview: the estimate lives on each span, and the script reads it with one query.
AWS Cloud
Region us-east-1
Presenter
quickstart.py
read-only
AgentCore control plane
list agent runtimes
CloudWatch Transaction Search
prices each span: aws.cost.total
Amazon CloudWatch Logs
aws/spans
and each agent's log group
Amazon CloudWatch metrics
AWS/Bedrock-AgentCore
AgentCore Runtime
agentA, agentB
tracing enabled, ADOT
1
2
3
4
5
6
1
2
3
4
5
6
LINES
Queries the script runs
Setup checks
Telemetry the agents emit
FLOW
The script lists the agent runtimes and whether tracing is enabled on each.
It checks that CloudWatch Transaction Search is active in the account and Region.
Each traced agent sends spans; agents started under ADOT add model-call spans.
Priced spans are stored with an estimated cost, in USD at public list prices.
One Logs Insights query sums cost by agent and session, and finds the newest span.
For comparison, hourly vCPU and GB usage metrics are multiplied by the list price.