Part of #953
What
Raise line coverage of src/tracing/exporters.cpp from 7.4% to >= 70%, and branch coverage to >= 60%.
Current state (pre-Step-1 snapshot, 2026-04-13 measurement from parent epic #953):
- Lines hit: 25 / 340 (7.4%)
- File size: 340 LOC
Note: These numbers predate the BUILD_WITH_* workflow fix (#987, #989). A re-measurement on the current develop baseline will be captured in the PR description before merging.
Why
- Tracing exporters are the egress path for span data; silent failures here mean missing observability in production with no on-host signal.
- 7.4% line coverage implies exporter error paths (network failures, backend 5xx, serialization errors, shutdown races) are largely unexercised.
- Observability code is particularly costly to debug in production — regression bugs surface only when tracing is most needed.
Where
- Source:
src/tracing/exporters.cpp
- Headers:
include/kcenon/network/tracing/exporters.hpp (verify exact path)
- Existing tests to extend:
tests/unit/tracing/ — check for existing exporter tests before adding
- May require: test doubles for exporter sinks (OTLP/HTTP/stdout backends) — inspect existing fixtures first
How
Approach
- Enumerate each concrete exporter implementation (OTLP, HTTP, stdout, noop — verify actual set in code).
- Write tests covering:
- Happy-path export of a populated span batch
- Empty-batch and oversized-batch handling
- Backend-failure paths (connection refused, timeout, 5xx response, partial write)
- Serialization edge cases (unicode span names, empty attributes, deeply nested events)
- Shutdown behavior: pending exports flushed, in-flight exports cancelled safely
- Use existing tracing test fixtures if present; otherwise add minimal sink doubles.
Acceptance Criteria
Dependencies
Part of #953
What
Raise line coverage of
src/tracing/exporters.cppfrom 7.4% to >= 70%, and branch coverage to >= 60%.Current state (pre-Step-1 snapshot, 2026-04-13 measurement from parent epic #953):
Why
Where
src/tracing/exporters.cppinclude/kcenon/network/tracing/exporters.hpp(verify exact path)tests/unit/tracing/— check for existing exporter tests before addingHow
Approach
Acceptance Criteria
src/tracing/exporters.cppline coverage >= 70%src/tracing/exporters.cppbranch coverage >= 60%tests/unit/tracing/Dependencies