Skip to content

Commit d680073

Browse files
WVerlaekona-agent
andcommitted
fix: make phase spans siblings under package span
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>
1 parent 37fa8a4 commit d680073

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

pkg/leeway/reporter.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ func (r *OTelReporter) PackageBuildPhaseStarted(pkg *Package, phase PackageBuild
941941

942942
// Create phase span as child of package span
943943
phaseKey := fmt.Sprintf("%s:%s", pkgName, phase)
944-
ctx, span := r.tracer.Start(packageCtx, "leeway.phase",
944+
_, span := r.tracer.Start(packageCtx, "leeway.phase",
945945
trace.WithSpanKind(trace.SpanKindInternal),
946946
)
947947

@@ -950,9 +950,7 @@ func (r *OTelReporter) PackageBuildPhaseStarted(pkg *Package, phase PackageBuild
950950
attribute.String("leeway.phase.name", string(phase)),
951951
)
952952

953-
// Store phase span and update package context
954953
r.phaseSpans[phaseKey] = span
955-
r.packageCtxs[pkgName] = ctx
956954
}
957955

958956
// PackageBuildPhaseFinished implements PhaseAwareReporter

0 commit comments

Comments
 (0)