Skip to content

Don't let Sentry import the integrations' libraries in the HTTP service - #7585

Merged
marco-c merged 1 commit into
mozilla:masterfrom
marco-c:sentry-no-auto-integrations
Nov 19, 2026
Merged

marco-c merged 1 commit into
mozilla:masterfrom
marco-c:sentry-no-auto-integrations

Conversation

@marco-c

@marco-c marco-c commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

By default, sentry_sdk.init enables the integration of each supported library it can import, which imports that library. The HTTP service image includes all of bugbug's dependencies, so each process imported langchain, langgraph, openai, anthropic, google-genai, huggingface_hub… even though the service uses none of them. With Sentry enabled, importing the web app took ~344 MB instead of ~96 MB.

The integrations are now only Sentry's defaults (logging, excepthook, threading…) and the explicit ones (Flask for the web, RQ for the workers), plus Redis for its breadcrumbs. I checked with a local Sentry sink that warnings and unhandled request exceptions are still reported, with request data, release and breadcrumbs.

Fixes #7588

By default, Sentry enables the integration of each supported library it can
import, importing it. The HTTP service's image includes all of bugbug's
dependencies, so each process imported langchain, langgraph, openai,
anthropic, google-genai, huggingface_hub..., which it doesn't use: with Sentry
enabled, importing the web app took ~344 MB instead of ~96 MB.

The integrations are now only the default ones (logging, excepthook, threading,
...) and the explicit ones (Flask for the web processes, RQ for the workers),
plus Redis, whose breadcrumbs are useful.
@marco-c
marco-c marked this pull request as ready for review November 19, 2026 20:39
@marco-c
marco-c requested a review from a team as a code owner November 19, 2026 20:39
@marco-c
marco-c merged commit 8750807 into mozilla:master Nov 19, 2026
12 of 13 checks passed
@marco-c
marco-c deleted the sentry-no-auto-integrations branch November 19, 2026 20:39
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

Successfully merging this pull request may close these issues.

Sentry imports unused AI libraries in every HTTP service process, through its auto-enabled integrations

1 participant