@@ -85,7 +85,7 @@ impl<'a> Builder<'a> {
8585 self . setup_public_tracing ( ) ?;
8686 self . setup_public_metrics ( ) ?;
8787 self . setup_apollo_metrics ( ) ?;
88- self . setup_propagation ( ) ? ;
88+ self . setup_propagation ( ) ;
8989 Ok ( ( self . activation , self . endpoints , self . apollo_sender ) )
9090 } )
9191 }
@@ -206,13 +206,12 @@ impl<'a> Builder<'a> {
206206 || previous_config. exporters . tracing . common != self . config . exporters . tracing . common
207207 }
208208
209- fn setup_propagation ( & mut self ) -> Result < ( ) , BoxError > {
209+ fn setup_propagation ( & mut self ) {
210210 let propagators = create_propagator (
211211 & self . config . exporters . tracing . propagation ,
212212 & self . config . exporters . tracing ,
213- ) ? ;
213+ ) ;
214214 self . activation . with_tracer_propagator ( propagators) ;
215- Ok ( ( ) )
216215 }
217216
218217 fn setup_logging ( & mut self ) {
@@ -246,7 +245,6 @@ mod tests {
246245 use crate :: plugins:: telemetry:: config:: Exporters ;
247246 use crate :: plugins:: telemetry:: config:: Instrumentation ;
248247 use crate :: plugins:: telemetry:: config:: Metrics ;
249- use crate :: plugins:: telemetry:: config:: Propagation ;
250248 use crate :: plugins:: telemetry:: config:: Tracing ;
251249
252250 fn create_default_config ( ) -> Conf {
@@ -628,242 +626,4 @@ mod tests {
628626 "Tracer provider should reload when span limits change"
629627 ) ;
630628 }
631-
632- #[ tokio:: test( flavor = "multi_thread" ) ]
633- async fn test_datadog_propagation_only_passes ( ) {
634- let mut config = create_config_with_apollo_enabled ( ) ;
635- config. exporters . tracing . propagation = Propagation {
636- datadog : Some ( true ) ,
637- ..Default :: default ( )
638- } ;
639-
640- let builder = Builder :: new ( & None , & config) ;
641- assert ! ( builder. build( ) . is_ok( ) ) ;
642- }
643-
644- #[ tokio:: test( flavor = "multi_thread" ) ]
645- async fn test_datadog_with_baggage_propagation_passes ( ) {
646- let mut config = create_config_with_apollo_enabled ( ) ;
647- config. exporters . tracing . propagation = Propagation {
648- datadog : Some ( true ) ,
649- baggage : true ,
650- ..Default :: default ( )
651- } ;
652-
653- let builder = Builder :: new ( & None , & config) ;
654- assert ! ( builder. build( ) . is_ok( ) ) ;
655- }
656-
657- #[ tokio:: test( flavor = "multi_thread" ) ]
658- async fn test_jaeger_propagation_only_passes ( ) {
659- let mut config = create_config_with_apollo_enabled ( ) ;
660- config. exporters . tracing . propagation = Propagation {
661- jaeger : true ,
662- ..Default :: default ( )
663- } ;
664-
665- let builder = Builder :: new ( & None , & config) ;
666- assert ! ( builder. build( ) . is_ok( ) ) ;
667- }
668-
669- #[ tokio:: test( flavor = "multi_thread" ) ]
670- async fn test_datadog_with_jaeger_propagation_fails ( ) {
671- let mut config = create_config_with_apollo_enabled ( ) ;
672- config. exporters . tracing . propagation = Propagation {
673- datadog : Some ( true ) ,
674- jaeger : true ,
675- ..Default :: default ( )
676- } ;
677-
678- let builder = Builder :: new ( & None , & config) ;
679- assert_eq ! (
680- "datadog propagation cannot be used with any other propagator except for baggage" ,
681- builder. build( ) . err( ) . unwrap( ) . to_string( )
682- ) ;
683- }
684-
685- #[ tokio:: test( flavor = "multi_thread" ) ]
686- async fn test_datadog_with_trace_context_propagation_fails ( ) {
687- let mut config = create_config_with_apollo_enabled ( ) ;
688- config. exporters . tracing . propagation = Propagation {
689- datadog : Some ( true ) ,
690- trace_context : true ,
691- ..Default :: default ( )
692- } ;
693-
694- let builder = Builder :: new ( & None , & config) ;
695- assert_eq ! (
696- "datadog propagation cannot be used with any other propagator except for baggage" ,
697- builder. build( ) . err( ) . unwrap( ) . to_string( )
698- ) ;
699- }
700-
701- #[ tokio:: test( flavor = "multi_thread" ) ]
702- async fn test_datadog_with_zipkin_propagation_fails ( ) {
703- let mut config = create_config_with_apollo_enabled ( ) ;
704- config. exporters . tracing . propagation = Propagation {
705- datadog : Some ( true ) ,
706- zipkin : true ,
707- ..Default :: default ( )
708- } ;
709-
710- let builder = Builder :: new ( & None , & config) ;
711- assert_eq ! (
712- "datadog propagation cannot be used with any other propagator except for baggage" ,
713- builder. build( ) . err( ) . unwrap( ) . to_string( )
714- ) ;
715- }
716-
717- #[ tokio:: test( flavor = "multi_thread" ) ]
718- async fn test_datadog_with_aws_xray_propagation_fails ( ) {
719- let mut config = create_config_with_apollo_enabled ( ) ;
720- config. exporters . tracing . propagation = Propagation {
721- datadog : Some ( true ) ,
722- aws_xray : true ,
723- ..Default :: default ( )
724- } ;
725-
726- let builder = Builder :: new ( & None , & config) ;
727- assert_eq ! (
728- "datadog propagation cannot be used with any other propagator except for baggage" ,
729- builder. build( ) . err( ) . unwrap( ) . to_string( )
730- ) ;
731- }
732-
733- #[ tokio:: test( flavor = "multi_thread" ) ]
734- async fn test_datadog_exporter_enabled_with_datadog_propagation_only_passes ( ) {
735- let mut config = create_config_with_apollo_enabled ( ) ;
736- config. exporters . tracing . datadog . enabled = true ;
737- config. exporters . tracing . propagation = Propagation {
738- datadog : Some ( true ) ,
739- ..Default :: default ( )
740- } ;
741-
742- let builder = Builder :: new ( & None , & config) ;
743- assert ! ( builder. build( ) . is_ok( ) ) ;
744- }
745-
746- #[ tokio:: test( flavor = "multi_thread" ) ]
747- async fn test_datadog_exporter_enabled_with_datadog_baggage_propagation_passes ( ) {
748- let mut config = create_config_with_apollo_enabled ( ) ;
749- config. exporters . tracing . datadog . enabled = true ;
750- config. exporters . tracing . propagation = Propagation {
751- datadog : Some ( true ) ,
752- baggage : true ,
753- ..Default :: default ( )
754- } ;
755-
756- let builder = Builder :: new ( & None , & config) ;
757- assert ! ( builder. build( ) . is_ok( ) ) ;
758- }
759-
760- #[ tokio:: test( flavor = "multi_thread" ) ]
761- async fn test_datadog_exporter_enabled_with_jaeger_propagation_only_fails ( ) {
762- let mut config = create_config_with_apollo_enabled ( ) ;
763- config. exporters . tracing . datadog . enabled = true ;
764- config. exporters . tracing . propagation = Propagation {
765- jaeger : true ,
766- ..Default :: default ( )
767- } ;
768-
769- let builder = Builder :: new ( & None , & config) ;
770- assert_eq ! (
771- "datadog propagation must be explicitly disabled if the datadog exporter is enabled and any propagator other than baggage is enabled" ,
772- builder. build( ) . err( ) . unwrap( ) . to_string( )
773- ) ;
774- }
775-
776- #[ tokio:: test( flavor = "multi_thread" ) ]
777- async fn test_datadog_exporter_enabled_with_datadog_jaeger_propagation_fails ( ) {
778- let mut config = create_config_with_apollo_enabled ( ) ;
779- config. exporters . tracing . datadog . enabled = true ;
780- config. exporters . tracing . propagation = Propagation {
781- datadog : Some ( true ) ,
782- jaeger : true ,
783- ..Default :: default ( )
784- } ;
785-
786- let builder = Builder :: new ( & None , & config) ;
787- assert_eq ! (
788- "if the datadog exporter is enabled and any other propagator is enabled, the datadog propagator must be disabled" ,
789- builder. build( ) . err( ) . unwrap( ) . to_string( )
790- ) ;
791- }
792-
793- #[ tokio:: test( flavor = "multi_thread" ) ]
794- async fn test_datadog_exporter_enabled_with_datadog_trace_context_propagation_fails ( ) {
795- let mut config = create_config_with_apollo_enabled ( ) ;
796- config. exporters . tracing . datadog . enabled = true ;
797- config. exporters . tracing . propagation = Propagation {
798- datadog : Some ( true ) ,
799- trace_context : true ,
800- ..Default :: default ( )
801- } ;
802-
803- let builder = Builder :: new ( & None , & config) ;
804- assert_eq ! (
805- "if the datadog exporter is enabled and any other propagator is enabled, the datadog propagator must be disabled" ,
806- builder. build( ) . err( ) . unwrap( ) . to_string( )
807- ) ;
808- }
809-
810- #[ tokio:: test( flavor = "multi_thread" ) ]
811- async fn test_datadog_exporter_enabled_with_datadog_zipkin_propagation_fails ( ) {
812- let mut config = create_config_with_apollo_enabled ( ) ;
813- config. exporters . tracing . datadog . enabled = true ;
814- config. exporters . tracing . propagation = Propagation {
815- datadog : Some ( true ) ,
816- zipkin : true ,
817- ..Default :: default ( )
818- } ;
819-
820- let builder = Builder :: new ( & None , & config) ;
821- assert_eq ! (
822- "if the datadog exporter is enabled and any other propagator is enabled, the datadog propagator must be disabled" ,
823- builder. build( ) . err( ) . unwrap( ) . to_string( )
824- ) ;
825- }
826-
827- #[ tokio:: test( flavor = "multi_thread" ) ]
828- async fn test_datadog_exporter_enabled_with_datadog_aws_xray_propagation_fails ( ) {
829- let mut config = create_config_with_apollo_enabled ( ) ;
830- config. exporters . tracing . datadog . enabled = true ;
831- config. exporters . tracing . propagation = Propagation {
832- datadog : Some ( true ) ,
833- aws_xray : true ,
834- ..Default :: default ( )
835- } ;
836-
837- let builder = Builder :: new ( & None , & config) ;
838- assert_eq ! (
839- "if the datadog exporter is enabled and any other propagator is enabled, the datadog propagator must be disabled" ,
840- builder. build( ) . err( ) . unwrap( ) . to_string( )
841- ) ;
842- }
843-
844- #[ tokio:: test( flavor = "multi_thread" ) ]
845- async fn test_datadog_exporter_enabled_with_otlp_exporter_enabled_fails ( ) {
846- let mut config = create_config_with_apollo_enabled ( ) ;
847- config. exporters . tracing . datadog . enabled = true ;
848- config. exporters . tracing . otlp . enabled = true ;
849-
850- let builder = Builder :: new ( & None , & config) ;
851- assert_eq ! (
852- "datadog propagation must be explicitly disabled if the datadog exporter is enabled and any propagator other than baggage is enabled" ,
853- builder. build( ) . err( ) . unwrap( ) . to_string( )
854- ) ;
855- }
856-
857- #[ tokio:: test( flavor = "multi_thread" ) ]
858- async fn test_datadog_exporter_enabled_with_zipkin_exporter_enabled_fails ( ) {
859- let mut config = create_config_with_apollo_enabled ( ) ;
860- config. exporters . tracing . datadog . enabled = true ;
861- config. exporters . tracing . zipkin . enabled = true ;
862-
863- let builder = Builder :: new ( & None , & config) ;
864- assert_eq ! (
865- "datadog propagation must be explicitly disabled if the datadog exporter is enabled and any propagator other than baggage is enabled" ,
866- builder. build( ) . err( ) . unwrap( ) . to_string( )
867- ) ;
868- }
869629}
0 commit comments