Skip to content

ref(crons): Remove decode compat code #69905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
15 changes: 2 additions & 13 deletions src/sentry/monitors/consumers/monitor_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from functools import partial
from typing import Literal

import msgpack
import sentry_sdk
from arroyo.backends.kafka.consumer import KafkaPayload
from arroyo.processing.strategies.abstract import ProcessingStrategy, ProcessingStrategyFactory
Expand All @@ -19,7 +18,6 @@
from arroyo.types import BrokerValue, Commit, Message, Partition
from django.db import router, transaction
from sentry_kafka_schemas import get_codec
from sentry_kafka_schemas.codecs import ValidationError
from sentry_kafka_schemas.schema_types.ingest_monitors_v1 import IngestMonitorMessage
from sentry_sdk.tracing import Span, Transaction

Expand Down Expand Up @@ -864,11 +862,7 @@ def process_batch(executor: ThreadPoolExecutor, message: Message[ValuesBatch[Kaf
assert isinstance(item, BrokerValue)

try:
try:
wrapper: IngestMonitorMessage = MONITOR_CODEC.decode(item.payload.value)
except ValidationError:
wrapper = msgpack.unpackb(item.payload.value)
logger.exception("Failed to unpack message payload via sentry_kafka_schemas")
wrapper: IngestMonitorMessage = MONITOR_CODEC.decode(item.payload.value)
except Exception:
logger.exception("Failed to unpack message payload")
continue
Expand Down Expand Up @@ -913,12 +907,7 @@ def process_batch(executor: ThreadPoolExecutor, message: Message[ValuesBatch[Kaf
def process_single(message: Message[KafkaPayload]):
assert isinstance(message.value, BrokerValue)
try:
try:
wrapper: IngestMonitorMessage = MONITOR_CODEC.decode(message.payload.value)
except ValidationError:
logger.exception("Failed to unpack message payload via sentry_kafka_schemas")
wrapper = msgpack.unpackb(message.payload.value)

wrapper: IngestMonitorMessage = MONITOR_CODEC.decode(message.payload.value)
ts = message.value.timestamp
partition = message.value.partition.index

Expand Down
Loading