Open
Description
What are you really trying to do?
I was trying to use the sentry sdk sample but it does not work anymore because it indirectly uses the warning module.
Describe the bug
The with Hub(Hub.current)
context manager triggers an import of the warning module because hub is being deprecated and there is an import-time warning about that.
I am not exactly sure why the passthrough is not enough, I just started using temporal :)
Minimal Reproduction
Use a sentry recent version (mine was 2.22.0
)
Set up the sample, trigger a workflow.
It fails.
Additional context
I was able to fix by replacing with Hub(Hub.current)
with with isolation_scope()
I wonder if to avoid future issue there is a way to handle some non-available lib in the sandbox directly? To have calling warnings for instance do nothing instead of failing ?
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
NorthIsUp commentedon Mar 12, 2025
I'm having the same issue an update to the sentry code, would temporal consider adding an officially supported integration instead of a recipe?
M0NsTeRRR commentedon Mar 12, 2025
Yes, same question. Having to copy/paste this Python file from the repo and update it when it breaks is a bit strange to manage. Would a contrib module with different extras like temporalio-contrib[sentry,pydantic] (etc.) be a better idea ? I posted it there after seeing @NorthIsUp’s comment, but maybe we should open a new issue for that .
cretz commentedon Mar 17, 2025
We can discuss formal inclusion in the SDK though that is a bit of a larger ask. In the meantime, this sample was an external contribution and unfortunately did not have tests. So I think the best first step is to add tests to make sure it works and continues to work. We do have plans to address this issue hopefully soon (but we also accept PRs of course). EDIT: And we also need to move the workflow to its own file that does no sentry imports.
NorthIsUp commentedon Mar 18, 2025
@cretz appreciate that, temporal and sentry are both critical tools to our operational infrastructure and we would love for the two tool to play nice!
Natim commentedon May 20, 2025
If I understand correctly, the fix is to move the captureException code within an activity so that it is not tampered with the workflow_sandbox importer.
Had anyone have a look at #140 ?