Skip to content

Commit

Permalink
ref: remove sample event logs (#81515)
Browse files Browse the repository at this point in the history
I believe these aren't needed / used, so we can remove.

---------

Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
  • Loading branch information
JoshFerge and getsantry[bot] authored Dec 12, 2024
1 parent 3a0e9c4 commit 2b86b56
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 41 deletions.
4 changes: 0 additions & 4 deletions src/sentry/event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 0 additions & 19 deletions src/sentry/eventstream/kafka/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand Down
9 changes: 0 additions & 9 deletions src/sentry/eventstream/snuba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
9 changes: 0 additions & 9 deletions src/sentry/utils/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2b86b56

Please sign in to comment.