@@ -718,84 +718,4 @@ module ExcTag; end
718718 expect ( hash [ :monitor_config ] ) . to eq ( { schedule : { type : :interval , value : 30 , unit : :minute } } )
719719 end
720720 end
721-
722- describe "#generate_sentry_trace" do
723- let ( :string_io ) { StringIO . new }
724- let ( :logger ) do
725- ::Logger . new ( string_io )
726- end
727-
728- before do
729- configuration . sdk_logger = logger
730- end
731-
732- let ( :span ) { Sentry ::Span . new ( transaction : transaction ) }
733-
734- it "generates the trace with given span and logs correct message" do
735- expect ( subject . generate_sentry_trace ( span ) ) . to eq ( span . to_sentry_trace )
736- expect ( string_io . string ) . to match (
737- /\[ Tracing\] Adding sentry-trace header to outgoing request: #{ span . to_sentry_trace } /
738- )
739- end
740-
741- context "with config.propagate_traces = false" do
742- before do
743- configuration . propagate_traces = false
744- end
745-
746- it "returns nil" do
747- expect ( subject . generate_sentry_trace ( span ) ) . to eq ( nil )
748- end
749- end
750- end
751-
752- describe "#generate_baggage" do
753- before { configuration . sdk_logger = logger }
754-
755- let ( :string_io ) { StringIO . new }
756- let ( :logger ) { ::Logger . new ( string_io ) }
757- let ( :baggage ) do
758- Sentry ::Baggage . from_incoming_header (
759- "other-vendor-value-1=foo;bar;baz, sentry-trace_id=771a43a4192642f0b136d5159a501700, " \
760- "sentry-public_key=49d0f7386ad645858ae85020e393bef3, sentry-sample_rate=0.01337, " \
761- "sentry-user_id=Am%C3%A9lie, other-vendor-value-2=foo;bar;"
762- )
763- end
764-
765- let ( :span ) do
766- hub = Sentry ::Hub . new ( subject , Sentry ::Scope . new )
767- transaction = Sentry ::Transaction . new ( name : "test transaction" ,
768- baggage : baggage ,
769- hub : hub ,
770- sampled : true )
771-
772- transaction . start_child ( op : "finished child" , timestamp : Time . now . utc . iso8601 )
773- end
774-
775- it "generates the baggage header with given span and logs correct message" do
776- generated_baggage = subject . generate_baggage ( span )
777- expect ( generated_baggage ) . to eq ( span . to_baggage )
778-
779- expect ( generated_baggage ) . to eq (
780- "sentry-trace_id=771a43a4192642f0b136d5159a501700," \
781- "sentry-public_key=49d0f7386ad645858ae85020e393bef3," \
782- "sentry-sample_rate=0.01337," \
783- "sentry-user_id=Am%C3%A9lie"
784- )
785-
786- expect ( string_io . string ) . to match (
787- /\[ Tracing\] Adding baggage header to outgoing request: #{ span . to_baggage } /
788- )
789- end
790-
791- context "with config.propagate_traces = false" do
792- before do
793- configuration . propagate_traces = false
794- end
795-
796- it "returns nil" do
797- expect ( subject . generate_baggage ( span ) ) . to eq ( nil )
798- end
799- end
800- end
801721end
0 commit comments