Skip to content

Make Sentry DSN Call Only if Sentry is Enabled #1551

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

Open
dhruv-dwellfi opened this issue Apr 18, 2025 · 0 comments
Open

Make Sentry DSN Call Only if Sentry is Enabled #1551

dhruv-dwellfi opened this issue Apr 18, 2025 · 0 comments

Comments

@dhruv-dwellfi
Copy link

Currently the atexit function calls sentry fetch_dsn method even though we have disabled sentry usage through the COMPOSIO_DISABLE_SENTRY environment variable.

Image

this is leading to the following error when running alembic migrations through within our docker container, as the Composio backend is suffering from an outage. And this is preventing us from capturing any potential migration errors too.
The disable env var should be respected even in the atexit function.

INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
Exception ignored in atexit callback: <function update_dsn at 0x70ba413d84a0>
Traceback (most recent call last):
  File "/app/quasar/.venv/lib/python3.11/site-packages/composio/utils/sentry.py", line 126, in update_dsn
    dsn = fetch_dsn()
          ^^^^^^^^^^^
  File "/app/quasar/.venv/lib/python3.11/site-packages/composio/utils/sentry.py", line 28, in fetch_dsn
    request = requests.get(
              ^^^^^^^^^^^^^
  File "/app/quasar/.venv/lib/python3.11/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/quasar/.venv/lib/python3.11/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/quasar/.venv/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/quasar/.venv/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/quasar/.venv/lib/python3.11/site-packages/requests/adapters.py", line 700, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='backend.composio.dev', port=443): Max retries exceeded with url: /api/v1/cli/sentry-dns (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x70ba3c1e2d90>: Failed to resolve 'backend.composio.dev' ([Errno -2] Name or service not known)"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant