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: AsyncProducerSubscriber, ConnectionSubscriber, ConsumerSubscriber, FetcherSubscriber, ProducerSubscriber, StatsdSubscriber
Constant Summary
collapse
- STATSD_NAMESPACE =
"ruby_kafka"
Class Method Summary
collapse
Class Method Details
.host ⇒ Object
42
43
44
|
# File 'lib/kafka/datadog.rb', line 42
def host
@host
end
|
.host=(host) ⇒ Object
46
47
48
49
|
# File 'lib/kafka/datadog.rb', line 46
def host=(host)
@host = host
clear
end
|
.namespace ⇒ Object
69
70
71
|
# File 'lib/kafka/datadog.rb', line 69
def namespace
@namespace ||= STATSD_NAMESPACE
end
|
.namespace=(namespace) ⇒ Object
73
74
75
76
|
# File 'lib/kafka/datadog.rb', line 73
def namespace=(namespace)
@namespace = namespace
clear
end
|
.port ⇒ Object
51
52
53
|
# File 'lib/kafka/datadog.rb', line 51
def port
@port
end
|
.port=(port) ⇒ Object
55
56
57
58
|
# File 'lib/kafka/datadog.rb', line 55
def port=(port)
@port = port
clear
end
|
.socket_path ⇒ Object
60
61
62
|
# File 'lib/kafka/datadog.rb', line 60
def socket_path
@socket_path
end
|
.socket_path=(socket_path) ⇒ Object
64
65
66
67
|
# File 'lib/kafka/datadog.rb', line 64
def socket_path=(socket_path)
@socket_path = socket_path
clear
end
|
.statsd ⇒ Object
33
34
35
|
# File 'lib/kafka/datadog.rb', line 33
def statsd
@statsd ||= ::Datadog::Statsd.new(host, port, namespace: namespace, tags: tags, socket_path: socket_path)
end
|
.statsd=(statsd) ⇒ Object
37
38
39
40
|
# File 'lib/kafka/datadog.rb', line 37
def statsd=(statsd)
clear
@statsd = statsd
end
|
78
79
80
|
# File 'lib/kafka/datadog.rb', line 78
def tags
@tags ||= []
end
|
82
83
84
85
|
# File 'lib/kafka/datadog.rb', line 82
def tags=(tags)
@tags = tags
clear
end
|