Skip to content

Commit 51cf45a

Browse files
authored
Merge branch 'master' into py-2312-migrate-chalice
2 parents dcf2e10 + f17dad9 commit 51cf45a

18 files changed

Lines changed: 257 additions & 77 deletions

File tree

.github/workflows/changelog-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ permissions:
1515

1616
jobs:
1717
changelog-preview:
18-
uses: getsentry/craft/.github/workflows/changelog-preview.yml@4468eb9e399655a61c770534dacc03139d98aa18 # v2
18+
uses: getsentry/craft/.github/workflows/changelog-preview.yml@6143e76379c342e247687c4ab5c83d8b900cc273 # v2
1919
secrets: inherit

.github/workflows/flaky-test-detector.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
# and the repo, and writes the issue body to flaky-issue-body.md.
109109
- name: Analyze logs and summarize flaky tests
110110
if: steps.collect.outputs.collected != '0'
111-
uses: anthropics/claude-code-action@fbda2eb1bdc90d319b8d853f5deb53bca199a7c1 # v1.0.140
111+
uses: anthropics/claude-code-action@11ba60486e4aec9ddfeafcf4bb3f00b028ac2c16 # v1.0.142
112112
with:
113113
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
114114
github_token: ${{ github.token }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
token: ${{ steps.token.outputs.token }}
3232
fetch-depth: 0
3333
- name: Prepare release
34-
uses: getsentry/craft@4468eb9e399655a61c770534dacc03139d98aa18 # v2.26.8
34+
uses: getsentry/craft@6143e76379c342e247687c4ab5c83d8b900cc273 # v2.26.9
3535
env:
3636
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
3737
with:

.github/workflows/test-integrations-dbs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [ubuntu-22.04]
2222
services:
2323
postgres:
24-
image: postgres
24+
image: ghcr.io/getsentry/image-mirror-library-postgres:17-alpine
2525
env:
2626
POSTGRES_PASSWORD: sentry
2727
# Set health checks to wait until postgres has started

.github/workflows/test-integrations-tasks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [ubuntu-22.04]
2222
services:
2323
redis:
24-
image: redis
24+
image: ghcr.io/getsentry/image-mirror-library-redis:7.0.8-bullseye
2525
options: >-
2626
--health-cmd "redis-cli ping"
2727
--health-interval 10s

.github/workflows/test-integrations-web-1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
os: [ubuntu-22.04]
2222
services:
2323
postgres:
24-
image: postgres
24+
image: ghcr.io/getsentry/image-mirror-library-postgres:17-alpine
2525
env:
2626
POSTGRES_PASSWORD: sentry
2727
# Set health checks to wait until postgres has started

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include LICENSE
22
include sentry_sdk/py.typed
3+
graft tests

scripts/split_tox_gh_actions/templates/test_group.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{% endif %}
1818
{% if needs_postgres %}
1919
postgres:
20-
image: postgres
20+
image: ghcr.io/getsentry/image-mirror-library-postgres:17-alpine
2121
env:
2222
POSTGRES_PASSWORD: sentry
2323
# Set health checks to wait until postgres has started
@@ -32,7 +32,7 @@
3232
{% endif %}
3333
{% if needs_redis %}
3434
redis:
35-
image: redis
35+
image: ghcr.io/getsentry/image-mirror-library-redis:7.0.8-bullseye
3636
options: >-
3737
--health-cmd "redis-cli ping"
3838
--health-interval 10s

sentry_sdk/integrations/_asgi_common.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,20 @@ def _get_request_attributes(asgi_scope: "Any") -> "dict[str, Any]":
121121
for header, value in headers.items():
122122
attributes[f"http.request.header.{header.lower()}"] = value
123123

124-
query = _get_query(asgi_scope)
125-
if query:
126-
attributes["http.query"] = query
127-
128-
attributes["url.full"] = _get_url(
129-
asgi_scope, "http" if ty == "http" else "ws", headers.get("host")
130-
)
124+
if should_send_default_pii():
125+
query = _get_query(asgi_scope)
126+
if query:
127+
attributes["http.query"] = query
128+
129+
url_without_query_string = _get_url(
130+
asgi_scope, "http" if ty == "http" else "ws", headers.get("host")
131+
)
132+
query_string = _get_query(asgi_scope)
133+
attributes["url.full"] = (
134+
f"{url_without_query_string}?{query_string}"
135+
if query_string is not None
136+
else url_without_query_string
137+
)
131138

132139
client = asgi_scope.get("client")
133140
if client and should_send_default_pii():

sentry_sdk/integrations/litestar.py

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -287,40 +287,37 @@ async def handle_wrapper(
287287

288288
request_data = await body
289289

290-
def event_processor(event: "Event", _: "Hint") -> "Event":
291-
route_handler = scope.get("route_handler")
290+
route_handler = scope.get("route_handler")
291+
292+
func = None
293+
if route_handler.name is not None:
294+
name = route_handler.name
295+
# Accounts for use of type `Ref` in earlier versions of litestar without the need to reference it as a type
296+
elif hasattr(route_handler.fn, "value"):
297+
func = route_handler.fn.value
298+
else:
299+
func = route_handler.fn
300+
if func is not None:
301+
name = transaction_from_function(func)
302+
303+
source = SOURCE_FOR_STYLE["endpoint"]
292304

305+
if not name:
306+
name = _DEFAULT_TRANSACTION_NAME
307+
source = TransactionSource.ROUTE
308+
309+
sentry_sdk.set_transaction_name(name, source)
310+
sentry_scope.set_transaction_name(name, source)
311+
312+
def event_processor(event: "Event", _: "Hint") -> "Event":
293313
request_info = event.get("request", {})
294314
request_info["content_length"] = len(scope.get("_body", b""))
295315
if should_send_default_pii():
296316
request_info["cookies"] = extracted_request_data["cookies"]
297317
if request_data is not None:
298318
request_info["data"] = request_data
299319

300-
func = None
301-
if route_handler.name is not None:
302-
tx_name = route_handler.name
303-
# Accounts for use of type `Ref` in earlier versions of litestar without the need to reference it as a type
304-
elif hasattr(route_handler.fn, "value"):
305-
func = route_handler.fn.value
306-
else:
307-
func = route_handler.fn
308-
if func is not None:
309-
tx_name = transaction_from_function(func)
310-
311-
tx_info = {"source": SOURCE_FOR_STYLE["endpoint"]}
312-
313-
if not tx_name:
314-
tx_name = _DEFAULT_TRANSACTION_NAME
315-
tx_info = {"source": TransactionSource.ROUTE}
316-
317-
event.update(
318-
{
319-
"request": deepcopy(request_info),
320-
"transaction": tx_name,
321-
"transaction_info": tx_info,
322-
}
323-
)
320+
event["request"] = deepcopy(request_info)
324321
return event
325322

326323
sentry_scope._name = LitestarIntegration.identifier

0 commit comments

Comments
 (0)