Skip to content

Commit 22e01fe

Browse files
chore: fix formatting and clarify observability docs
- Fix trailing whitespace in reporter_otel_test.go - Update observability.md to accurately reflect current implementation - Clarify that phase durations are captured as attributes, not spans - Move phase-level spans to future enhancements section Co-authored-by: Ona <[email protected]>
1 parent 3327487 commit 22e01fe

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

docs/observability.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,14 @@ OpenTelemetry tracing in leeway captures:
1919
```
2020
Root Span (leeway.build)
2121
├── Package Span 1 (leeway.package)
22-
│ ├── Phase: prep
23-
│ ├── Phase: pull
24-
│ ├── Phase: lint
25-
│ ├── Phase: test
26-
│ └── Phase: build
2722
├── Package Span 2 (leeway.package)
2823
└── Package Span N (leeway.package)
2924
```
3025

3126
- **Root Span**: Created when `BuildStarted` is called, represents the entire build operation
3227
- **Package Spans**: Created for each package being built, as children of the root span
33-
- **Phase Spans**: (Future) Individual build phases within each package
28+
29+
Build phase durations (prep, pull, lint, test, build, package) are captured as attributes on package spans, not as separate spans.
3430

3531
### Context Propagation
3632

@@ -298,8 +294,10 @@ Tests use in-memory exporters (`tracetest.NewInMemoryExporter()`) to verify:
298294

299295
## Future Enhancements
300296

301-
- Phase-level spans for detailed timing
302-
- Custom span events for build milestones
303-
- Metrics integration (build duration histograms, cache hit rates)
304-
- Sampling configuration
305-
- Additional exporters (Zipkin, Prometheus)
297+
Potential improvements for future iterations:
298+
299+
- **Phase-level spans**: Create individual spans for each build phase (prep, pull, lint, test, build, package) instead of just attributes
300+
- **Span events**: Add timeline events for build milestones (e.g., cache hit, dependency resolution)
301+
- **Metrics integration**: Export metrics alongside traces (build duration histograms, cache hit rates, concurrent build count)
302+
- **Sampling configuration**: Add configurable sampling strategies for high-volume builds
303+
- **Additional exporters**: Support for Zipkin, Jaeger native protocol, or Prometheus

pkg/leeway/reporter_otel_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,12 @@ func TestOTelReporter_GitHubAttributes(t *testing.T) {
364364
"GITHUB_SERVER_URL",
365365
"GITHUB_WORKFLOW_REF",
366366
}
367-
367+
368368
oldVars := make(map[string]string)
369369
for _, key := range githubVars {
370370
oldVars[key] = os.Getenv(key)
371371
}
372-
372+
373373
defer func() {
374374
for key, val := range oldVars {
375375
if val == "" {

0 commit comments

Comments
 (0)