René's URL Explorer Experiment


Title: AsyncioIntegration breaks tracing inside ThreadPoolExecutor · Issue #4508 · getsentry/sentry-python · GitHub

Open Graph Title: AsyncioIntegration breaks tracing inside ThreadPoolExecutor · Issue #4508 · getsentry/sentry-python

X Title: AsyncioIntegration breaks tracing inside ThreadPoolExecutor · Issue #4508 · getsentry/sentry-python

Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.30.0 Steps to Reproduce Init Sentry with AsyncioIntegration. Create ThreadPoolExecutor Create async task using asyncio.create_task Inside the task call loop.run_in_executor Code to...

Open Graph Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.30.0 Steps to Reproduce Init Sentry with AsyncioIntegration. Create ThreadPoolExecutor Create async task using asyncio.create_task Inside th...

X Description: How do you use Sentry? Sentry Saas (sentry.io) Version 2.30.0 Steps to Reproduce Init Sentry with AsyncioIntegration. Create ThreadPoolExecutor Create async task using asyncio.create_task Inside th...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AsyncioIntegration breaks tracing inside ThreadPoolExecutor","articleBody":"### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Version\n\n2.30.0\n\n### Steps to Reproduce\n\n1. Init Sentry with AsyncioIntegration. \n2. Create ThreadPoolExecutor\n3. Create async task using asyncio.create_task\n4. Inside the task call loop.run_in_executor\n\nCode to reproduce the issue:\n```python\nimport asyncio\nimport threading\nfrom concurrent.futures import ThreadPoolExecutor\nfrom time import sleep\nimport sentry_sdk\nfrom sentry_sdk.integrations.asyncio import AsyncioIntegration\n\n\ndef init_sentry():\n    sentry_sdk.init(\n        dsn=\"\",\n        traces_sample_rate=1.0,\n        integrations=[\n            AsyncioIntegration(),\n        ],\n    )\n\n@sentry_sdk.trace\ndef task_1():\n    print(f\"Task 1 thread ID: {threading.get_ident()}\")\n    sleep(0.5)\n\nasync def main():\n    init_sentry()    \n    print(f\"Main thread ID: {threading.get_ident()}\")    \n    executor = ThreadPoolExecutor()\n    for i in range(3):\n        task = asyncio.create_task(worker_task(executor, i))\n        await task\n\nasync def worker_task(executor: ThreadPoolExecutor, i: int):\n    with sentry_sdk.start_transaction(\n        op=\"function\", name=\"main_thread\"\n    ):\n        print(f\"\\nWorker task {i} thread ID: {threading.get_ident()}\")\n        loop = asyncio.get_event_loop()\n        await loop.run_in_executor(executor, task_1)\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main()) \n```\n\n### Expected Result\n\nSpans created in tasks that run in a ThreadPoolExecutor should be included in the transactions sent to Sentry when `AsyncioIntegration` is enabled.\n\n### Actual Result\n\nSpans created in tasks that run in a ThreadPoolExecutor are missing from the transactions sent to Sentry.\n\nOnly the first execution contains all the spans:\n![Image](https://github.com/user-attachments/assets/f614754e-b172-4ed9-a26e-febe85468231)\n\nSubsequent executions are missing spans created inside executor:\n![Image](https://github.com/user-attachments/assets/955e3fce-8657-4fd4-aae4-0944d71e55dc)\n\nRemoving `AsyncioIntegration` integration solves the issue but then many automatic async related spans are missing. Our application uses asyncio but executes many CPU intensive blocking tasks inside executor.\n\nI also tried Sentry 3.0.0a2 and it has the same issue.\n","author":{"url":"https://github.com/ollipa","@type":"Person","name":"ollipa"},"datePublished":"2025-06-23T13:45:44Z","url":"https://github.com/getsentry/sentry-python/issues/4508"}

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:a9486649-62c9-4129-4b98-5a0606a91edc
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id978A:29E0EC:3A2878:4E42E3:6B008AE5
html-safe-nonced838d2eaf1e23db9b2c21598df0103ea5aa68173a17dac95af799b029805ce86
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NzhBOjI5RTBFQzozQTI4Nzg6NEU0MkUzOjZCMDA4QUU1IiwidmlzaXRvcl9pZCI6IjEwMzI5NzczNzIwNjU4NjAzMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacdcd6bb295840250cd61bddfa6cef61548ada0dc14e9f413410507f566ac02a87
hovercard-subject-tagissue:3168272422
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/4508/issue_layout
twitter:imagehttps://opengraph.githubassets.com/df49efcc16ac59dc78bc56a8bb25f3e4cf1f69d63eac9bf69e917cccfdd20c0a/getsentry/sentry-python/issues/4508
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/df49efcc16ac59dc78bc56a8bb25f3e4cf1f69d63eac9bf69e917cccfdd20c0a/getsentry/sentry-python/issues/4508
og:image:altHow do you use Sentry? Sentry Saas (sentry.io) Version 2.30.0 Steps to Reproduce Init Sentry with AsyncioIntegration. Create ThreadPoolExecutor Create async task using asyncio.create_task Inside th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameollipa
hostnamegithub.com
expected-hostnamegithub.com
Nonec710a5cb5c47be60abfe6e8410436d409906979dbed614ef09f29c60f5535b08
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
releasebe616a2a6ec1c609d6e002896dff5352d5c5f28b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/4508#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F4508
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%2F4508
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/4508
Reloadhttps://github.com/getsentry/sentry-python/issues/4508
Reloadhttps://github.com/getsentry/sentry-python/issues/4508
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 requests41 (41)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/4508
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/4508
AsyncioIntegration breaks tracing inside ThreadPoolExecutorhttps://github.com/getsentry/sentry-python/issues/4508#top
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
State: Unreproduciblehttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22State%3A%20Unreproducible%22
State: Won't Dohttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22State%3A%20Won't%20Do%22
https://github.com/ollipa
ollipahttps://github.com/ollipa
on Jun 23, 2025https://github.com/getsentry/sentry-python/issues/4508#issue-3168272422
https://private-user-images.githubusercontent.com/25169984/457931794-f614754e-b172-4ed9-a26e-febe85468231.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUxOTc5NjksIm5iZiI6MTc5NTE5NzY2OSwicGF0aCI6Ii8yNTE2OTk4NC80NTc5MzE3OTQtZjYxNDc1NGUtYjE3Mi00ZWQ5LWEyNmUtZmViZTg1NDY4MjMxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIwVDE4MDEwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFmMDkwYTdiNGY5ZjJjOTQ2MzdhODAyZTQwNzQ3ZjcwZWQ5MzIyNTk0MDgzMzc2YWI5OTZkYTAyYjI3ZTVhYTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.dhTmvWBh4SyMpYjY1NszS4Vakzm07VGltBtY_Av1opw
https://private-user-images.githubusercontent.com/25169984/457932115-955e3fce-8657-4fd4-aae4-0944d71e55dc.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3OTUxOTc5NjksIm5iZiI6MTc5NTE5NzY2OSwicGF0aCI6Ii8yNTE2OTk4NC80NTc5MzIxMTUtOTU1ZTNmY2UtODY1Ny00ZmQ0LWFhZTQtMDk0NGQ3MWU1NWRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNjExMjAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjYxMTIwVDE4MDEwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI3NWU5OWY3YmRhMzgxNzVmZWQyZWY0NDkyOWEzMjkzOTM3OGRjY2YwMjZkOWRjOTJhMDFhYzdmZTdlYjZiZTYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JnJlc3BvbnNlLWNvbnRlbnQtdHlwZT1pbWFnZSUyRnBuZyJ9.3EfP6iuwEk4uurO5CQPK_mkTJ7rJjJNze6lk8NZvX_Q
ollipahttps://github.com/ollipa
PythonSDKhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Python%22
Bughttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Bug%22
on Jun 23, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18274250759
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 Jun 23, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18274251243
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jun 23, 2025https://github.com/getsentry/sentry-python/issues/4508
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jun 23, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18274252379
https://github.com/sentrivana
sentrivanahttps://github.com/sentrivana
on Jun 24, 2025https://github.com/getsentry/sentry-python/issues/4508#issuecomment-3000354674
@ollipahttps://github.com/ollipa
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 Jun 24, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18294323744
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jun 24, 2025https://github.com/getsentry/sentry-python/issues/4508
sentrivanahttps://github.com/sentrivana
Waiting for: Communityhttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22Waiting%20for%3A%20Community%22
on Jun 24, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18294326277
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jun 24, 2025https://github.com/getsentry/sentry-python/issues/4508
https://github.com/ollipa
ollipahttps://github.com/ollipa
on Jun 25, 2025https://github.com/getsentry/sentry-python/issues/4508#issuecomment-3003526348
@sentrivanahttps://github.com/sentrivana
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 Jun 25, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18309518101
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jun 25, 2025https://github.com/getsentry/sentry-python/issues/4508
https://github.com/antonpirker
antonpirkerhttps://github.com/antonpirker
on Jun 26, 2025https://github.com/getsentry/sentry-python/issues/4508#issuecomment-3008341035
Linearhttps://linear.app
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 Jun 26, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18335643851
getsantryhttps://github.com/apps/getsantry
GitHub Issues with 👀 3https://github.com/orgs/getsentry/projects/227
on Jun 26, 2025https://github.com/getsentry/sentry-python/issues/4508
antonpirkerhttps://github.com/antonpirker
not plannedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Jun 26, 2025https://github.com/getsentry/sentry-python/issues/4508#event-18335649989
alexander-alderman-webbhttps://github.com/alexander-alderman-webb
on Oct 8, 2025https://github.com/getsentry/sentry-python/issues/4508#event-20162474131
feat: Add concurrent.futures patch to threading integration (#4770)https://github.com/getsentry/sentry-python/commit/f32e391a6fe22cc1d26c093e63ac4499e52b9d68
#4770https://github.com/getsentry/sentry-python/pull/4770
f32e391https://github.com/getsentry/sentry-python/commit/f32e391a6fe22cc1d26c093e63ac4499e52b9d68
christophaignerhttps://github.com/christophaigner
State: Won't Dohttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22State%3A%20Won't%20Do%22
State: Unreproduciblehttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22State%3A%20Unreproducible%22
on Jul 16, 2026https://github.com/getsentry/sentry-python/issues/4508#event-28071429765
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/4508
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/4508
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
State: Unreproduciblehttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22State%3A%20Unreproducible%22
State: Won't Dohttps://github.com/getsentry/sentry-python/issues?q=state%3Aopen%20label%3A%22State%3A%20Won't%20Do%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.