Commit d662111
authored
ref: Cleanup outgoing propagation_context logic (#5215)
### Description
* Add `get_baggage`, `get_traceparent` and `iter_headers` to
`PropagationContext` so that the contract is similar to `Span`.
* This clarifies that the `PropagationContext` and `Span` are themselves
responsible for constructing these values and not the `Scope`.
* Currently, it is all a mess on `Scope` which does not clarify state
responsibilities correctly on who holds and can populate what.
* Add `Baggage.populate_from_propagation_context` as a replacement for
`Baggage.from_options` (that took a `scope` argument).
* Unify all the various `propagation_context` presence checks in `Scope`
methods to `get_active_propagation_context`.
* This `get_active_propagation_context` logic then remains the central
problem to fix in the future.
### Deprecations
The following methods are thus no longer used internally and deprecated.
* `Scope.get_dynamic_sampling_context`
* `Scope.iter_headers`
* `Baggage.from_options`1 parent f8f49f6 commit d662111
File tree
3 files changed
+61
-64
lines changed- sentry_sdk
- tests
3 files changed
+61
-64
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
| 528 | + | |
| 529 | + | |
528 | 530 | | |
529 | 531 | | |
530 | 532 | | |
531 | 533 | | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | 534 | | |
537 | 535 | | |
538 | 536 | | |
| |||
547 | 545 | | |
548 | 546 | | |
549 | 547 | | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
557 | 552 | | |
558 | | - | |
559 | | - | |
| 553 | + | |
| 554 | + | |
560 | 555 | | |
561 | 556 | | |
562 | 557 | | |
| |||
570 | 565 | | |
571 | 566 | | |
572 | 567 | | |
573 | | - | |
574 | | - | |
575 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
576 | 572 | | |
577 | | - | |
578 | | - | |
| 573 | + | |
| 574 | + | |
579 | 575 | | |
580 | 576 | | |
581 | 577 | | |
| |||
599 | 595 | | |
600 | 596 | | |
601 | 597 | | |
602 | | - | |
| 598 | + | |
603 | 599 | | |
604 | 600 | | |
605 | 601 | | |
| |||
616 | 612 | | |
617 | 613 | | |
618 | 614 | | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
| 615 | + | |
| 616 | + | |
632 | 617 | | |
633 | 618 | | |
634 | 619 | | |
635 | 620 | | |
636 | 621 | | |
637 | 622 | | |
638 | 623 | | |
| 624 | + | |
639 | 625 | | |
640 | 626 | | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
| 627 | + | |
649 | 628 | | |
650 | 629 | | |
651 | 630 | | |
| |||
671 | 650 | | |
672 | 651 | | |
673 | 652 | | |
674 | | - | |
675 | | - | |
676 | | - | |
677 | | - | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
678 | 656 | | |
679 | | - | |
680 | | - | |
681 | | - | |
682 | | - | |
683 | | - | |
684 | | - | |
685 | | - | |
686 | | - | |
687 | | - | |
688 | | - | |
689 | | - | |
690 | | - | |
691 | 657 | | |
692 | 658 | | |
693 | 659 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
506 | 508 | | |
507 | 509 | | |
508 | 510 | | |
509 | | - | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
510 | 533 | | |
511 | 534 | | |
512 | 535 | | |
| |||
649 | 672 | | |
650 | 673 | | |
651 | 674 | | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
652 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
653 | 686 | | |
654 | 687 | | |
655 | 688 | | |
656 | 689 | | |
657 | 690 | | |
658 | 691 | | |
659 | | - | |
| 692 | + | |
660 | 693 | | |
661 | 694 | | |
662 | 695 | | |
663 | | - | |
664 | 696 | | |
665 | | - | |
666 | | - | |
| 697 | + | |
667 | 698 | | |
668 | 699 | | |
669 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
0 commit comments