|
25 | 25 | Sentry.configuration.send_default_pii = true |
26 | 26 | end |
27 | 27 |
|
28 | | - it "records the request's span with query string" do |
| 28 | + it "records the request's span with query string in data" do |
29 | 29 | stub_normal_response |
30 | 30 |
|
31 | 31 | transaction = Sentry.start_transaction |
|
41 | 41 | expect(request_span.start_timestamp).not_to be_nil |
42 | 42 | expect(request_span.timestamp).not_to be_nil |
43 | 43 | expect(request_span.start_timestamp).not_to eq(request_span.timestamp) |
44 | | - expect(request_span.description).to eq("GET http://example.com/path?foo=bar") |
45 | | - expect(request_span.data).to eq({ status: 200 }) |
| 44 | + expect(request_span.description).to eq("GET http://example.com/path") |
| 45 | + expect(request_span.data).to eq({ |
| 46 | + "status" => 200, |
| 47 | + "url" => "http://example.com/path", |
| 48 | + "http.method" => "GET", |
| 49 | + "http.query" => "foo=bar" |
| 50 | + }) |
46 | 51 | end |
47 | 52 | end |
48 | 53 |
|
49 | | - context "with config.send_default_pii = true" do |
| 54 | + context "with config.send_default_pii = false" do |
50 | 55 | before do |
51 | 56 | Sentry.configuration.send_default_pii = false |
52 | 57 | end |
53 | 58 |
|
54 | | - it "records the request's span with query string" do |
| 59 | + it "records the request's span without query string" do |
55 | 60 | stub_normal_response |
56 | 61 |
|
57 | 62 | transaction = Sentry.start_transaction |
|
68 | 73 | expect(request_span.timestamp).not_to be_nil |
69 | 74 | expect(request_span.start_timestamp).not_to eq(request_span.timestamp) |
70 | 75 | expect(request_span.description).to eq("GET http://example.com/path") |
71 | | - expect(request_span.data).to eq({ status: 200 }) |
| 76 | + expect(request_span.data).to eq({ |
| 77 | + "status" => 200, |
| 78 | + "url" => "http://example.com/path", |
| 79 | + "http.method" => "GET", |
| 80 | + }) |
72 | 81 | end |
73 | 82 | end |
74 | 83 |
|
@@ -237,15 +246,23 @@ def verify_spans(transaction) |
237 | 246 | expect(request_span.timestamp).not_to be_nil |
238 | 247 | expect(request_span.start_timestamp).not_to eq(request_span.timestamp) |
239 | 248 | expect(request_span.description).to eq("GET http://example.com/path") |
240 | | - expect(request_span.data).to eq({ status: 200 }) |
| 249 | + expect(request_span.data).to eq({ |
| 250 | + "status" => 200, |
| 251 | + "url" => "http://example.com/path", |
| 252 | + "http.method" => "GET", |
| 253 | + }) |
241 | 254 |
|
242 | 255 | request_span = transaction.span_recorder.spans[2] |
243 | 256 | expect(request_span.op).to eq("http.client") |
244 | 257 | expect(request_span.start_timestamp).not_to be_nil |
245 | 258 | expect(request_span.timestamp).not_to be_nil |
246 | 259 | expect(request_span.start_timestamp).not_to eq(request_span.timestamp) |
247 | 260 | expect(request_span.description).to eq("GET http://example.com/path") |
248 | | - expect(request_span.data).to eq({ status: 404 }) |
| 261 | + expect(request_span.data).to eq({ |
| 262 | + "status" => 404, |
| 263 | + "url" => "http://example.com/path", |
| 264 | + "http.method" => "GET", |
| 265 | + }) |
249 | 266 | end |
250 | 267 |
|
251 | 268 | it "doesn't mess different requests' data together" do |
|
0 commit comments