def get_consumer_info(self, instance, cursor):
        """Collects metrics for all consumers on the connected database."""
        cursor.execute(self.CONSUMER_INFO_STATEMENT)
        for queue_name, consumer_name, lag, pending_events, last_seen in cursor:
            yield queue_name, consumer_name, {
                'lag': lag,
                'pending_events': pending_events,
                'last_seen': last_seen,
            }
Collects metrics for all consumers on the connected database.
src/collectors/pgq/pgq.py