-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path22_get_dashboard.py
More file actions
103 lines (87 loc) · 3.06 KB
/
Copy path22_get_dashboard.py
File metadata and controls
103 lines (87 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/usr/bin/env python3
"""
Script to get CloudWatch GenAI Observability dashboard URL.
This script:
1. Gets the CloudWatch GenAI Observability dashboard URL
2. Displays the link to access monitoring
3. Provides information about available metrics
"""
import json
import os
print("="*80)
print("CLOUDWATCH GENAI OBSERVABILITY DASHBOARD")
print("="*80)
# Load runtime config if available
agent_name = "returns_refunds_agent"
agent_arn = None
if os.path.exists('runtime_config.json'):
with open('runtime_config.json') as f:
runtime_config = json.load(f)
agent_arn = runtime_config.get('agent_arn')
agent_name = runtime_config.get('agent_name', agent_name)
print(f"\nAgent Name: {agent_name}")
print(f"Agent ARN: {agent_arn}")
else:
print("\n⚠️ runtime_config.json not found - showing general dashboard")
# Build dashboard URL
region = "us-west-2"
dashboard_url = f"https://console.aws.amazon.com/cloudwatch/home?region={region}#gen-ai-observability/agent-core"
print("\n" + "="*80)
print("DASHBOARD ACCESS")
print("="*80)
print(f"\n🔗 Dashboard URL:")
print(f" {dashboard_url}")
print(f"\n📍 Region: {region}")
print("\n" + "="*80)
print("AVAILABLE METRICS & FEATURES")
print("="*80)
print("\n📊 Performance Metrics:")
print(" - Request latency and throughput")
print(" - Success/error rates")
print(" - Token usage and costs")
print(" - Model invocation statistics")
print("\n🔍 Request Traces:")
print(" - End-to-end request flow")
print(" - Tool invocation details")
print(" - Memory retrieval operations")
print(" - Gateway calls and responses")
print("\n💬 Session History:")
print(" - Conversation threads")
print(" - Actor/user interactions")
print(" - Session duration and patterns")
print("\n⚠️ Error Analysis:")
print(" - Error rates and types")
print(" - Failed requests")
print(" - Timeout patterns")
print(" - Exception traces")
print("\n🔧 Tool Usage:")
print(" - Custom tool invocations")
print(" - Gateway tool calls")
print(" - Knowledge Base retrievals")
print(" - Memory operations")
# Log group information
if agent_arn:
# Extract agent ID from ARN
agent_id = agent_arn.split('/')[-1]
log_group = f"/aws/bedrock-agentcore/runtimes/{agent_id}-DEFAULT"
print("\n" + "="*80)
print("CLOUDWATCH LOGS")
print("="*80)
print(f"\n📝 Log Group: {log_group}")
print("\n💡 View logs with AWS CLI:")
print(f" aws logs tail {log_group} --follow")
print(f"\n💡 View recent logs:")
print(f" aws logs tail {log_group} --since 1h")
print(f"\n💡 Search logs:")
print(f" aws logs filter-log-events --log-group-name {log_group} --filter-pattern 'ERROR'")
print("\n" + "="*80)
print("NEXT STEPS")
print("="*80)
print("\n1. Open the dashboard URL in your browser")
print("2. Sign in to AWS Console if prompted")
print("3. View agent performance and traces")
print("4. Analyze request patterns and errors")
print("5. Monitor tool usage and memory operations")
print("\n" + "="*80)
print("✅ Dashboard information retrieved successfully!")
print("="*80)