Commit 2bc20c8
fix(core): mint the fallback external trace id per run
Runs that carry no external trace context (schedules, task-to-task
triggers) fall back to a trace id generated once in the TracingSDK
constructor. With `experimental_processKeepAlive` the TracingSDK outlives
the run, so every run on a warm process was exported to the external OTLP
endpoint under that one id — merging unrelated runs into a single trace.
This is the same warm-start hazard c043c4a fixed for the external
context path, which read the context live but deliberately left the
fallback captured at construction.
Remint the fallback when the trace context manager's context object is
reassigned, which is the run boundary. An empty configured id still means
external export is off and is left alone rather than switched on.
The test harness needed a fix too: `setGlobalManager` delegates to
`registerGlobal`, which ignores a second registration, so every test after
the first was mutating the first test's manager.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 98cdf89 commit 2bc20c8
3 files changed
Lines changed: 153 additions & 13 deletions
File tree
- .changeset
- packages/core
- src/v3/otel
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
396 | 436 | | |
| 437 | + | |
| 438 | + | |
397 | 439 | | |
398 | 440 | | |
399 | | - | |
400 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
401 | 446 | | |
402 | 447 | | |
403 | 448 | | |
404 | 449 | | |
405 | 450 | | |
406 | 451 | | |
| 452 | + | |
407 | 453 | | |
408 | 454 | | |
409 | 455 | | |
410 | | - | |
| 456 | + | |
411 | 457 | | |
412 | 458 | | |
413 | 459 | | |
| |||
419 | 465 | | |
420 | 466 | | |
421 | 467 | | |
422 | | - | |
| 468 | + | |
423 | 469 | | |
424 | 470 | | |
425 | 471 | | |
| |||
478 | 524 | | |
479 | 525 | | |
480 | 526 | | |
| 527 | + | |
| 528 | + | |
481 | 529 | | |
482 | 530 | | |
483 | | - | |
484 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
485 | 536 | | |
486 | 537 | | |
487 | 538 | | |
| 539 | + | |
488 | 540 | | |
489 | 541 | | |
490 | 542 | | |
491 | | - | |
| 543 | + | |
492 | 544 | | |
493 | 545 | | |
494 | 546 | | |
495 | 547 | | |
496 | 548 | | |
497 | 549 | | |
498 | 550 | | |
499 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
500 | 554 | | |
501 | 555 | | |
502 | 556 | | |
| |||
517 | 571 | | |
518 | 572 | | |
519 | 573 | | |
520 | | - | |
| 574 | + | |
| 575 | + | |
521 | 576 | | |
522 | 577 | | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
527 | 581 | | |
528 | 582 | | |
529 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
56 | 60 | | |
57 | 61 | | |
58 | 62 | | |
| |||
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
80 | 161 | | |
0 commit comments