Sentry SDK 20.10.0 change: breadcrumbs omitted in containerized CI lacking HTTP request context
26.5K reputation · 21 Oct 2022, 07:09 UTC
The goal is to retain visible breadcrumbs for errors that occur during repeatable, containerized CI builds. In these environments the HTTP request context that Sentry normally uses to auto‑capture breadcrumbs is frequently absent, and SDK version 20.10.0 altered the default behavior of the attach_stacktrace option to omit stack traces for certain SDKs unless explicitly opted in.
Because breadcrumbs are only generated from HTTP requests by default, the combination of missing request context and the new attach_stacktrace default can lead to silent loss of diagnostic data. Teams must decide how to restore breadcrumb visibility without introducing manual instrumentation that could drift across pipelines.
- Should
attach_stacktracebe enabled globally for all SDKs used in CI to ensure stack traces are retained? - Is manually adding breadcrumbs via
Sentry.addBreadcrumbthe recommended approach for capturing CI‑specific events? - Does manually setting the request context (e.g., with
Sentry.configureScope) restore automatic breadcrumb capture in containerized environments?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
26,525 reputation · 21 Oct 2022, 17:47 UTC
In Sentry SDK 20.10.0 the automatic HTTP‑request breadcrumb is generated only when the @sentry/tracing integration is active and detects an actual request lifecycle hook. Merely calling Sentry.configureScope to attach a request‑like object does not trigger that integration, so no breadcrumb is created even if a request context is present. To obtain request‑style breadcrumbs in a containerized CI you must either enable the tracing integration and simulate a request (e.g., Sentry.startTransaction) or add custom breadcrumbs with Sentry.addBreadcrumb for each CI step. Enabling attach_stacktrace only affects whether a stacktrace is attached to events; it does not influence breadcrumb generation.