Commit 81cf2a5
fix(core): share one fallback trace id across span and log exporters
Address review feedback on the per-run fallback.
Giving each exporter wrapper its own FallbackExternalTraceId reintroduced
the problem it was meant to fix, one signal down: before, every wrapper
got the same generated string, so a run's spans and logs agreed. With
per-wrapper state each one reminted independently, so from the second run
on a warm process the logs carried a different trace id than the spans and
stopped correlating. Construct one instance in the TracingSDK and pass it
to every span and log wrapper.
Also stop treating an empty trace context as a run boundary. The noop
manager returns a fresh object on every call, so its identity always
differs and would remint on every export batch, shattering one run's trace
into many. Not reachable today (the wrappers are only built where a
StandardTraceContextManager is registered) but the invariant was implicit.
Rewrite the changeset for users per AGENTS.md, and format with oxfmt.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 2bc20c8 commit 81cf2a5
3 files changed
Lines changed: 96 additions & 32 deletions
File tree
- .changeset
- packages/core
- src/v3/otel
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
393 | 394 | | |
394 | 395 | | |
395 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
396 | 410 | | |
397 | 411 | | |
398 | 412 | | |
| |||
402 | 416 | | |
403 | 417 | | |
404 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
405 | 422 | | |
406 | | - | |
| 423 | + | |
407 | 424 | | |
408 | | - | |
| 425 | + | |
409 | 426 | | |
410 | 427 | | |
411 | 428 | | |
412 | 429 | | |
413 | 430 | | |
414 | 431 | | |
415 | | - | |
| 432 | + | |
416 | 433 | | |
417 | 434 | | |
418 | 435 | | |
| |||
422 | 439 | | |
423 | 440 | | |
424 | 441 | | |
425 | | - | |
| 442 | + | |
426 | 443 | | |
427 | | - | |
428 | | - | |
| 444 | + | |
| 445 | + | |
429 | 446 | | |
430 | 447 | | |
431 | 448 | | |
| |||
434 | 451 | | |
435 | 452 | | |
436 | 453 | | |
437 | | - | |
438 | | - | |
439 | 454 | | |
440 | 455 | | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
| 456 | + | |
| 457 | + | |
446 | 458 | | |
447 | 459 | | |
448 | 460 | | |
| |||
463 | 475 | | |
464 | 476 | | |
465 | 477 | | |
466 | | - | |
467 | | - | |
468 | | - | |
| 478 | + | |
469 | 479 | | |
470 | 480 | | |
471 | 481 | | |
| |||
524 | 534 | | |
525 | 535 | | |
526 | 536 | | |
527 | | - | |
528 | | - | |
529 | 537 | | |
530 | 538 | | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
| 539 | + | |
| 540 | + | |
536 | 541 | | |
537 | 542 | | |
538 | 543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
101 | | - | |
102 | | - | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
133 | | - | |
134 | | - | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
161 | 220 | | |
0 commit comments