You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-guide/concepts/model-providers/amazon-bedrock.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -312,6 +312,22 @@ When you enable prompt caching, Amazon Bedrock creates a cache composed of **cac
312
312
313
313
The cache has a five-minute Time To Live (TTL), which resets with each successful cache hit. During this period, the context in the cache is preserved. If no cache hits occur within the TTL window, your cache expires.
314
314
315
+
When using prompt caching, Amazon Bedrock provides cache statistics including `CacheReadInputTokens` and `CacheWriteInputTokens`.
316
+
317
+
-`CacheWriteInputTokens`: Number of input tokens written to the cache (occurs on first request with new content).
318
+
319
+
-`CacheReadInputTokens`: Number of input tokens read from the cache (occurs on subsequent requests with cached content).
320
+
321
+
Strands automatically captures these metrics and makes them available through multiple methods:
322
+
323
+
- Method 1: AgentResult Metrics (Recommended)
324
+
325
+
Cache statistics are automatically included in the `AgentResult.metrics.accumulated_usage`
326
+
327
+
- Method 2: OpenTelemetry Traces
328
+
329
+
Cache metrics are automatically recorded in OpenTelemetry traces when telemetry is enabled
330
+
315
331
For detailed information about supported models, minimum token requirements, and other limitations, see the [Amazon Bedrock documentation on prompt caching](https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html).
0 commit comments