Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies = [
"rich>=14.1.0",
"sentry-arroyo>=2.47.0",
"sentry-options==1.2.10",
"sentry-sdk>=2.74.0",
"sentry-sdk>=3.0.0",
"sortedcontainers>=2.4.0",
"taskbroker-client>=0.20.38,<1",
"typing-extensions>=4.15.0",
Expand Down
14 changes: 8 additions & 6 deletions src/launchpad/sentry_sdk_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,27 +33,29 @@
return

integrations = [
AioHttpIntegration(transaction_style="method_and_path_pattern"),
AioHttpIntegration(),
AsyncioIntegration(),
LoggingIntegration(
level=logging.DEBUG, # Capture debug and above as breadcrumbs
breadcrumb_level=logging.DEBUG, # Capture debug and above as breadcrumbs
event_level=logging.ERROR, # SDK 3.x no longer creates events from logs by default
),
StdlibIntegration(),
ThreadingIntegration(propagate_hub=True),
ThreadingIntegration(propagate_scope=True),
]

sentry_sdk.init(
dsn=config.dsn,
integrations=integrations,
data_collection={},
# SDK 3.x no longer scrubs sensitive local variables by default.
data_collection={"stack_frame_variables": {"mode": "denylist"}},
# SDK 3.x attaches stack traces to messages by default, which would regroup issues.
attach_stacktrace=False,
# Release is the git sha
release=config.release,
# Convention is to set the Sentry environment to the region (us, de, etc).
enable_logs=True,
environment=config.region,
traces_sample_rate=1.0, # Low volume service, capture all traces for now
trace_lifecycle="stream",
)

Check warning on line 58 in src/launchpad/sentry_sdk_init.py

View check run for this annotation

@sentry/warden / warden: code-review

Removing enable_logs=True drops Sentry log shipping used by workers

initialize_sentry_sdk no longer passes enable_logs=True, so worker/process log records may stop arriving as Sentry log envelopes. Restore enable_logs (or the SDK 3.x equivalent) if log shipping is still required.
Comment on lines 46 to 58

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing enable_logs=True drops Sentry log shipping used by workers

initialize_sentry_sdk no longer passes enable_logs=True, so worker/process log records may stop arriving as Sentry log envelopes. Restore enable_logs (or the SDK 3.x equivalent) if log shipping is still required.

Evidence
  • Diff removes enable_logs=True from sentry_sdk.init(...) with no replacement option or comment that it is now default.
  • tests/integration/size/test_apple_app_sizes.py::test_worker_logs_are_sent_to_sentry_under_parent_trace requires worker log envelopes (type == "log") for size.apple.binary_analysis_completed.
  • Binary workers call initialize_sentry_sdk(context.sentry_config) in _binary_worker_init, so production log shipping depends on this init path.
  • event_level=ERROR on LoggingIntegration emits Issue events, not log envelopes, and does not substitute for enable_logs.

Identified by Warden · code-review · VPW-HLJ


logger.info(f"Sentry SDK initialized for environment: {config.region}")

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/size/test_apple_app_sizes.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def test_worker_logs_are_sent_to_sentry_under_parent_trace(
monkeypatch.setenv("LAUNCHPAD_ENV", "integration")
monkeypatch.setenv("SENTRY_DSN", stub.dsn)
monkeypatch.setenv("SENTRY_REGION", "test")
sentry_sdk.init(dsn=stub.dsn, traces_sample_rate=1.0, enable_logs=True, trace_lifecycle="stream")
sentry_sdk.init(dsn=stub.dsn, traces_sample_rate=1.0)
try:
with sentry_sdk.traces.start_span(name="test") as span:
AppleAppAnalyzer(skip_treemap=False, binary_analysis_workers=2).analyze(
Expand All @@ -270,7 +270,7 @@ def test_worker_binary_spans_are_streamed_under_parent_span(
monkeypatch.setenv("LAUNCHPAD_ENV", "integration")
monkeypatch.setenv("SENTRY_DSN", stub.dsn)
monkeypatch.setenv("SENTRY_REGION", "test")
sentry_sdk.init(dsn=stub.dsn, traces_sample_rate=1.0, trace_lifecycle="stream")
sentry_sdk.init(dsn=stub.dsn, traces_sample_rate=1.0)
try:
with sentry_sdk.traces.start_span(name="test") as span:
artifact = cast(AppleArtifact, ArtifactFactory.from_path(hackernews_xcarchive))
Expand Down
16 changes: 8 additions & 8 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading