Module: Kafka::Datadog
- Defined in:
- lib/kafka/datadog.rb
Overview
Reports operational metrics to a Datadog agent using the modified Statsd protocol.
require "kafka/datadog"
Kafka::Datadog.namespace = "custom-namespace"
Kafka::Datadog.host = "statsd.something.com"
Kafka::Datadog.port = 1234
Once the file has been required, no further configuration is needed – all operational
metrics are automatically emitted.
Defined Under Namespace
Classes: ConnectionSubscriber, ConsumerSubscriber, ProducerSubscriber, StatsdSubscriber
Constant Summary
collapse
- STATSD_NAMESPACE =
"ruby_kafka"
Class Method Summary
collapse
Class Method Details
.host=(host) ⇒ Object
34
35
36
|
# File 'lib/kafka/datadog.rb', line 34
def self.host=(host)
statsd.host = host
end
|
.namespace=(namespace) ⇒ Object
42
43
44
|
# File 'lib/kafka/datadog.rb', line 42
def self.namespace=(namespace)
statsd.namespace = namespace
end
|
.port=(port) ⇒ Object
38
39
40
|
# File 'lib/kafka/datadog.rb', line 38
def self.port=(port)
statsd.port = port
end
|
.statsd ⇒ Object
30
31
32
|
# File 'lib/kafka/datadog.rb', line 30
def self.statsd
@statsd ||= Statsd.new(Statsd::DEFAULT_HOST, Statsd::DEFAULT_HOST, namespace: STATSD_NAMESPACE)
end
|