From 2b86b56267d287506abd2f285cab9ad4ade914a8 Mon Sep 17 00:00:00 2001 From: Josh Ferge Date: Thu, 12 Dec 2024 14:50:18 -0800 Subject: [PATCH] ref: remove sample event logs (#81515) I believe these aren't needed / used, so we can remove. --------- Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com> --- src/sentry/event_manager.py | 4 ---- src/sentry/eventstream/kafka/backend.py | 19 ------------------- src/sentry/eventstream/snuba.py | 9 --------- src/sentry/utils/samples.py | 9 --------- 4 files changed, 41 deletions(-) diff --git a/src/sentry/event_manager.py b/src/sentry/event_manager.py index bbb6d1dd9b3a07..781943e11843ef 100644 --- a/src/sentry/event_manager.py +++ b/src/sentry/event_manager.py @@ -185,10 +185,6 @@ def get_tag(data: dict[str, Any], key: str) -> Any | None: return None -def is_sample_event(job): - return get_tag(job["data"], "sample_event") == "yes" - - def sdk_metadata_from_event(event: Event) -> Mapping[str, Any]: """ Returns a metadata dictionary with "sdk" field populated, including a normalized name diff --git a/src/sentry/eventstream/kafka/backend.py b/src/sentry/eventstream/kafka/backend.py index 02954e35ce7588..e9b6e8bda5b1e5 100644 --- a/src/sentry/eventstream/kafka/backend.py +++ b/src/sentry/eventstream/kafka/backend.py @@ -128,17 +128,6 @@ def insert( ) -> None: event_type = self._get_event_type(event) - if event.get_tag("sample_event"): - logger.info( - "insert: inserting event in KafkaEventStream", - extra={ - "event.id": event.event_id, - "project_id": event.project_id, - "sample_event": True, - "event_type": event_type.value, - }, - ) - assign_partitions_randomly = ( (event_type == EventStreamEventType.Generic) or (event_type == EventStreamEventType.Transaction) @@ -152,14 +141,6 @@ def insert( kwargs[KW_SKIP_SEMANTIC_PARTITIONING] = True if event.get_tag("sample_event"): - logger.info( - "insert: inserting event in SnubaProtocolEventStream", - extra={ - "event.id": event.event_id, - "project_id": event.project_id, - "sample_event": True, - }, - ) kwargs["asynchronous"] = False super().insert( diff --git a/src/sentry/eventstream/snuba.py b/src/sentry/eventstream/snuba.py index bdc1835724c751..c3aa891cbf868b 100644 --- a/src/sentry/eventstream/snuba.py +++ b/src/sentry/eventstream/snuba.py @@ -112,15 +112,6 @@ def insert( eventstream_type: str | None = None, **kwargs: Any, ) -> None: - if event.get_tag("sample_event") == "true": - logger.info( - "insert: attempting to insert event in SnubaProtocolEventStream", - extra={ - "event.id": event.event_id, - "project_id": event.project_id, - "sample_event": True, - }, - ) if isinstance(event, GroupEvent) and not event.occurrence: logger.error( "`GroupEvent` passed to `EventStream.insert`. `GroupEvent` may only be passed when " diff --git a/src/sentry/utils/samples.py b/src/sentry/utils/samples.py index 9a1887fd5aa974..f3ccda8e798758 100644 --- a/src/sentry/utils/samples.py +++ b/src/sentry/utils/samples.py @@ -407,15 +407,6 @@ def create_sample_event( spans, ) - if not data: - logger.info( - "create_sample_event: no data loaded", - extra={ - "project_id": project.id, - "sample_event": True, - }, - ) - return for key in ["parent_span_id", "hash", "exclusive_time"]: if key in kwargs: data["contexts"]["trace"][key] = kwargs.pop(key)