Commit 86c2390
feat: Add comprehensive observability CLI for agent telemetry (#360)
Add CLI commands and notebook interface for querying and visualizing OpenTelemetry traces from AgentCore Runtime agents.
## Features
### CLI Commands
- `agentcore obs list`: List traces with filtering by session, agent, time range, and errors
- `agentcore obs show`: Display detailed trace view with span hierarchy and messages
### Core Components
- **CloudWatch Logs Integration**: Query OTEL spans and runtime logs from CloudWatch
- **Message Parser**: Multi-framework support with scope-based routing for LangChain, LangGraph, Strands, and generic OTEL
- **Trace Processor**: Build span hierarchies, calculate durations, filter errors
- **Trace Visualizer**: Rich console rendering with tree views and color coding
- **Query Builder**: Time range filtering, batch pagination, multi-field queries
### Framework Support
- LangChain: Parse nested JSON with tool calls
- LangGraph: Extract input/output messages from instrumentation
- Strands: Parse standard input/output structures
- Generic OTEL: Extract gen_ai events with fallback patterns
### Testing
- Comprehensive E2E tests with real OTEL fixtures
- 210+ unit tests covering all components
- Integration tests for notebook interface
- Mock CloudWatch clients for isolated testing
### Notebook Interface
- `ObservabilityNotebook`: Jupyter-friendly interface for programmatic trace analysis
- Display traces in tables with IPython.display integration
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude <[email protected]>1 parent 76dda3a commit 86c2390
File tree
40 files changed
+21096
-3
lines changed- src/bedrock_agentcore_starter_toolkit
- cli
- observability
- notebook
- observability
- operations
- observability
- tests_integ/notebook
- tests
- client
- cli
- observability
- operations/observability
- fixtures
40 files changed
+21096
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
0 commit comments