René's URL Explorer Experiment


Title: PostgreSQL getting connection info slowing down tracing · Issue #3573 · getsentry/sentry-python · GitHub

Open Graph Title: PostgreSQL getting connection info slowing down tracing · Issue #3573 · getsentry/sentry-python

X Title: PostgreSQL getting connection info slowing down tracing · Issue #3573 · getsentry/sentry-python

Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.14.0 Steps to Reproduce Use sentry-sdk with Django integration. Profile a view with doing several SQL queries. Notice there is expanduser shown on top of “Slowest Application Funct...

Open Graph Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.14.0 Steps to Reproduce Use sentry-sdk with Django integration. Profile a view with doing several SQL queries. Notice there is expanduser sh...

X Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.14.0 Steps to Reproduce Use sentry-sdk with Django integration. Profile a view with doing several SQL queries. Notice there is expanduser sh...

Opengraph URL: https://github.com/getsentry/sentry-python/issues/3573

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PostgreSQL getting connection info slowing down tracing","articleBody":"### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Version\n\n2.14.0\n\n### Steps to Reproduce\n\n1. Use sentry-sdk with Django integration.\n2. Profile a view with doing several SQL queries.\n3. Notice there is `expanduser` shown on top of “Slowest Application Functions” in Sentry.\n\n### Expected Result\n\nWe don't invoke `expanduser` at all, so it should not be there. Definitely it should not be on top of the list, taking more time than template rendering.\n\n### Actual Result\n\n`expanduser` being identified by Sentry as the slowest thing on this view:\n\n![Image](https://github.com/user-attachments/assets/e40546db-d2bc-4875-a838-be77f9d6a97b)\n\nProfile trace:\n\n![Image](https://github.com/user-attachments/assets/a0fd46e2-af53-4563-9d2f-692661098ebc)\n\nThis seems to be invoked for each `SQLCompiler.execute_sql` invocation, so for every SQL query.\n\nIt is invoked from here:\n\nhttps://github.com/getsentry/sentry-python/blob/dce589ca49a8e0e2d4eda3839836de6d8188f17b/sentry_sdk/integrations/django/__init__.py#L705\n\nThe `expanduser` then comes from psycopg3 via `Path.home()`:\n\nhttps://github.com/psycopg/psycopg/blob/af5bfa0ec2690571033e38205a98cfc8c6287134/psycopg/psycopg/_connection_info.py#L86","author":{"url":"https://github.com/nijel","@type":"Person","name":"nijel"},"datePublished":"2024-09-26T06:28:48Z","url":"https://github.com/getsentry/sentry-python/issues/3573"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:f20f8792-6ad1-e5c9-6c23-cb5aae1bde16
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE454:2BE220:9EA2D:D9556:6B00B9B3
html-safe-noncef8171642350ce84ef90c2d572b36642024d446aafa733cdaaa587b363d8c001d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDU0OjJCRTIyMDo5RUEyRDpEOTU1Njo2QjAwQjlCMyIsInZpc2l0b3JfaWQiOiI4OTY5NjAzMzc2Mjc0NzgyNjQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc7e8fd09dd1cf940cb113d03232c957fe100e23bb61139f3e2d2aec002bcdf5b
hovercard-subject-tagissue:2549637143
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/3573/issue_layout
twitter:imagehttps://opengraph.githubassets.com/28dc1b59bedcb63e15e15c91a928d31ef95e0cd1cfe88bf3a4b46b4ed78fa59a/getsentry/sentry-python/issues/3573
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/28dc1b59bedcb63e15e15c91a928d31ef95e0cd1cfe88bf3a4b46b4ed78fa59a/getsentry/sentry-python/issues/3573
og:image:altHow do you use Sentry? Sentry Saas (sentry.io) Version 2.14.0 Steps to Reproduce Use sentry-sdk with Django integration. Profile a view with doing several SQL queries. Notice there is expanduser sh...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenijel
hostnamegithub.com
expected-hostnamegithub.com
None1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release5429cbfc6aca8c7b9a086a3c8f47400346f38cc9
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/3573#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F3573
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F3573
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/issues/3573
Reloadhttps://github.com/getsentry/sentry-python/issues/3573
Reloadhttps://github.com/getsentry/sentry-python/issues/3573
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests42 (42)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
https://github.com/getsentry/sentry-python
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/3573
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/3573
#3580https://github.com/getsentry/sentry-python/pull/3580
PostgreSQL getting connection info slowing down tracinghttps://github.com/getsentry/sentry-python/issues/3573#top
#3580https://github.com/getsentry/sentry-python/pull/3580
https://github.com/szokeasaurusrex
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
https://github.com/nijel
nijelhttps://github.com/nijel
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#issue-2549637143
https://private-user-images.githubusercontent.com/212189/371010562-e40546db-d2bc-4875-a838-be77f9d6a97b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUyMDk5NTEsIm5i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MTEyMFQyMTIwNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMTExNWQwZWE2YWVkYTZlMzc3MmI1ZWFjZmM4OWY4NGE1OThlZmUxMTRkZTI0MDI1NTE3YWI5MWJmODcwNmEzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.pQBSctVfzxR3UP3n7SHkLCiuyBdJhMHebuqvhZXNQ3Q
sentry-python/sentry_sdk/integrations/django/__init__.pyhttps://github.com/getsentry/sentry-python/blob/dce589ca49a8e0e2d4eda3839836de6d8188f17b/sentry_sdk/integrations/django/__init__.py#L705
dce589chttps://github.com/getsentry/sentry-python/commit/dce589ca49a8e0e2d4eda3839836de6d8188f17b
https://github.com/psycopg/psycopg/blob/af5bfa0ec2690571033e38205a98cfc8c6287134/psycopg/psycopg/_connection_info.py#L86https://github.com/psycopg/psycopg/blob/af5bfa0ec2690571033e38205a98cfc8c6287134/psycopg/psycopg/_connection_info.py#L86
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14410419159
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14410419993
https://github.com/szokeasaurusrex
szokeasaurusrexhttps://github.com/szokeasaurusrex
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#issuecomment-2377220986
@nijelhttps://github.com/nijel
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14418222094
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573
szokeasaurusrexhttps://github.com/szokeasaurusrex
Waiting for: Communityhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Community%22
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14418223985
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573
https://github.com/nijel
nijelhttps://github.com/nijel
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#issuecomment-2377577926
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
Waiting for: Communityhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Community%22
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14420464389
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 26, 2024https://github.com/getsentry/sentry-python/issues/3573
https://github.com/szokeasaurusrex
szokeasaurusrexhttps://github.com/szokeasaurusrex
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#issuecomment-2378578817
@nijelhttps://github.com/nijel
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14426584064
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573
https://github.com/nijel
nijelhttps://github.com/nijel
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#issuecomment-2378845089
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14428200107
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573
https://github.com/nijel
nijelhttps://github.com/nijel
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#issuecomment-2378870912
#3580https://github.com/getsentry/sentry-python/pull/3580
https://github.com/szokeasaurusrex
szokeasaurusrexhttps://github.com/szokeasaurusrex
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#issuecomment-2379271865
getsantryhttps://github.com/apps/getsantry
Waiting for: Product Ownerhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Product%20Owner%22
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14431100496
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573
szokeasaurusrexhttps://github.com/szokeasaurusrex
on Sep 27, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14431102508
szokeasaurusrexhttps://github.com/szokeasaurusrex
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3580https://github.com/getsentry/sentry-python/pull/3580
on Oct 8, 2024https://github.com/getsentry/sentry-python/issues/3573#event-14552383963
stephanie-andersonhttps://github.com/stephanie-anderson
on Jun 3, 2025https://github.com/getsentry/sentry-python/issues/3573#event-17953920264
stephanie-andersonhttps://github.com/stephanie-anderson
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 3, 2025https://github.com/getsentry/sentry-python/issues/3573#event-17954536351
linearhttps://github.com/apps/linear
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jun 3, 2025https://github.com/getsentry/sentry-python/issues/3573#event-17958897029
dingsdaxhttps://github.com/dingsdax
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
on Mar 24, 2026https://github.com/getsentry/sentry-python/issues/3573#event-23842421012
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/3573
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/3573
szokeasaurusrexhttps://github.com/szokeasaurusrex
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.