Module: DeliveryBoy::Datadog
- Defined in:
- lib/delivery_boy/datadog.rb
Overview
Defined Under Namespace
Classes: ProducerSubscriber, StatsdSubscriber
Constant Summary
collapse
- STATSD_NAMESPACE =
"ruby_kafka"
Class Attribute Summary collapse
Class Method Summary
collapse
Class Attribute Details
.host ⇒ Object
Returns the value of attribute host.
30
31
32
|
# File 'lib/delivery_boy/datadog.rb', line 30
def host
@host
end
|
.port ⇒ Object
Returns the value of attribute port.
30
31
32
|
# File 'lib/delivery_boy/datadog.rb', line 30
def port
@port
end
|
.socket_path ⇒ Object
Returns the value of attribute socket_path.
30
31
32
|
# File 'lib/delivery_boy/datadog.rb', line 30
def socket_path
@socket_path
end
|
Class Method Details
.close ⇒ Object
82
83
84
|
# File 'lib/delivery_boy/datadog.rb', line 82
def close
@statsd&.close
end
|
32
33
34
|
# File 'lib/delivery_boy/datadog.rb', line 32
def configure
yield self
end
|
.namespace ⇒ Object
64
65
66
|
# File 'lib/delivery_boy/datadog.rb', line 64
def namespace
@namespace ||= STATSD_NAMESPACE
end
|
.namespace=(namespace) ⇒ Object
68
69
70
71
|
# File 'lib/delivery_boy/datadog.rb', line 68
def namespace=(namespace)
@namespace = namespace
clear
end
|
.statsd ⇒ Object
36
37
38
39
40
41
42
|
# File 'lib/delivery_boy/datadog.rb', line 36
def statsd
@statsd ||= if socket_path
::Datadog::Statsd.new(socket_path: socket_path, namespace: namespace, tags: tags)
else
::Datadog::Statsd.new(host, port, namespace: namespace, tags: tags)
end
end
|
.statsd=(statsd) ⇒ Object
44
45
46
47
|
# File 'lib/delivery_boy/datadog.rb', line 44
def statsd=(statsd)
clear
@statsd = statsd
end
|
73
74
75
|
# File 'lib/delivery_boy/datadog.rb', line 73
def tags
@tags ||= []
end
|
77
78
79
80
|
# File 'lib/delivery_boy/datadog.rb', line 77
def tags=(tags)
@tags = tags
clear
end
|