View a markdown version of this page

See your first agent cost in the console - Amazon Bedrock AgentCore

See your first agent cost in the console

When you have an agent running on AgentCore, you want to see its estimated cost in the console within minutes, so you know the feature is working before you invest in any setup. This page takes you to a first cost figure.

Prerequisites

  • An agent running on Amazon Bedrock AgentCore in a Region where the feature is available.

  • Telemetry produced by the AWS Distro for OpenTelemetry (ADOT). On the AgentCore managed harness and on AgentCore Runtime, this is the default. If you are not sure, see Choose your setup path.

  • Amazon CloudWatch Transaction Search turned on for the account and Region. It is not on by default: it is per account and per Region, and you must turn it on first. See Turn on CloudWatch Transaction Search.

Agents on the managed harness and on AgentCore Runtime show cost with no extra configuration. A self-hosted agent needs setup first; see Self-hosted compute.

CloudWatch Transaction Search is not on by default. It is per account and per Region, and you must turn it on before AgentCore can deliver spans for cost. Use one of the following procedures.

Example
CloudWatch console
To turn on CloudWatch Transaction Search in the CloudWatch console
  1. Open the CloudWatch console.

  2. In the navigation pane, expand Application Signals (APM) and choose Transaction search.

  3. Choose Enable Transaction Search.

  4. Select the checkbox to ingest spans as structured logs.

  5. Choose Save.

API
To turn on CloudWatch Transaction Search using an API
  1. Add a CloudWatch Logs resource policy that lets AWS X-Ray (xray.amazonaws.com) write spans to the aws/spans log group, with PutResourcePolicy.

  2. Set the trace segment destination to CloudWatch Logs:

    aws xray update-trace-segment-destination --destination CloudWatchLogs
Note

After you turn it on, the status can stay PENDING for more than 5 minutes. Per-resource tracing deliveries fail until the status is ACTIVE.

Step 1: Open the cost view

To open the cost view (console)

  1. Open the AgentCore console and choose Observability in the left navigation.

  2. Use the Agent and Endpoint selectors to scope the view, and set the Date range. The default is Last 7 days on the account-wide Observability page. A single resource’s own Observability tab opens on the last 24 hours.

  3. Choose the Cost tab to see the Estimated cost ($) panel.

The Observability page shows cost summary metrics, including Total token cost, Total cost, and Avg cost / session, and the view tabs Overview, Sessions, Traces, and Spans. The Cost tab shows estimated cost by session or by resource type, a session-cost-over-time chart, and a cost-by-agent list.

Step 2: Read the total and one agent

To read the total and one agent’s cost (console)

  1. Read the Total cost for the range.

  2. On the Cost tab, in the Cost by agent list, find one agent and read its estimated cost. The list is ordered by cost, highest first.

Step 3: Open one session

To open one session (console)

  1. Use the Agent selector to scope the view to one agent.

  2. Choose the Sessions view and sort by the Total cost column to surface the costliest sessions.

  3. Choose a session’s Session ID. The view switches to the Traces view filtered to that session. There is no separate session page; the session’s total is its Total cost value in the Sessions view.

To go further into a single session, see Investigate an agent session’s cost.

Why a figure may show a dash

A missing figure appears as a dash, never as $0. A dash can mean the cost could not be priced (for example, a model with no public price, or a non-commercial partition), a dimension that is not covered, or work that ran before you set up cost. See A cost shows a dash instead of a figure.

Next steps