Module: Kafka::Prometheus

Defined in:
lib/kafka/prometheus.rb

Defined Under Namespace

Classes: AsyncProducerSubscriber, ConnectionSubscriber, ConsumerSubscriber, FetcherSubscriber, ProducerSubscriber

Constant Summary collapse

SIZE_BUCKETS =
[1, 10, 100, 1000, 10_000, 100_000, 1_000_000].freeze
LATENCY_BUCKETS =
[0.0001, 0.001, 0.01, 0.1, 1.0, 10, 100, 1000].freeze
DELAY_BUCKETS =
[1, 3, 10, 30, 100, 300, 1000, 3000, 10_000, 30_000].freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.registryObject

Returns the value of attribute registry


30
31
32
# File 'lib/kafka/prometheus.rb', line 30

def registry
  @registry
end

Class Method Details

.start(registry = ::Prometheus::Client.registry) ⇒ Object


32
33
34
35
36
37
38
39
# File 'lib/kafka/prometheus.rb', line 32

def start(registry = ::Prometheus::Client.registry)
  @registry = registry
  ConnectionSubscriber.attach_to 'connection.kafka'
  ConsumerSubscriber.attach_to 'consumer.kafka'
  ProducerSubscriber.attach_to 'producer.kafka'
  AsyncProducerSubscriber.attach_to 'async_producer.kafka'
  FetcherSubscriber.attach_to 'fetcher.kafka'
end