Skip to content

feat: per-run trace ID for correlating logs across worker and container #80

@eshulman2

Description

@eshulman2

Problem

Forge has Langfuse tracing at the LLM-call level, but no single identifier ties together a container spawn, the agent run inside it, the git push, and Jira operations. This makes it hard to correlate logs across components when debugging failures.

Proposed solution

At the start of ContainerRunner.run():

  1. Generate run_id = uuid4().hex
  2. Log it prominently: logger.info(f"Run ID: {run_id} | container: {container_name} | ticket: {ticket_key}")
  3. Pass it into the container as FORGE_RUN_ID env var so container-side logs can reference it
  4. Include it in Jira comments posted by the worker (e.g. collapsible footer: run: {run_id})
  5. Include it in Langfuse trace metadata

Reference

Learned from fullsend: internal/cli/run.go:security.GenerateTraceID() — injected into sandbox, used to correlate pre-scan, sandbox-scan, and output-scan findings under one ID.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    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