10000 feat: Add trace propagation to aiohttp integration by untitaker · Pull Request #542 · getsentry/sentry-python · GitHub
[go: up one dir, main page]

Skip to content

feat: Add trace propagation to aiohttp integration #542

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion sentry_sdk/integrations/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
request_body_within_bounds,
)
from sentry_sdk.serializer import partial_serialize
from sentry_sdk.tracing import Span
from sentry_sdk.utils import (
capture_internal_exceptions,
event_from_exception,
Expand Down Expand Up @@ -70,9 +71,13 @@ async def inner():
scope.clear_breadcrumbs()
scope.add_event_processor(_make_request_processor(weak_request))

span = Span.continue_from_headers(request.headers)
span.op = "http.server"
# If this transaction name makes it to the UI, AIOHTTP's
# URL resolver did not find a route or died trying.
with hub.start_span(transaction="generic AIOHTTP request"):
span.transaction = "generic AIOHTTP request"

with hub.start_span(span):
try:
response = await old_handle(self, request)
except HTTPException:
Expand Down
0