airtai / faststream

FastStream is a powerful and easy-to-use Python framework for building asynchronous services interacting with event streams such as Apache Kafka, RabbitMQ, NATS and Redis.
https://faststream.airt.ai/latest/
Apache License 2.0
3.15k stars 161 forks source link

fix: HandlerException ingored #1928

Closed roma-frolov closed 1 day ago

roma-frolov commented 1 day ago

Description

In the current version of FastStream, if I raise AckMessage (or any HandlerException) when processing a message, then the following line will be added to the error metric:

faststream_received_processed_messages_exceptions_total{app_name="faststream",broker="rabbitmq",exception_type="AckMessage",handler="default.queue"} 1.0

It shouldn't be like this, because HandlerExceptions are not user-defined exceptions and should not increase the error metric when they are thrown

Type of change

Checklist