Skip to content

Conversation

@WVerlaek
Copy link
Member

@WVerlaek WVerlaek commented Jan 9, 2026

Description

Add individual spans for each build phase (prep, pull, lint, test, build, package) as children of package spans. This enables detailed timeline visualization in tracing backends to identify which phases are slow.

Introduces PhaseAwareReporter as an optional interface to avoid breaking existing reporters.

Related Issue(s)

Continues work from #298 (CLC-2107)

How to test

  1. Run a build with OTel tracing enabled:
    docker run -d --name jaeger -p 4318:4318 -p 16686:16686 jaegertracing/all-in-one:latest
    export OTEL_EXPORTER_OTLP_ENDPOINT=localhost:4318
    export OTEL_EXPORTER_OTLP_INSECURE=true
    leeway build :some-package
  2. Open Jaeger UI at http://localhost:16686
  3. Verify spans show hierarchy: leeway.buildleeway.packageleeway.phase

Add PhaseAwareReporter optional interface to enable phase-level span
creation without breaking existing reporters. Phase spans are created
as children of package spans for detailed build timeline visualization.

Changes:
- Define PhaseAwareReporter interface with phase start/finish methods
- Implement phase span tracking in OTelReporter
- Modify executeBuildPhase to call phase-aware reporters via type assertion
- Remove phase duration attributes (now captured in nested spans)
- Add comprehensive phase span tests
- Update documentation with span hierarchy and phase attributes

Closes CLC-2107

Co-authored-by: Ona <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants