@@ -61,6 +61,12 @@ public function __construct(array $options = [])
6161
6262 $ this ->configureOptions ($ this ->resolver );
6363
64+ // Migrate `strict_trace_propagation` over to `strict_trace_continuation` if not set.
65+ // If both are set, then `strict_trace_continuation` will take precedence.
66+ if (isset ($ options ['strict_trace_propagation ' ]) && !isset ($ options ['strict_trace_continuation ' ])) {
67+ $ options ['strict_trace_continuation ' ] = $ options ['strict_trace_propagation ' ];
68+ }
69+
6470 $ this ->options = $ this ->resolver ->resolve ($ options );
6571
6672 if ($ this ->options ['enable_tracing ' ] === true && $ this ->options ['traces_sample_rate ' ] === null ) {
@@ -775,25 +781,50 @@ public function setTracePropagationTargets(array $tracePropagationTargets): self
775781 }
776782
777783 /**
778- * Returns whether strict trace propagation is enabled or not.
784+ * Returns whether strict trace continuation is enabled or not.
779785 */
780- public function isStrictTracePropagationEnabled (): bool
786+ public function isStrictTraceContinuationEnabled (): bool
781787 {
782- return $ this ->options ['strict_trace_propagation ' ];
788+ /**
789+ * @var bool $result
790+ */
791+ $ result = $ this ->options ['strict_trace_continuation ' ];
792+
793+ return $ result ;
783794 }
784795
785796 /**
786- * Sets if strict trace propagation should be enabled or not.
797+ * Sets if strict trace continuation should be enabled or not.
787798 */
788- public function enableStrictTracePropagation (bool $ strictTracePropagation ): self
799+ public function enableStrictTraceContinuation (bool $ strictTraceContinuation ): self
789800 {
790- $ options = array_merge ($ this ->options , ['strict_trace_propagation ' => $ strictTracePropagation ]);
801+ $ options = array_merge ($ this ->options , ['strict_trace_continuation ' => $ strictTraceContinuation ]);
791802
792803 $ this ->options = $ this ->resolver ->resolve ($ options );
793804
794805 return $ this ;
795806 }
796807
808+ /**
809+ * Returns whether strict trace propagation is enabled or not.
810+ *
811+ * @deprecated since version 4.21. To be removed in version 5.0. Use `isStrictTraceContinuationEnabled` instead.
812+ */
813+ public function isStrictTracePropagationEnabled (): bool
814+ {
815+ return $ this ->isStrictTraceContinuationEnabled ();
816+ }
817+
818+ /**
819+ * Sets if strict trace propagation should be enabled or not.
820+ *
821+ * @deprecated since version 4.21. To be removed in version 5.0. Use `enableStrictTraceContinuation` instead.
822+ */
823+ public function enableStrictTracePropagation (bool $ strictTracePropagation ): self
824+ {
825+ return $ this ->enableStrictTraceContinuation ($ strictTracePropagation );
826+ }
827+
797828 /**
798829 * Gets a list of default tags for events.
799830 *
@@ -1352,6 +1383,7 @@ private function configureOptions(OptionsResolver $resolver): void
13521383 return $ metric ;
13531384 },
13541385 'trace_propagation_targets ' => null ,
1386+ 'strict_trace_continuation ' => false ,
13551387 'strict_trace_propagation ' => false ,
13561388 'tags ' => [],
13571389 'error_types ' => null ,
@@ -1406,6 +1438,7 @@ private function configureOptions(OptionsResolver $resolver): void
14061438 $ resolver ->setAllowedTypes ('ignore_exceptions ' , 'string[] ' );
14071439 $ resolver ->setAllowedTypes ('ignore_transactions ' , 'string[] ' );
14081440 $ resolver ->setAllowedTypes ('trace_propagation_targets ' , ['null ' , 'string[] ' ]);
1441+ $ resolver ->setAllowedTypes ('strict_trace_continuation ' , 'bool ' );
14091442 $ resolver ->setAllowedTypes ('strict_trace_propagation ' , 'bool ' );
14101443 $ resolver ->setAllowedTypes ('tags ' , 'string[] ' );
14111444 $ resolver ->setAllowedTypes ('error_types ' , ['null ' , 'int ' ]);
0 commit comments