Skip to content

feat(observability): end-to-end task attribution and cross-plane trace correlation #245

Description

@krokoko

Component

API or orchestration, Agent (Python runtime), CDK / infrastructure

Describe the feature

Implement end-to-end task attribution and unified cross-plane trace correlation so every action in a task's lifecycle can be traced back to {task_id, user_id, repo} and a single shared trace root — across the orchestrator, agent runtime, GitHub/API calls, TaskEvents, OpenTelemetry spans, and S3 trace artifacts.

Today attribution is partial: per-session IAM scoping (#209, shipped) tags tenant-data access; git commits carry Task-Id trailers; TaskEvents and task records hold operational fields. Gaps remain in orchestrator structured logs, agent OTel baggage propagation, external API call correlation, and stitching MicroVM traces to platform-side events for incident response.

This issue is the platform identity contract — distinct from Bedrock billing attribution (#215) and compliance export schema (#237), though all three should share the same correlation field names.

Use case

Proposed solution

Phase 0 — Correlation contract

  • Document a stable correlation envelope: { task_id, user_id, repo, trace_id, session_id? } and where each field is authoritative.
  • Define naming consistency across orchestrator logs, agent OTel resource/span attributes, TaskEvents optional fields, and git/API metadata.

Phase 1 — Propagation MVP

  • Orchestrator: inject correlation into structured logs and durable-step context for every task transition.
  • Agent: propagate envelope via OTel baggage / span attributes from session start through pipeline phases and progress events.
  • Ensure progress_writer and terminal events include correlation stamps where missing.

Phase 2 — Cross-plane trace root

  • Single trace root per task linking orchestrator spans, MicroVM agent spans, and (where available) S3 trace artifact URI.
  • Gap-fill beyond existing AgentCore session baggage (OBSERVABILITY.md); align with bgagent trace download artifact paths.

Phase 3 — Downstream attribution (follow-up OK in same issue or child)

  • GitHub commits/PR comments: consistent actor + task metadata (extend existing trailers).
  • External webhook/API calls from handlers: correlation headers or structured log fields.

Out of scope for initial delivery

Acceptance criteria

Other information

Acknowledgements

  • I may be able to implement this feature
  • This might be a breaking change

Metadata

Metadata

Assignees

Labels

P0highest priorityapprovedWhen an issue has been approved and readyenhancementNew feature or requestobservabilityTracing, attribution, dashboards, metrics, alarms, telemetry redactionsecurityCedar/HITL, IAM least-privilege, secrets, PII/DLP, guardrails, supply-chain/CVE

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions