modelId field. If your logs are not structured, use text filters such as @message like /nova-micro/ or adapt to the fields your logger emits.
Next, open the log group for your Lambda function. Lambda creates a log group named /aws/lambda/<function-name>; in this example the function is named “AWS Lambda Bedrock Simple Generation”, so the log group matches that name. Within the log group you’ll find one or more log streams—typically one per execution environment—so you may need to inspect several streams to find the events you want.

logger.info() or logger.exception(). A plain print() would also appear in CloudWatch Logs, but using the standard logging module gives timestamps, levels, and consistent structure that supports reliable filtering and analysis.
Use structured logging in Lambda (for example
logger.info(...)) so CloudWatch Logs and Logs Insights can filter and parse your model invocation fields. Structured logs are easier to query, alert on, and integrate with dashboards.- Application request payloads sent to Bedrock (client request).
- Model responses returned by Bedrock (model output).
- Application handling of model output, including errors and downstream actions.
amazon.nova-micro and amazon.nova-pro) to view:
- Invocations — number of model calls
- InputTokenCount — tokens consumed (useful for cost/usage analysis)
- InvocationLatency — latency distribution and percentiles

Alarms: automatic detection and response
Create an alarm in CloudWatch → Alarms by selecting a Bedrock metric, choosing an aggregation/evaluation period, and setting a threshold. For example, alarm when the five-minute average invocations for Amazon Nova Micro exceeds 3,000.

- Send notifications via Amazon SNS (email, SMS, push).
- Trigger a Lambda function for automated remediation.
- Call Auto Scaling or EC2 actions.


- Logs: detailed request-level context for troubleshooting.
- Metrics: aggregated signals for trends, performance, and cost analysis.
- Alarms: automated detection and response tied to notifications or remediation workflows.
- Clear visibility into model usage and the factors that drive cost.
- Faster identification of performance issues because device-level and model-level evidence is available.
- Anomaly detection and threshold alarms to catch sudden usage spikes (CloudWatch supports anomaly detection models that compare current values to historical baselines).
- Better operational control of GenAI apps through dashboards, alerts, and automated remediation.
- Implement structured logging in your Lambda handlers to emit modelId, prompt tokens, and response metadata.
- Create dashboards that combine both application-level logs (using Logs Insights queries) and Bedrock metrics for a single-pane-of-glass view.
- Add alarms for high invocation count, sudden latency increases, or token consumption spikes, and connect alarms to SNS or automated remediation Lambdas.