skills/codex/cloudwatch-observability/SKILL.md
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: cloudwatch-observability description: Amazon CloudWatch patterns for AI agent observability. Use when monitoring Bedrock agent invocations, tracking token usage, setting up alarms for agent failures, or analyzing agent performance via CloudWatch Logs Insights. --- # Amazon CloudWatch for AI Agent Observability Monitor AI agent performance, costs, and reliability using CloudWatch metrics, logs, and alarms. ## When to Use - Mo
npx skillsauth add frank-luongt/faos-skills-marketplace skills/codex/cloudwatch-observabilityInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Monitor AI agent performance, costs, and reliability using CloudWatch metrics, logs, and alarms.
Key CloudWatch metrics emitted by Amazon Bedrock:
| Metric | Namespace | Description |
|---|---|---|
| Invocations | AWS/Bedrock | Number of model invocations |
| InvocationLatency | AWS/Bedrock | End-to-end invocation time (ms) |
| InvocationClientErrors | AWS/Bedrock | 4xx errors (throttling, validation) |
| InvocationServerErrors | AWS/Bedrock | 5xx errors |
| InputTokenCount | AWS/Bedrock | Input tokens consumed |
| OutputTokenCount | AWS/Bedrock | Output tokens generated |
| InvocationThrottles | AWS/Bedrock | Throttled requests |
-- Find slowest agent invocations in the last 24h
fields @timestamp, @message
| filter @message like /agentId/
| parse @message '"invocationLatencyMs":*,' as latency
| sort latency desc
| limit 20
-- Token usage by model over time
fields @timestamp
| filter @message like /inputTokenCount/
| parse @message '"modelId":"*"' as model
| parse @message '"inputTokenCount":*,' as input_tokens
| parse @message '"outputTokenCount":*,' as output_tokens
| stats sum(input_tokens) as total_input, sum(output_tokens) as total_output by model, bin(1h)
-- Agent errors with reasoning trace
fields @timestamp, @message
| filter @message like /ERROR/ or @message like /ThrottlingException/
| sort @timestamp desc
| limit 50
import boto3
cloudwatch = boto3.client("cloudwatch")
# Alarm when daily token usage exceeds threshold
cloudwatch.put_metric_alarm(
AlarmName="bedrock-daily-token-budget",
Namespace="AWS/Bedrock",
MetricName="InputTokenCount",
Statistic="Sum",
Period=86400, # 24 hours
EvaluationPeriods=1,
Threshold=10_000_000, # 10M tokens
ComparisonOperator="GreaterThanThreshold",
AlarmActions=["arn:aws:sns:us-east-1:123456789:ai-ops-alerts"],
Dimensions=[{"Name": "ModelId", "Value": "anthropic.claude-3-5-sonnet-20241022-v2:0"}],
)
# Alarm for high error rate
cloudwatch.put_metric_alarm(
AlarmName="bedrock-agent-error-rate",
Namespace="AWS/Bedrock",
MetricName="InvocationServerErrors",
Statistic="Sum",
Period=300, # 5 minutes
EvaluationPeriods=2,
Threshold=10,
ComparisonOperator="GreaterThanThreshold",
AlarmActions=["arn:aws:sns:us-east-1:123456789:ai-ops-alerts"],
)
import boto3
cloudwatch = boto3.client("cloudwatch")
def publish_agent_metrics(agent_name: str, metrics: dict):
"""Publish custom agent metrics to CloudWatch."""
cloudwatch.put_metric_data(
Namespace="FAOS/AgentOps",
MetricData=[
{
"MetricName": "ToolCallCount",
"Value": metrics["tool_calls"],
"Unit": "Count",
"Dimensions": [{"Name": "AgentName", "Value": agent_name}],
},
{
"MetricName": "ResolutionRate",
"Value": metrics["resolved_pct"],
"Unit": "Percent",
"Dimensions": [{"Name": "AgentName", "Value": agent_name}],
},
{
"MetricName": "SessionDuration",
"Value": metrics["duration_ms"],
"Unit": "Milliseconds",
"Dimensions": [{"Name": "AgentName", "Value": agent_name}],
},
],
)
@message full-text search instead of structured filters -- parse fields firstdevelopment
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: grpo-rl-training description: GRPO reinforcement learning training with TRL. Use when applying Group Relative Policy Optimization for reasoning and task-specific model training. --- # GRPO/RL Training with TRL Expert-level guidance for implementing Group Relative Policy Optimization (GRPO) using the Transformer Reinforcement Learning (TRL) library. This skill provides battle-tested patterns, critical insights, and production-r
tools
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: graphql-architect description: Master modern GraphQL with federation, performance optimization, --- ## Use this skill when - Working on graphql architect tasks or workflows - Needing guidance, best practices, or checklists for graphql architect ## Do not use this skill when - The task is unrelated to graphql architect - You need a different domain or tool outside this scope ## Instructions - Clarify goals, constraints, and
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: grafana-dashboards description: Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces. --- # Grafana Dashboards Create and manage production-ready Grafana dashboards for comprehensive system observability. ## Do not use this skill when - The task is unrelated
development
<!-- AUTO-GENERATED by export-skills.py — DO NOT EDIT --> --- name: gptq description: GPTQ post-training quantization for generative models. Use when quantizing large models to 4-bit with calibration-based weight compression. --- # GPTQ (Generative Pre-trained Transformer Quantization) Post-training quantization method that compresses LLMs to 4-bit with minimal accuracy loss using group-wise quantization. ## When to use GPTQ **Use GPTQ when:** - Need to fit large models (70B+) on limited GPU