lib/deimos/instrumentation.rb in deimos-ruby-1.23.1.pre.beta6 vs lib/deimos/instrumentation.rb in deimos-ruby-1.23.2
- old
+ new
@@ -47,11 +47,10 @@
# as a Deimos event.
# @param event [ActiveSupport::Notifications::Event]
# @return [void]
def self.send_produce_error(event)
exception = event.payload[:exception_object]
- Rails.logger.info("Exception: #{exception}")
return unless exception
if exception.respond_to?(:failed_messages)
messages = exception.failed_messages
messages.group_by(&:topic).each do |topic, batch|
@@ -74,20 +73,18 @@
exception_object: exception,
payloads: payloads
)
end
else
- Rails.logger.info(Deimos.config.metrics)
Deimos.config.metrics&.increment(
'publish_error',
by: event.payload[:message_count] || 1
)
end
end
end
ActiveSupport::Notifications.subscribe('deliver_messages.producer.kafka') do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
- Rails.logger.info(event.payload)
KafkaListener.send_produce_error(event)
end
end