Sentry integration with anvil

Hi, I am trying to integrate sentry with anvil for my project. But I don’t see any docs or any similar stuff on anvil platform.
Does anyone have any idea how to do this? or how link to any helpful material on internet?
Thanks in advance

To be honest it looks easy enough. Just add it to custom packages and follow the sentry Python docs: Logging | Sentry for Python

I am following the docs but for some reason the errors are not sent to sentry.
I have made a decorator and it is working fine locally but not working on anvil.

def error_handler(function):
    def inner_function( *args, **kwargs):
        try:
            return function( *args, **kwargs)
        except Exception as e:
            if sentry_sdk.Hub.current.client is None:
              sentry_sdk.init(
                dsn=SENTRY_DSN,
                integrations=[SqlalchemyIntegration()]
              )
            sentry_sdk.capture_exception(e)
            sentry_sdk.flush()
            raise e
    return inner_function

I’d start by getting rid of the SQL Alchemy in integrations and go with something simple like the Logging integration, make sure you are getting signal, and then work up to whatever else you are aiming for.

I am trying this code snippet

sentry_sdk.init(
  dsn=SENTRY_DSN,
  integrations=[
      LoggingIntegration(
          level=logging.INFO,       
          event_level=logging.INFO   
      ),
  ],
)

  logging.debug("I am ignored")
  logging.info("I am a breadcrumb")
  logging.error("I am an event", extra=dict(bar=43))
  logging.exception("An exception happened")
if sentry_sdk.Hub.current.client is not None:
      print("Sentry SDK is initialized.")
  else:
      print("Sentry SDK is not properly initialized.")

and it is giving me sentry initialization message but he logs are not appearing in sentry.

Okay, so you’re going to be in for the long haul. If I remember rightly, you can interact via HTTP with Sentry - if I’ve not hallucinated that…