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: src/patterns/gen-ai/aws-bedrock-cw-dashboard/README.md
+48-8Lines changed: 48 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,15 @@ Thanks to @jimini55, @scoropeza, @PaulVincent707, @Ishanrpatel, @lowelljehu and
44
44
45
45
This construct provides an Amazon CloudWatch dashboard to monitor metrics on Amazon Bedrock models usage. The specific list of metrics created by this construct is available [here](#default-properties).
46
46
47
-
> **Note:** Native metrics for Amazon Bedrock don't support dimensions beyond model ID. If a single account is hosting multiple workloads in the same region, the Bedrock metrics would be aggregated across all workloads.
47
+
These metrics can be used for a variety of use cases including:
48
+
49
+
- Comparing latency between different models using the InvocationLatency metric with ModelId dimension
50
+
- Measuring token count (input & output) to assist in purchasing provisioned throughput by analyzing the InputTokenCount and OutputTokenCount
51
+
- Detecting and alerting on throttling with an CloudWatch Alarm with the InvocationThrottles metric
52
+
53
+
For a specific model, if input/output tokens cost is specified, a widget with on-demand input and total tokens cost will be added. Please refer to the [Amazon Bedrock Pricing page](https://aws.amazon.com/bedrock/pricing/) for details about pricing.
54
+
55
+
> **Note:** Native runtime metrics for Amazon Bedrock don't support dimensions beyond model ID. If a single account is hosting multiple workloads in the same region, the Bedrock metrics would be aggregated across all workloads.
48
56
49
57
Here is a minimal deployable pattern definition:
50
58
@@ -55,13 +63,20 @@ import { Construct } from 'constructs';
Provide metrics for a specific model id in Bedrock
158
+
Provide runtime metrics for a specific model id in Bedrock. If input/output tokens cost is specified, a widget with on-demand input and total tokens cost will be added.
136
159
137
160
@param {string} modelName - Model name as it will appear in the dashboard row widget.
138
161
@@ -142,7 +165,7 @@ Provide metrics for a specific model id in Bedrock
142
165
143
166
### addAllModelsMonitoring()
144
167
145
-
Add a new row to the dashboard providing metrics across all model ids in Bedrock
168
+
Add a new row to the dashboard providing runtime metrics across all model ids in Bedrock.
146
169
147
170
@param {ModelMonitoringProps} props - user provided props for the monitoring.
148
171
@@ -153,16 +176,27 @@ Out-of-the-box implementation of the construct without any override will set the
153
176
### Dashboard
154
177
155
178
- Dashboard name is ```BedrockMetricsDashboard```
179
+
- CfnOutput containing the created CloudWatch dashboard URL
156
180
157
181
### addModelMonitoring
158
182
159
183
- Period (the period over which the specified statistic is applied) is set to one hour
160
184
- The following metrics are displayed for the model specified:
161
185
- InputTokenCount
162
186
- OutputTokenCount
187
+
- OutputImageCount
163
188
- InvocationLatency (min, max, average)
164
189
- Invocations (sample count)
165
190
- InvocationClientErrors
191
+
- InvocationServerErrors
192
+
- InvocationThrottles
193
+
- LegacyModelInvocations
194
+
If pricing is specified, a new widget will be added with the following metrics:
195
+
- Input Token Cost
196
+
- Output Token Cost
197
+
- Total Token Cost
198
+
199
+
More details for each one of the metrics can be found in the [documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/monitoring.html#runtime-cloudwatch-metrics)
166
200
167
201
### addAllModelsMonitoring
168
202
@@ -173,6 +207,11 @@ Out-of-the-box implementation of the construct without any override will set the
173
207
- InvocationLatency (min, max, average)
174
208
- Invocations (sample count)
175
209
- InvocationClientErrors
210
+
- InvocationServerErrors
211
+
- InvocationThrottles
212
+
- LegacyModelInvocations
213
+
214
+
More details for each one of the metrics can be found in the [documentation](https://docs.aws.amazon.com/bedrock/latest/userguide/monitoring.html#runtime-cloudwatch-metrics)
176
215
177
216
## Cost
178
217
@@ -181,6 +220,7 @@ You are responsible for the cost of the AWS services used while running this con
181
220
We recommend creating a budget through [AWS Cost Explorer](http://aws.amazon.com/aws-cost-management/aws-cost-explorer/) to help manage costs. Prices are subject to change. For full details, refer to the pricing webpage for each AWS service used in this solution:
0 commit comments