Commit c03abe2
committed
fix: address review findings in span processor API refactor
- Fix end_with_timestamp bug: use explicit end_time_set flag instead of
sentinel comparison (start_time == end_time), which silently overwrote
user-provided timestamps equal to start time
- Restore mem::replace for span_context in end_and_export to avoid
unnecessary clone of TraceState (span is dead after data.take())
- Rewrite end_and_export to take data before shutdown check, preventing
potential data leak on re-entrant Drop
- Add FinishedSpan::is_consumed() method and document post-consume behavior
- Add instrumentation_scope() to ReadableSpan trait (OnceLock for MSRV 1.75)
- Fix FinishedSpan::Debug to always show consumed=true when span data is gone
- Add ReadableSpan trait doc explaining post-end behavior on Span
- Use InMemorySpanExporter in test to verify end_time preservation
- Normalize formatting in ReadableSpan impl for FinishedSpan
- Remove redundant imports, fix doc typo, remove double blank line
- Update benchmark results for Apple M4 Max1 parent bd2eb3a commit c03abe2
6 files changed
Lines changed: 253 additions & 134 deletions
File tree
- opentelemetry-sdk
- benches
- src/trace
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
| 39 | + | |
| 40 | + | |
36 | 41 | | |
37 | 42 | | |
38 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments