amazon-aurora-dsql-ski…
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…
Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session/trace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.
$ npx -y skills add awslabs/mcp --skill agentcore-investigation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/agentcore-investigationContext preview
The summary Claude sees to decide when to auto-load this skill.
Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session/trace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.
name: agentcore-investigation description: Investigate Bedrock AgentCore runtime sessions via CloudWatch Logs Insights — resolve session/trace IDs, query OTEL spans, filter noise, build timelines. Use when debugging AgentCore agent sessions, tracing tool calls, or analyzing latency.
Investigate AgentCore runtime sessions by querying CloudWatch Logs Insights, filtering OpenTelemetry noise, and producing structured investigation output.
**Key capabilities:**
---
Load these files as needed for detailed guidance:
**When:** ALWAYS load before starting an investigation — ensures CloudWatch and Application Signals MCP servers are configured **Contains:** MCP server configuration for CloudWatch Logs and Application Signals, with setup instructions for Claude Code, Gemini, Codex, and Kiro CLI
**When:** Load when setting up MCP servers for the first time **Contains:** Sample MCP configuration with both CloudWatch and Application Signals servers
**When:** ALWAYS load before querying or filtering OTEL spans **Contains:** Field extraction priorities, known instrumentation scopes, noise filtering heuristics (DROP/KEEP patterns)
---
When the user provides a sessionId, resolve it to traceId(s) first. If user provides traceId directly, skip this phase.
fields traceId, @timestamp | filter attributes.session.id = "SESSION_ID" | stats count(*) as spanCount, min(@timestamp) as firstSeen, max(@timestamp) as lastSeen by traceId | sort firstSeen asc
fields @timestamp, @message | parse @message '"traceId":"*"' as traceId | parse @message '"session.id":"*"' as sessionId | filter sessionId = "SESSION_ID" or @message like "SESSION_ID" | stats earliest(@timestamp) as firstSeen, latest(@timestamp) as lastSeen, count(*) as spanCount by traceId | sort firstSeen asc | limit 50
fields traceId | filter attributes.session.id = "SESSION_ID" | sort @timestamp desc | limit 1
Store discovered traceId(s) and use them in ALL subsequent queries.
Use `describe_log_groups` with logGroupNamePrefix `/aws/bedrock-agentcore/runtimes` to find all runtime log groups.
Log group naming patterns (in priority order): - /aws/bedrock-agentcore/runtimes/<agent_id>-<endpoint_name>/otel-rt-logs (structured OTEL spans) - /aws/bedrock-agentcore/runtimes/<agent_id>-<endpoint_name>/[runtime-logs] (stdout/stderr) - /aws/bedrock-agentcore/runtimes/<agent_id>-<endpoint_name>-DEFAULT (single combined group)
AgentCore runtimes always emit OTEL spans. Some deployments split logs into a dedicated `otel-rt-logs` sub-group; others write everything into a single combined log group. Both are normal.
| Log Group Layout | Query Strategy | |-----------------|----------------| | Dedicated `otel-rt-logs` exists | Use structured field queries (`traceId`, `attributes.session.id`, etc.) | | Single combined log group | Try structured fields first — if they return 0 results, use glob-style `parse @message` |
If a dedicated `otel-rt-logs` group exists, prefer it for structured queries.
When using `parse @message` on combined log groups, prefer glob-style parse — it is simpler and avoids escaping issues:
| parse @message '"name":"*"' as spanName | parse @message '"traceId":"*"' as traceId | parse @message '"startTimeUnixNano":"*"' as startNano
Regex parse (`/pattern/`) is valid CloudWatch Logs Insights syntax but requires careful escaping of quotes and special characters inside JSON. If glob-style parse extracts the field you need, use it.
Run all 6 query types for a complete investigation. Each query has a structured version (for dedicated `otel-rt-logs`) and a glob-style parse version (for combined log groups).
Every query MUST include `| limit` to prevent context window overflow:
**Structured:**
fields @timestamp, traceId, spanId, parentSpanId, name, scope.name,
attributes.session.id, attributes.gen_ai.operation.name, attributes.gen_ai.agent.name,
startTimeUnixNano, endTimeUnixNano
| filter traceId = "TRACE_ID"
| sort startTimeUnixNano asc
| limit 50**Combined log group:**
fields @timestamp, @message | filter @message like "TRACE_ID" | parse @message '"name":"*"' as spanName | parse @message '"traceId":"*"' as traceId | parse @message '"spanId":"*"' as spanId | parse @message '"startTimeUnixNano":"*"' as startNano | parse @message '"endTimeUnixNano":"*"' as endNano | sort @timestamp asc | limit 50
**Structured:**
fields @timestamp, traceId, spanId, parentSpanId, name, scope.name,
startTimeUnixNano, endTimeUnixNano,
(endTimeUnixNano - startTimeUnixNano) / 1000000 as durationMs,
status.code, attributes.gen_ai.operation.name
| filter traceId = "TRACE_ID"
| filter ispresent(startTimeUnixNano)
| sort startTimeUnixNano asc
| limit 100**Combined log group:**
fields @timestamp, @message | filter @message like "TRACE_ID" | parse @message '"name":"*"' as spanName | parse
A suite of specialized MCP servers that help you get the most out of AWS, wherever you use MCP. The Agent Toolkit for AWS is now live!
Repo: awslabs/mcp
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…
Deprecated compatibility redirect for Aurora DSQL guidance. Use when a request concerns DSQL, Aurora DSQL, distributed SQL, DSQL schemas, migrations, queries,…