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
Domain: github.com
{"@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\n\nProfile trace:\n\n\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-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f20f8792-6ad1-e5c9-6c23-cb5aae1bde16 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E454:2BE220:9EA2D:D9556:6B00B9B3 |
| html-safe-nonce | f8171642350ce84ef90c2d572b36642024d446aafa733cdaaa587b363d8c001d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDU0OjJCRTIyMDo5RUEyRDpEOTU1Njo2QjAwQjlCMyIsInZpc2l0b3JfaWQiOiI4OTY5NjAzMzc2Mjc0NzgyNjQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c7e8fd09dd1cf940cb113d03232c957fe100e23bb61139f3e2d2aec002bcdf5b |
| hovercard-subject-tag | issue:2549637143 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/3573/issue_layout |
| twitter:image | https://opengraph.githubassets.com/28dc1b59bedcb63e15e15c91a928d31ef95e0cd1cfe88bf3a4b46b4ed78fa59a/getsentry/sentry-python/issues/3573 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/28dc1b59bedcb63e15e15c91a928d31ef95e0cd1cfe88bf3a4b46b4ed78fa59a/getsentry/sentry-python/issues/3573 |
| og:image:alt | 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... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nijel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 137814779 |
| octolytics-dimension-repository_nwo | getsentry/sentry-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 137814779 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5429cbfc6aca8c7b9a086a3c8f47400346f38cc9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width