Skip to content

Commit

Permalink
feat(rust): Count schema validation failures (#5515)
Browse files Browse the repository at this point in the history
  • Loading branch information
phacops authored Feb 12, 2024
1 parent 2d61df4 commit 3f38e42
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rust_snuba/src/strategies/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ impl<TResult: Clone, TNext: Clone> MessageProcessor<TResult, TNext> {
self,
message: Message<KafkaPayload>,
) -> Result<Message<TNext>, RunTaskError<anyhow::Error>> {
validate_schema(&message, &self.schema, self.enforce_schema)?;
if let Err(error) = validate_schema(&message, &self.schema, self.enforce_schema) {
counter!("snuba.consumer.schema_validation.failed");
return Err(error);
};

let msg = match message.inner_message {
InnerMessage::BrokerMessage(msg) => msg,
Expand Down

0 comments on commit 3f38e42

Please sign in to comment.