46
46
end
47
47
end
48
48
49
- context "with config.send_default_pii = true" do
50
- before do
51
- Sentry . configuration . send_default_pii = true
52
- end
53
-
54
- it "records the request's span with query string in data" do
55
- stub_normal_response
56
-
57
- transaction = Sentry . start_transaction
58
- Sentry . get_current_scope . set_span ( transaction )
59
-
60
- response = Net ::HTTP . get_response ( URI ( "http://example.com/path?foo=bar" ) )
61
-
62
- expect ( response . code ) . to eq ( "200" )
63
- expect ( transaction . span_recorder . spans . count ) . to eq ( 2 )
64
-
65
- request_span = transaction . span_recorder . spans . last
66
- expect ( request_span . op ) . to eq ( "http.client" )
67
- expect ( request_span . origin ) . to eq ( "auto.http.net_http" )
68
- expect ( request_span . start_timestamp ) . not_to be_nil
69
- expect ( request_span . timestamp ) . not_to be_nil
70
- expect ( request_span . start_timestamp ) . not_to eq ( request_span . timestamp )
71
- expect ( request_span . description ) . to eq ( "GET http://example.com/path" )
72
- expect ( request_span . data ) . to eq ( {
73
- "http.response.status_code" => 200 ,
74
- "url" => "http://example.com/path" ,
75
- "http.request.method" => "GET" ,
76
- "http.query" => "foo=bar"
77
- } )
78
- end
79
- end
80
-
81
- context "with config.send_default_pii = false" do
82
- before do
83
- Sentry . configuration . send_default_pii = false
84
- end
49
+ it "records the request's span with query string in data" do
50
+ stub_normal_response
85
51
86
- it "records the request's span without query string" do
87
- stub_normal_response
52
+ transaction = Sentry . start_transaction
53
+ Sentry . get_current_scope . set_span ( transaction )
88
54
89
- transaction = Sentry . start_transaction
90
- Sentry . get_current_scope . set_span ( transaction )
55
+ response = Net ::HTTP . get_response ( URI ( "http://example.com/path?foo=bar" ) )
91
56
92
- response = Net ::HTTP . get_response ( URI ( "http://example.com/path?foo=bar" ) )
93
-
94
- expect ( response . code ) . to eq ( "200" )
95
- expect ( transaction . span_recorder . spans . count ) . to eq ( 2 )
57
+ expect ( response . code ) . to eq ( "200" )
58
+ expect ( transaction . span_recorder . spans . count ) . to eq ( 2 )
96
59
97
- request_span = transaction . span_recorder . spans . last
98
- expect ( request_span . op ) . to eq ( "http.client" )
99
- expect ( request_span . origin ) . to eq ( "auto.http.net_http" )
100
- expect ( request_span . start_timestamp ) . not_to be_nil
101
- expect ( request_span . timestamp ) . not_to be_nil
102
- expect ( request_span . start_timestamp ) . not_to eq ( request_span . timestamp )
103
- expect ( request_span . description ) . to eq ( "GET http://example.com/path" )
104
- expect ( request_span . data ) . to eq ( {
105
- "http.response.status_code" => 200 ,
106
- "url" => "http://example.com/path" ,
107
- "http.request.method" => "GET"
108
- } )
109
- end
60
+ request_span = transaction . span_recorder . spans . last
61
+ expect ( request_span . op ) . to eq ( "http.client" )
62
+ expect ( request_span . origin ) . to eq ( "auto.http.net_http" )
63
+ expect ( request_span . start_timestamp ) . not_to be_nil
64
+ expect ( request_span . timestamp ) . not_to be_nil
65
+ expect ( request_span . start_timestamp ) . not_to eq ( request_span . timestamp )
66
+ expect ( request_span . description ) . to eq ( "GET http://example.com/path" )
67
+ expect ( request_span . data ) . to eq ( {
68
+ "http.response.status_code" => 200 ,
69
+ "url" => "http://example.com/path" ,
70
+ "http.request.method" => "GET" ,
71
+ "http.query" => "foo=bar"
72
+ } )
110
73
end
111
74
112
75
it "supports non-ascii characters in the path" do
@@ -348,7 +311,8 @@ def verify_spans(transaction)
348
311
expect ( request_span . data ) . to eq ( {
349
312
"http.response.status_code" => 200 ,
350
313
"url" => "http://example.com/path" ,
351
- "http.request.method" => "GET"
314
+ "http.request.method" => "GET" ,
315
+ "http.query" => "foo=bar"
352
316
} )
353
317
354
318
request_span = transaction . span_recorder . spans [ 2 ]
@@ -361,7 +325,8 @@ def verify_spans(transaction)
361
325
expect ( request_span . data ) . to eq ( {
362
326
"http.response.status_code" => 404 ,
363
327
"url" => "http://example.com/path" ,
364
- "http.request.method" => "GET"
328
+ "http.request.method" => "GET" ,
329
+ "http.query" => "foo=bar"
365
330
} )
366
331
end
367
332
0 commit comments