Sha256: 536e9cc0d12d55943a3234d00e887c5541f879178edb5161f7bcc86f186b87e4

Contents?: true

Size: 1.21 KB

Versions: 4

Compression:

Stored size: 1.21 KB

Contents

# frozen_string_literal: true

module WaterDrop
  module Instrumentation
    # Instrumented is used to hookup external monitoring services to monitor how WaterDrop works
    class Notifications < ::Karafka::Core::Monitoring::Notifications
      # List of events that we support in the system and to which a monitor client can hook up
      # @note The non-error once support timestamp benchmarking
      EVENTS = %w[
        producer.connected
        producer.closing
        producer.closed

        message.produced_async
        message.produced_sync
        message.acknowledged
        message.purged
        message.buffered

        messages.produced_async
        messages.produced_sync
        messages.buffered

        transaction.started
        transaction.committed
        transaction.aborted
        transaction.marked_as_consumed
        transaction.finished

        buffer.flushed_async
        buffer.flushed_sync
        buffer.purged

        statistics.emitted

        error.occurred
      ].freeze

      # @return [WaterDrop::Instrumentation::Monitor] monitor instance for system instrumentation
      def initialize
        super
        EVENTS.each { |event| register_event(event) }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
waterdrop-2.7.0.alpha3 lib/waterdrop/instrumentation/notifications.rb
waterdrop-2.7.0.alpha2 lib/waterdrop/instrumentation/notifications.rb
waterdrop-2.7.0.alpha1 lib/waterdrop/instrumentation/notifications.rb
waterdrop-2.6.14 lib/waterdrop/instrumentation/notifications.rb