Skip to content

ref(py): Update monitor_consumer to handle FilteredPayload #69904

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
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
6 changes: 4 additions & 2 deletions src/sentry/monitors/consumers/monitor_consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from arroyo.processing.strategies.batching import BatchStep, ValuesBatch
from arroyo.processing.strategies.commit import CommitOffsets
from arroyo.processing.strategies.run_task import RunTask
from arroyo.types import BrokerValue, Commit, Message, Partition
from arroyo.types import BrokerValue, Commit, FilteredPayload, Message, Partition
from django.db import router, transaction
from sentry_kafka_schemas import get_codec
from sentry_kafka_schemas.codecs import ValidationError
Expand Down Expand Up @@ -910,8 +910,10 @@ def process_batch(executor: ThreadPoolExecutor, message: Message[ValuesBatch[Kaf
logger.exception("Failed to trigger monitor tasks")


def process_single(message: Message[KafkaPayload]):
def process_single(message: Message[KafkaPayload | FilteredPayload]):
assert not isinstance(message.payload, FilteredPayload)
assert isinstance(message.value, BrokerValue)

try:
try:
wrapper: IngestMonitorMessage = MONITOR_CODEC.decode(message.payload.value)
Expand Down
Loading