View a markdown version of this page

Troubleshoot agent cost - Amazon Bedrock AgentCore

Troubleshoot agent cost

Use these checks when a cost figure is missing, too low, or attributed to the wrong agent.

A cost shows a dash instead of a figure

When a figure is missing, you want to know why, so you can tell a gap from a free action. A missing figure is always a dash, never $0.

Possible causes

  • The action was not priced. The model has no public price, the model could not be matched to a price, or the work ran in a non-commercial partition. See Model pricing caveats.

  • The dimension is not covered. Some dimensions are out of scope, such as Runtime instance management fee, data transfer, and Memory storage. See Cost estimate coverage and limits.

  • The work ran before you set up cost. Earlier work shows blank.

  • A price was temporarily unavailable. If a price could not be found when the span was recorded, it is marked unavailable. Prices refresh about hourly, so a newly published price can take up to about an hour to apply to new work.

What to check

  1. Confirm the model and Region are priced. Check whether the model falls into one of the not-priced cases in Model pricing caveats.

  2. Confirm the dimension is covered in Cost estimate coverage and limits.

  3. Confirm the work ran after setup, not before.

A dash is not an error in the agent. Pricing is best-effort and never blocks or breaks a running agent.

A session cost looks too low or incomplete

When a session total seems short, you want to find the missing spans, so you can trust the number. A session total is the sum of its spans, so a low total usually means some spans did not reach Observability or did not carry the right identity.

What to check

  • Spans are reaching Observability. Confirm the session’s spans appear in the console. For a self-hosted or plain-OpenTelemetry agent, confirm Transaction Search is on and the export signs and reaches the X-Ray endpoint. See Self-hosted compute.

  • The running-time cost has arrived. The running-time cost of AgentCore Runtime, Code Interpreter, and Browser (CPU and memory hours) is written after the agent’s or tool’s session stops, so it arrives about 15 to 35 minutes after the session ends. Until then, a session shows only its model and per-call costs. Re-check the total after that window.

  • A primitive span is missing. If a tool (Gateway, Memory, Browser, Code Interpreter) was used but its cost is absent, confirm tracing is enabled for that resource and the call carried the session id.

  • Identifiers match. If a span carries a different session.id than the rest of the session, it cannot roll up with them. Confirm every service receives the same session.id. See How cost estimates are attributed to a session, agent, and fleet.

  • A dimension is not covered or not priced. Part of the work may be out of scope or unpriced, which shows as a dash, not a low number. See A cost shows a dash instead of a figure.

For self-hosted and plain-OpenTelemetry agents

Confirm the four values (aws.client.cloud.resource_id, session.id, aws.tenant.id, user.id) are set in baggage while every model call and tool call happens, and copied onto the agent’s own spans. A call made while those values are not set is charged to no agent and can leave a session looking short. See Pass the required session and agent attributes.

Cost is attributed to the wrong agent

When cost lands on the wrong agent, or on no agent, you want to check how identity is carried, so attribution resolves correctly.

How an agent is identified

  • An agent’s own span (model calls, and its Runtime span) names the agent in cloud.resource_id.

  • A tool call (Gateway, Memory, Browser, Code Interpreter) is charged to the agent named in aws.client.cloud.resource_id, copied from the request the agent sent.

  • A model call with no cloud.resource_id counts in the total but under no agent.

See How cost estimates are attributed to a session, agent, and fleet.

What to check

  • The calling agent id is passed on each tool call. For a self-hosted agent, confirm aws.client.cloud.resource_id is in baggage while each tool call happens. If it is missing, the tool cost lands under no agent.

  • The identity does not use :runtime/ incorrectly. A self-hosted agent’s cloud.resource_id must not contain :runtime/; that marks an agent on AgentCore Runtime and will misattribute it.

  • Each agent has a distinct identity. If two agents share a service.name or cloud.resource_id, their costs merge. Give each agent a stable, unique identity. See Pass the required session and agent attributes.

  • Identity values are set while the calls happen. Calls made while the values are not attached are charged to no agent.

  • Telemetry is produced by ADOT (or, for self-hosted, a correct signed OpenTelemetry setup), so identity is carried consistently. A non-supported telemetry setup can leave spans without the right identity. See Choose your setup path.