apple / apple/swift-distributed-tracing
Future direction: Non-copyable `Span`
- Dominant language
- Swift
- Stars
- 320
- Forks
- 57
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 1
Description
Given that `Span` should be ended exactly once, and should not be shared between subprocesses or preserved after termination, it seems a potential client of the recently accepted [SE-0390](https://github.com/apple/swift-evolution/blob/main/proposals/0390-noncopyable-structs-and-enums.md). With Swift 5.9+ we can mark `Span` as non-copyable, and only allow the operation to “borrow” the span. `span.end()` will consume the span. We can also add `span.end()` in `deinit` to automatically terminate the span.
Note that this is unfortunately **very breaking**. Haven’t thought about if there’s a way to land this safely in the 1.x period.
Contributor guide
Research direction
Start by reading the issue and the linked SE-0390 proposal to understand the proposed non-copyable Span and consuming end() semantics. Determine whether this can be adopted safely during the 1.x period despite the stated breaking changes; done means a decided, implementable direction rather than an unresolved future-design discussion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- distributed-systems, observability-sre
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100