feat: add nested phase spans for OpenTelemetry tracing#323
Merged
Conversation
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 <no-reply@ona.com>
0da834e to
b11b412
Compare
Co-authored-by: Ona <no-reply@ona.com>
CompositeReporter didn't implement PhaseAwareReporter, so the type assertion in executeBuildPhase failed silently and phase spans were never created. Co-authored-by: Ona <no-reply@ona.com>
Phase spans were nesting under each other because the package context was being updated to the phase context. Keep the original package context so all phases are direct children of the package span. Co-authored-by: Ona <no-reply@ona.com>
Track phase contexts so GetPackageContext returns the active phase context when a phase is running. This ensures child operations like go test tracing create spans under the test phase span. Co-authored-by: Ona <no-reply@ona.com>
SBOM phase was handled inline without calling PhaseAwareReporter. Co-authored-by: Ona <no-reply@ona.com>
Co-authored-by: Ona <no-reply@ona.com>
iQQBot
approved these changes
Jan 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
PhaseAwareReporteras an optional interface to avoid breaking existing reporters.Related Issue(s)
Continues work from #298 (CLC-2107)
How to test
https://ui.honeycomb.io/gitpod/environments/ci/datasets/leeway/result/ae66p1rchvr/trace/3LPtEYh6jZK?fields%5B%5D=s_name&fields%5B%5D=s_serviceName&fields%5B%5D=c_leeway.package.name&fields%5B%5D=c_leeway.phase.name&span=220f13ac101e37de&zoom=220f13ac101e37de