Skip to content
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

[BUG] Sentry scope migration fo 2.x #128

Open
pedroserrudo opened this issue Aug 6, 2024 · 2 comments
Open

[BUG] Sentry scope migration fo 2.x #128

pedroserrudo opened this issue Aug 6, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@pedroserrudo
Copy link
Contributor

Describe the bug
the way we get the configure scope is deprecated and will be removed in the next big release

this piece needs to be updated
sentry migration docs

integrations/sentry.py

how we do it

    def run(self, guid: str, **kwargs: Any) -> None:
        """
        Sets the Sentry transaction_id.
        """
        import sentry_sdk

        with sentry_sdk.configure_scope() as scope:
            logger.debug('Setting Sentry transaction_id to %s', guid)
            scope.set_tag('transaction_id', guid)

how we should do it

    def run(self, guid: str, **kwargs: Any) -> None:
        """
        Sets the Sentry transaction_id.
        """
        import sentry_sdk

        scope = sentry_sdk.get_isolation_scope()
        logger.debug('Setting Sentry transaction_id to %s', guid)
        scope.set_tag('transaction_id', guid)

To Reproduce

Full stack trace
/django_guid/integrations/sentry.py:37: DeprecationWarning: sentry_sdk.configure_scope is deprecated and will be removed in the next major version. Please consult our migration guide to learn how to migrate to the new API: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x#scope-configuring
with sentry_sdk.configure_scope() as scope

@pedroserrudo pedroserrudo added the bug Something isn't working label Aug 6, 2024
@JonasKs
Copy link
Member

JonasKs commented Aug 6, 2024

Thanks!

Would you like to create a PR to fix this? 😊

@pedroserrudo
Copy link
Contributor Author

Thanks!

Would you like to create a PR to fix this? 😊

Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants