Recorder

Amazon Bedrock

Wrap each Converse or InvokeModel call. Model names such as us.anthropic.claude-sonnet-5-v1:0 are matched to the price table automatically.

  1. Copy harness_recorder.py into your service (Lambda, ECS or EC2).
  2. Wrap each call; usage_from reads Converse usage and the Anthropic usage block.
  3. Download the events from CloudWatch with your own AWS access.

Download from CloudWatch (you run this)

aws logs filter-log-events --log-group-name <group> \
  --start-time $(($(date +%s) - 2592000))000 \
  --filter-pattern '{ $.workflow_id = "<workflow>" }' \
  --query 'events[].message' --output text | tr '\t' '\n' > .harness/runs/cloudwatch.jsonl

Where the log lands

In CloudWatch Logs.

How it reaches the harness

You download it with the AWS CLI and your own credentials.

For Bedrock Agents, turn on tracing in InvokeAgent and record each orchestration step's model usage from the trace events.

Read the full guide on GitHub

Add the recorder

20 platform guides in total.