You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Child of #245 (suggested sub-deliverable from the issue thread). This is the per-model-call granularity layer of the same attribution story: #245's custom harness spans + TaskEvents give task-level correlation; Claude Code's native OTel events add prompt/tool-level cost and token forensics without parsing unstructured logs.
Background
The harness already wires Claude Code CLI telemetry behind ENABLE_CLI_TELEMETRY=1 in agent/src/runner.py (CLAUDE_CODE_ENABLE_TELEMETRY, OTLP logs export, OTEL_RESOURCE_ATTRIBUTES with task.id / repo.url / agent.model). CDK leaves it disabled today (ENABLE_CLI_TELEMETRY commented in cdk/src/stacks/agent.ts) pending verification that the ADOT sidecar forwards OTLP logs, not just traces.
Deliverables
Enable + verify — Turn on ENABLE_CLI_TELEMETRY in the AgentCore runtime env after confirming claude_code.api_request / claude_code.tool_result / claude_code.tool_decision records land in CloudWatch (application log group or AgentCore runtime log stream).
Known limitations: Claude Code emits OTLP events (LogRecords), not spans — the Traces tab may be empty while Events/logs are populated; subagent attribution gaps
Child of #245 (suggested sub-deliverable from the issue thread). This is the per-model-call granularity layer of the same attribution story: #245's custom harness spans + TaskEvents give task-level correlation; Claude Code's native OTel events add prompt/tool-level cost and token forensics without parsing unstructured logs.
Background
The harness already wires Claude Code CLI telemetry behind
ENABLE_CLI_TELEMETRY=1inagent/src/runner.py(CLAUDE_CODE_ENABLE_TELEMETRY, OTLP logs export,OTEL_RESOURCE_ATTRIBUTESwithtask.id/repo.url/agent.model). CDK leaves it disabled today (ENABLE_CLI_TELEMETRYcommented incdk/src/stacks/agent.ts) pending verification that the ADOT sidecar forwards OTLP logs, not just traces.Deliverables
ENABLE_CLI_TELEMETRYin the AgentCore runtime env after confirmingclaude_code.api_request/claude_code.tool_result/claude_code.tool_decisionrecords land in CloudWatch (application log group or AgentCore runtime log stream).task.idonOTEL_RESOURCE_ATTRIBUTESjoins to the feat(observability): end-to-end task attribution and cross-plane trace correlation #245 correlation envelope ({task_id, user_id, repo, trace_id}).docs/guides/CLAUDE_CODE_TELEMETRY.md(sync via Starlight) with:claude_code.api_requestcarriescost_usd,input_tokens,output_tokens,duration_ms)claude_code.tool_decisiondocs/design/OBSERVABILITY.mdanddocs/guides/COST_ATTRIBUTION.md(complements feat: Bedrock cost attribution — session tags, request metadata, and operator FinOps guidance #215 Bedrock billing tags).cost_usdbytask.idwhen attributes are present.Acceptance criteria
claude_code.api_requestrecords tagged withtask.idENABLE_CLI_TELEMETRYdefault documented (on vs opt-in) with sidecar forwarding notestask.idjoin to the feat(observability): end-to-end task attribution and cross-plane trace correlation #245 envelope verifiedRelated
task.idjoin key)