Skip to content
Merged
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
17 changes: 2 additions & 15 deletions sentry_sdk/integrations/strawberry.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
from sentry_sdk.consts import OP
from sentry_sdk.integrations import DidNotEnable, Integration, _check_minimum_version
from sentry_sdk.integrations.logging import ignore_logger_for_events
from sentry_sdk.scope import should_send_default_pii
from sentry_sdk.traces import SegmentNameSource
from sentry_sdk.utils import (
capture_internal_exceptions,
ensure_integration_enabled,
event_from_exception,
has_data_collection_enabled,
logger,
package_version,
)
Expand Down Expand Up @@ -168,11 +166,8 @@ def on_operation(self) -> "Generator[None, None, None]":
return

additional_attributes: "dict[str, Any]" = {}
if has_data_collection_enabled(client.options):
if client.options["data_collection"]["graphql"]["document"]:
additional_attributes["graphql.document"] = self.execution_context.query

elif should_send_default_pii():
if client.options["data_collection"]["graphql"]["document"]:
additional_attributes["graphql.document"] = self.execution_context.query

if operation_name:
Expand Down Expand Up @@ -400,15 +395,7 @@ def _make_response_event_processor(
def inner(event: "Event", hint: "dict[str, Any]") -> "Event":
client_options = sentry_sdk.get_client().options
with capture_internal_exceptions():
if has_data_collection_enabled(client_options):
collect_response = (
"outgoing_response"
in client_options["data_collection"]["http_bodies"]
)
else:
collect_response = should_send_default_pii()

if collect_response:
if "outgoing_response" in client_options["data_collection"]["http_bodies"]:
contexts = event.setdefault("contexts", {})
contexts["response"] = {"data": response_data}

Expand Down
Loading