Skip to content

Commit a5bc67d

Browse files
merge master
2 parents d5c2343 + 11c1e90 commit a5bc67d

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

sentry_sdk/integrations/wsgi.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ def __call__(
183183
SegmentSource.COMPONENT.value,
184184
SegmentSource.ROUTE.value,
185185
SegmentSource.CUSTOM.value,
186+
SegmentSource.URL.value,
186187
]
187188
)
188189
if not already_set:

tests/integrations/django/test_basic.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,26 +1254,34 @@ def test_transaction_style(
12541254
):
12551255
sentry_init(
12561256
integrations=[DjangoIntegration(transaction_style=transaction_style)],
1257+
traces_sample_rate=1.0,
12571258
send_default_pii=True,
12581259
_experiments={"trace_lifecycle": "stream" if span_streaming else "static"},
12591260
)
12601261
if span_streaming:
1261-
items = capture_items("event")
1262+
items = capture_items("event", "span")
12621263

12631264
content, status, headers = unpack_werkzeug_response(client.get(client_url))
12641265
assert content == expected_response
12651266

1267+
sentry_sdk.flush()
1268+
spans = [item.payload for item in items if item.type == "span"]
1269+
1270+
assert spans[2]["is_segment"] is True
1271+
assert spans[2]["attributes"]["sentry.span.source"] == expected_source
1272+
12661273
(event,) = (item.payload for item in items if item.type == "event")
12671274
else:
12681275
events = capture_events()
12691276

12701277
content, status, headers = unpack_werkzeug_response(client.get(client_url))
12711278
assert content == expected_response
12721279

1273-
(event,) = events
1280+
(event, transaction) = events
1281+
assert transaction["transaction"] == expected_transaction
1282+
assert transaction["transaction_info"] == {"source": expected_source}
12741283

12751284
assert event["transaction"] == expected_transaction
1276-
assert event["transaction_info"] == {"source": expected_source}
12771285

12781286

12791287
@pytest.mark.parametrize("span_streaming", [True, False])

0 commit comments

Comments
 (0)