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

fixed a bug when using one register for several middleware #1921

Closed roma-frolov closed 3 days ago

roma-frolov commented 6 days ago

Description

If you use one register for several middleware, then a metric registration conflict occurs.

Error:

ValueError: Duplicated timeseries in CollectorRegistry: {'faststream_received_messages_created', 'faststream_received_messages', 'faststream_received_messages_total'}

The error occurs here when trying to register a duplicate metric into a register

Type of change

Checklist

Lancetnik commented 6 days ago

I think, we shouldn't rash with this PR and take a break to discuss the problem

Lancetnik commented 6 days ago

@draincoder can you help us here?