dogstatsd-ruby 5.3.2 → 5.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -0
- data/lib/datadog/statsd/connection.rb +1 -1
- data/lib/datadog/statsd/connection_cfg.rb +76 -0
- data/lib/datadog/statsd/forwarder.rb +24 -13
- data/lib/datadog/statsd/sender.rb +23 -7
- data/lib/datadog/statsd/single_thread_sender.rb +7 -3
- data/lib/datadog/statsd/telemetry.rb +22 -1
- data/lib/datadog/statsd/timer.rb +60 -0
- data/lib/datadog/statsd/udp_connection.rb +4 -7
- data/lib/datadog/statsd/version.rb +1 -1
- data/lib/datadog/statsd.rb +20 -3
- metadata +7 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa6ffb63549958aaa8ec14103abbd51082bd945e31d20f0148571ee2c90350b3
|
4
|
+
data.tar.gz: ef1361556ae6de5beb22523187c94ffe7285278918f47d671464b52708ae6973
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba586784b291adaf8a2eaa7a5b866f7931f2c887cb372a69a715f51c0c36a34fba1480cb2ecfd8bbf9573052c2839724fb6389cfa81e157a280e0a75ba0b7072
|
7
|
+
data.tar.gz: 7c2210e57a96e50825362dcedeaa686af6497f85941a9b7dab2a8ca67bbb7cec999d4f13015c5aab90b1a21cb824f5d8c3902cf5dd1421b3a54763a501f441b8
|
data/README.md
CHANGED
@@ -180,6 +180,15 @@ There are three different kinds of messages:
|
|
180
180
|
|
181
181
|
There is also an implicit message which closes the queue which will cause the sender thread to finish processing and exit.
|
182
182
|
|
183
|
+
|
184
|
+
```ruby
|
185
|
+
statsd = Datadog::Statsd.new('localhost', 8125)
|
186
|
+
```
|
187
|
+
|
188
|
+
The message queue's maximum size (in messages) is given by the `sender_queue_size` argument, and has appropriate defaults for UDP (2048) and UDS (512).
|
189
|
+
|
190
|
+
The `buffer_flush_interval`, if enabled, is implemented with an additional thread which manages the timing of those flushes. This additional thread is used even if `single_thread: true`.
|
191
|
+
|
183
192
|
### Usual workflow
|
184
193
|
|
185
194
|
You push metrics to the statsd client which writes them quickly to the sender message queue. The sender thread receives those message, buffers them and flushes them to the connection when the buffer limit is reached.
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Datadog
|
2
|
+
class Statsd
|
3
|
+
class ConnectionCfg
|
4
|
+
attr_reader :host
|
5
|
+
attr_reader :port
|
6
|
+
attr_reader :socket_path
|
7
|
+
attr_reader :transport_type
|
8
|
+
|
9
|
+
def initialize(host: nil, port: nil, socket_path: nil)
|
10
|
+
initialize_with_constructor_args(host: host, port: port, socket_path: socket_path) ||
|
11
|
+
initialize_with_env_vars ||
|
12
|
+
initialize_with_defaults
|
13
|
+
end
|
14
|
+
|
15
|
+
def make_connection(**params)
|
16
|
+
case @transport_type
|
17
|
+
when :udp
|
18
|
+
UDPConnection.new(@host, @port, **params)
|
19
|
+
when :uds
|
20
|
+
UDSConnection.new(@socket_path, **params)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
DEFAULT_HOST = '127.0.0.1'
|
27
|
+
DEFAULT_PORT = 8125
|
28
|
+
|
29
|
+
def initialize_with_constructor_args(host: nil, port: nil, socket_path: nil)
|
30
|
+
try_initialize_with(host: host, port: port, socket_path: socket_path,
|
31
|
+
not_both_error_message:
|
32
|
+
"Both UDP: (host/port #{host}:#{port}) and UDS (socket_path #{socket_path}) " +
|
33
|
+
"constructor arguments were given. Use only one or the other.",
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
def initialize_with_env_vars()
|
38
|
+
try_initialize_with(
|
39
|
+
host: ENV['DD_AGENT_HOST'],
|
40
|
+
port: ENV['DD_DOGSTATSD_PORT'] && ENV['DD_DOGSTATSD_PORT'].to_i,
|
41
|
+
socket_path: ENV['DD_DOGSTATSD_SOCKET'],
|
42
|
+
not_both_error_message:
|
43
|
+
"Both UDP (DD_AGENT_HOST/DD_DOGSTATSD_PORT #{ENV['DD_AGENT_HOST']}:#{ENV['DD_DOGSTATSD_PORT']}) " +
|
44
|
+
"and UDS (DD_DOGSTATSD_SOCKET #{ENV['DD_DOGSTATSD_SOCKET']}) environment variables are set. " +
|
45
|
+
"Set only one or the other." %
|
46
|
+
[ENV['DD_AGENT_HOST'], ENV['DD_DOGSTATSD_PORT'], ENV['DD_DOGSTATSD_SOCKET']])
|
47
|
+
end
|
48
|
+
|
49
|
+
def initialize_with_defaults()
|
50
|
+
try_initialize_with(host: DEFAULT_HOST, port: DEFAULT_PORT)
|
51
|
+
end
|
52
|
+
|
53
|
+
def try_initialize_with(host: nil, port: nil, socket_path: nil, not_both_error_message: "")
|
54
|
+
if (host || port) && socket_path
|
55
|
+
raise ArgumentError, not_both_error_message
|
56
|
+
end
|
57
|
+
|
58
|
+
if host || port
|
59
|
+
@host = host || DEFAULT_HOST
|
60
|
+
@port = port || DEFAULT_PORT
|
61
|
+
@socket_path = nil
|
62
|
+
@transport_type = :udp
|
63
|
+
return true
|
64
|
+
elsif socket_path
|
65
|
+
@host = nil
|
66
|
+
@port = nil
|
67
|
+
@socket_path = socket_path
|
68
|
+
@transport_type = :uds
|
69
|
+
return true
|
70
|
+
end
|
71
|
+
|
72
|
+
return false
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
@@ -7,13 +7,14 @@ module Datadog
|
|
7
7
|
attr_reader :transport_type
|
8
8
|
|
9
9
|
def initialize(
|
10
|
-
|
11
|
-
port: nil,
|
12
|
-
socket_path: nil,
|
10
|
+
connection_cfg: nil,
|
13
11
|
|
14
12
|
buffer_max_payload_size: nil,
|
15
13
|
buffer_max_pool_size: nil,
|
16
14
|
buffer_overflowing_stategy: :drop,
|
15
|
+
buffer_flush_interval: nil,
|
16
|
+
|
17
|
+
sender_queue_size: nil,
|
17
18
|
|
18
19
|
telemetry_flush_interval: nil,
|
19
20
|
global_tags: [],
|
@@ -22,24 +23,20 @@ module Datadog
|
|
22
23
|
|
23
24
|
logger: nil
|
24
25
|
)
|
25
|
-
@transport_type =
|
26
|
+
@transport_type = connection_cfg.transport_type
|
26
27
|
|
27
28
|
if telemetry_flush_interval
|
28
29
|
@telemetry = Telemetry.new(telemetry_flush_interval,
|
29
30
|
global_tags: global_tags,
|
30
|
-
transport_type: transport_type
|
31
|
+
transport_type: @transport_type
|
31
32
|
)
|
32
33
|
end
|
33
34
|
|
34
|
-
@connection =
|
35
|
-
when :udp
|
36
|
-
UDPConnection.new(host, port, logger: logger, telemetry: telemetry)
|
37
|
-
when :uds
|
38
|
-
UDSConnection.new(socket_path, logger: logger, telemetry: telemetry)
|
39
|
-
end
|
35
|
+
@connection = connection_cfg.make_connection(logger: logger, telemetry: telemetry)
|
40
36
|
|
41
37
|
# Initialize buffer
|
42
|
-
buffer_max_payload_size ||= (transport_type == :udp ?
|
38
|
+
buffer_max_payload_size ||= (@transport_type == :udp ?
|
39
|
+
UDP_DEFAULT_BUFFER_SIZE : UDS_DEFAULT_BUFFER_SIZE)
|
43
40
|
|
44
41
|
if buffer_max_payload_size <= 0
|
45
42
|
raise ArgumentError, 'buffer_max_payload_size cannot be <= 0'
|
@@ -54,7 +51,21 @@ module Datadog
|
|
54
51
|
max_pool_size: buffer_max_pool_size || DEFAULT_BUFFER_POOL_SIZE,
|
55
52
|
overflowing_stategy: buffer_overflowing_stategy,
|
56
53
|
)
|
57
|
-
|
54
|
+
|
55
|
+
sender_queue_size ||= (@transport_type == :udp ?
|
56
|
+
UDP_DEFAULT_SENDER_QUEUE_SIZE : UDS_DEFAULT_SENDER_QUEUE_SIZE)
|
57
|
+
|
58
|
+
@sender = single_thread ?
|
59
|
+
SingleThreadSender.new(
|
60
|
+
buffer,
|
61
|
+
logger: logger,
|
62
|
+
flush_interval: buffer_flush_interval) :
|
63
|
+
Sender.new(
|
64
|
+
buffer,
|
65
|
+
logger: logger,
|
66
|
+
flush_interval: buffer_flush_interval,
|
67
|
+
telemetry: @telemetry,
|
68
|
+
queue_size: sender_queue_size)
|
58
69
|
@sender.start
|
59
70
|
end
|
60
71
|
|
@@ -12,10 +12,17 @@ module Datadog
|
|
12
12
|
class Sender
|
13
13
|
CLOSEABLE_QUEUES = Queue.instance_methods.include?(:close)
|
14
14
|
|
15
|
-
def initialize(message_buffer, logger: nil)
|
15
|
+
def initialize(message_buffer, telemetry: nil, queue_size: UDP_DEFAULT_BUFFER_SIZE, logger: nil, flush_interval: nil, queue_class: Queue, thread_class: Thread)
|
16
16
|
@message_buffer = message_buffer
|
17
|
+
@telemetry = telemetry
|
18
|
+
@queue_size = queue_size
|
17
19
|
@logger = logger
|
18
20
|
@mx = Mutex.new
|
21
|
+
@queue_class = queue_class
|
22
|
+
@thread_class = thread_class
|
23
|
+
if flush_interval
|
24
|
+
@flush_timer = Datadog::Statsd::Timer.new(flush_interval) { flush(sync: true) }
|
25
|
+
end
|
19
26
|
end
|
20
27
|
|
21
28
|
def flush(sync: false)
|
@@ -42,7 +49,7 @@ module Datadog
|
|
42
49
|
return unless message_queue
|
43
50
|
|
44
51
|
# Initialize and get the thread's sync queue
|
45
|
-
queue = (
|
52
|
+
queue = (@thread_class.current[:statsd_sync_queue] ||= @queue_class.new)
|
46
53
|
# tell sender-thread to notify us in the current
|
47
54
|
# thread's queue
|
48
55
|
message_queue.push(queue)
|
@@ -68,19 +75,26 @@ module Datadog
|
|
68
75
|
@message_queue = nil
|
69
76
|
message_buffer.reset
|
70
77
|
start
|
78
|
+
@flush_timer.start if @flush_timer && @flush_timer.stop?
|
71
79
|
}
|
72
80
|
end
|
73
81
|
|
74
|
-
message_queue
|
82
|
+
if message_queue.length <= @queue_size
|
83
|
+
message_queue << message
|
84
|
+
else
|
85
|
+
@telemetry.dropped_queue(packets: 1, bytes: message.bytesize) if @telemetry
|
86
|
+
end
|
75
87
|
end
|
76
88
|
|
77
89
|
def start
|
78
90
|
raise ArgumentError, 'Sender already started' if message_queue
|
79
91
|
|
80
92
|
# initialize a new message queue for the background thread
|
81
|
-
@message_queue =
|
93
|
+
@message_queue = @queue_class.new
|
82
94
|
# start background thread
|
83
|
-
@sender_thread =
|
95
|
+
@sender_thread = @thread_class.new(&method(:send_loop))
|
96
|
+
@sender_thread.name = "Statsd Sender" unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
|
97
|
+
@flush_timer.start if @flush_timer
|
84
98
|
end
|
85
99
|
|
86
100
|
if CLOSEABLE_QUEUES
|
@@ -91,6 +105,7 @@ module Datadog
|
|
91
105
|
message_queue = @message_queue
|
92
106
|
message_queue.close if message_queue
|
93
107
|
|
108
|
+
@flush_timer.stop if @flush_timer
|
94
109
|
sender_thread = @sender_thread
|
95
110
|
sender_thread.join if sender_thread && join_worker
|
96
111
|
end
|
@@ -102,6 +117,7 @@ module Datadog
|
|
102
117
|
message_queue = @message_queue
|
103
118
|
message_queue << :close if message_queue
|
104
119
|
|
120
|
+
@flush_timer.stop if @flush_timer
|
105
121
|
sender_thread = @sender_thread
|
106
122
|
sender_thread.join if sender_thread && join_worker
|
107
123
|
end
|
@@ -123,7 +139,7 @@ module Datadog
|
|
123
139
|
case message
|
124
140
|
when :flush
|
125
141
|
message_buffer.flush
|
126
|
-
when
|
142
|
+
when @queue_class
|
127
143
|
message.push(:go_on)
|
128
144
|
else
|
129
145
|
message_buffer.add(message)
|
@@ -145,7 +161,7 @@ module Datadog
|
|
145
161
|
break
|
146
162
|
when :flush
|
147
163
|
message_buffer.flush
|
148
|
-
when
|
164
|
+
when @queue_class
|
149
165
|
message.push(:go_on)
|
150
166
|
else
|
151
167
|
message_buffer.add(message)
|
@@ -7,10 +7,13 @@ module Datadog
|
|
7
7
|
# It is using current Process.PID to check it is the result of a recent fork
|
8
8
|
# and it is reseting the MessageBuffer if that's the case.
|
9
9
|
class SingleThreadSender
|
10
|
-
def initialize(message_buffer, logger: nil)
|
10
|
+
def initialize(message_buffer, logger: nil, flush_interval: nil)
|
11
11
|
@message_buffer = message_buffer
|
12
12
|
@logger = logger
|
13
13
|
@mx = Mutex.new
|
14
|
+
if flush_interval
|
15
|
+
@flush_timer = Datadog::Statsd::Timer.new(flush_interval) { flush }
|
16
|
+
end
|
14
17
|
# store the pid for which this sender has been created
|
15
18
|
update_fork_pid
|
16
19
|
end
|
@@ -21,6 +24,7 @@ module Datadog
|
|
21
24
|
# not send, they belong to the parent process, let's clear the buffer.
|
22
25
|
if forked?
|
23
26
|
@message_buffer.reset
|
27
|
+
@flush_timer.start if @flush_timer && @flush_timer.stop?
|
24
28
|
update_fork_pid
|
25
29
|
end
|
26
30
|
@message_buffer.add(message)
|
@@ -33,12 +37,12 @@ module Datadog
|
|
33
37
|
}
|
34
38
|
end
|
35
39
|
|
36
|
-
# Compatibility with `Sender`
|
37
40
|
def start()
|
41
|
+
@flush_timer.start if @flush_timer
|
38
42
|
end
|
39
43
|
|
40
|
-
# Compatibility with `Sender`
|
41
44
|
def stop()
|
45
|
+
@flush_timer.stop if @flush_timer
|
42
46
|
end
|
43
47
|
|
44
48
|
# Compatibility with `Sender`
|
@@ -9,8 +9,12 @@ module Datadog
|
|
9
9
|
attr_reader :service_checks
|
10
10
|
attr_reader :bytes_sent
|
11
11
|
attr_reader :bytes_dropped
|
12
|
+
attr_reader :bytes_dropped_queue
|
13
|
+
attr_reader :bytes_dropped_writer
|
12
14
|
attr_reader :packets_sent
|
13
15
|
attr_reader :packets_dropped
|
16
|
+
attr_reader :packets_dropped_queue
|
17
|
+
attr_reader :packets_dropped_writer
|
14
18
|
|
15
19
|
# Rough estimation of maximum telemetry message size without tags
|
16
20
|
MAX_TELEMETRY_MESSAGE_SIZE_WT_TAGS = 50 # bytes
|
@@ -40,8 +44,12 @@ module Datadog
|
|
40
44
|
@service_checks = 0
|
41
45
|
@bytes_sent = 0
|
42
46
|
@bytes_dropped = 0
|
47
|
+
@bytes_dropped_queue = 0
|
48
|
+
@bytes_dropped_writer = 0
|
43
49
|
@packets_sent = 0
|
44
50
|
@packets_dropped = 0
|
51
|
+
@packets_dropped_queue = 0
|
52
|
+
@packets_dropped_writer = 0
|
45
53
|
@next_flush_time = now_in_s + @flush_interval
|
46
54
|
end
|
47
55
|
|
@@ -54,9 +62,18 @@ module Datadog
|
|
54
62
|
@packets_sent += packets
|
55
63
|
end
|
56
64
|
|
57
|
-
def
|
65
|
+
def dropped_queue(bytes: 0, packets: 0)
|
58
66
|
@bytes_dropped += bytes
|
67
|
+
@bytes_dropped_queue += bytes
|
59
68
|
@packets_dropped += packets
|
69
|
+
@packets_dropped_queue += packets
|
70
|
+
end
|
71
|
+
|
72
|
+
def dropped_writer(bytes: 0, packets: 0)
|
73
|
+
@bytes_dropped += bytes
|
74
|
+
@bytes_dropped_writer += bytes
|
75
|
+
@packets_dropped += packets
|
76
|
+
@packets_dropped_writer += packets
|
60
77
|
end
|
61
78
|
|
62
79
|
def should_flush?
|
@@ -70,8 +87,12 @@ module Datadog
|
|
70
87
|
sprintf(pattern, 'service_checks', @service_checks),
|
71
88
|
sprintf(pattern, 'bytes_sent', @bytes_sent),
|
72
89
|
sprintf(pattern, 'bytes_dropped', @bytes_dropped),
|
90
|
+
sprintf(pattern, 'bytes_dropped_queue', @bytes_dropped_queue),
|
91
|
+
sprintf(pattern, 'bytes_dropped_writer', @bytes_dropped_writer),
|
73
92
|
sprintf(pattern, 'packets_sent', @packets_sent),
|
74
93
|
sprintf(pattern, 'packets_dropped', @packets_dropped),
|
94
|
+
sprintf(pattern, 'packets_dropped_queue', @packets_dropped_queue),
|
95
|
+
sprintf(pattern, 'packets_dropped_writer', @packets_dropped_writer),
|
75
96
|
]
|
76
97
|
end
|
77
98
|
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Datadog
|
4
|
+
class Statsd
|
5
|
+
class Timer
|
6
|
+
def initialize(interval, &callback)
|
7
|
+
@mx = Mutex.new
|
8
|
+
@cv = ConditionVariable.new
|
9
|
+
@interval = interval
|
10
|
+
@callback = callback
|
11
|
+
@stop = true
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
return unless stop?
|
16
|
+
|
17
|
+
@stop = false
|
18
|
+
@thread = Thread.new do
|
19
|
+
last_execution_time = current_time
|
20
|
+
@mx.synchronize do
|
21
|
+
until @stop
|
22
|
+
timeout = @interval - (current_time - last_execution_time)
|
23
|
+
@cv.wait(@mx, timeout > 0 ? timeout : 0)
|
24
|
+
last_execution_time = current_time
|
25
|
+
@callback.call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
@thread.name = 'Statsd Timer' unless Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3')
|
30
|
+
end
|
31
|
+
|
32
|
+
def stop
|
33
|
+
return if @thread.nil?
|
34
|
+
|
35
|
+
@stop = true
|
36
|
+
@mx.synchronize do
|
37
|
+
@cv.signal
|
38
|
+
end
|
39
|
+
@thread.join
|
40
|
+
@thread = nil
|
41
|
+
end
|
42
|
+
|
43
|
+
def stop?
|
44
|
+
@thread.nil? || @thread.stop?
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
if Process.const_defined?(:CLOCK_MONOTONIC)
|
50
|
+
def current_time
|
51
|
+
Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
52
|
+
end
|
53
|
+
else
|
54
|
+
def current_time
|
55
|
+
Time.now
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -5,20 +5,17 @@ require_relative 'connection'
|
|
5
5
|
module Datadog
|
6
6
|
class Statsd
|
7
7
|
class UDPConnection < Connection
|
8
|
-
|
9
|
-
DEFAULT_PORT = 8125
|
10
|
-
|
11
|
-
# StatsD host. Defaults to 127.0.0.1.
|
8
|
+
# StatsD host.
|
12
9
|
attr_reader :host
|
13
10
|
|
14
|
-
# StatsD port.
|
11
|
+
# StatsD port.
|
15
12
|
attr_reader :port
|
16
13
|
|
17
14
|
def initialize(host, port, **kwargs)
|
18
15
|
super(**kwargs)
|
19
16
|
|
20
|
-
@host = host
|
21
|
-
@port = port
|
17
|
+
@host = host
|
18
|
+
@port = port
|
22
19
|
@socket = nil
|
23
20
|
end
|
24
21
|
|
data/lib/datadog/statsd.rb
CHANGED
@@ -5,11 +5,13 @@ require_relative 'statsd/version'
|
|
5
5
|
require_relative 'statsd/telemetry'
|
6
6
|
require_relative 'statsd/udp_connection'
|
7
7
|
require_relative 'statsd/uds_connection'
|
8
|
+
require_relative 'statsd/connection_cfg'
|
8
9
|
require_relative 'statsd/message_buffer'
|
9
10
|
require_relative 'statsd/serialization'
|
10
11
|
require_relative 'statsd/sender'
|
11
12
|
require_relative 'statsd/single_thread_sender'
|
12
13
|
require_relative 'statsd/forwarder'
|
14
|
+
require_relative 'statsd/timer'
|
13
15
|
|
14
16
|
$deprecation_message_mutex = Mutex.new
|
15
17
|
$deprecation_message_done = false
|
@@ -43,7 +45,12 @@ module Datadog
|
|
43
45
|
UDP_DEFAULT_BUFFER_SIZE = 1_432
|
44
46
|
UDS_DEFAULT_BUFFER_SIZE = 8_192
|
45
47
|
DEFAULT_BUFFER_POOL_SIZE = Float::INFINITY
|
48
|
+
|
49
|
+
UDP_DEFAULT_SENDER_QUEUE_SIZE = 2048
|
50
|
+
UDS_DEFAULT_SENDER_QUEUE_SIZE = 512
|
51
|
+
|
46
52
|
MAX_EVENT_SIZE = 8 * 1_024
|
53
|
+
|
47
54
|
# minimum flush interval for the telemetry in seconds
|
48
55
|
DEFAULT_TELEMETRY_FLUSH_INTERVAL = 10
|
49
56
|
|
@@ -72,6 +79,8 @@ module Datadog
|
|
72
79
|
# @option [Logger] logger for debugging
|
73
80
|
# @option [Integer] buffer_max_payload_size max bytes to buffer
|
74
81
|
# @option [Integer] buffer_max_pool_size max messages to buffer
|
82
|
+
# @option [Integer] sender_queue_size size of the sender queue in number of buffers (multi-thread only)
|
83
|
+
# @option [Numeric] buffer_flush_interval interval in second to flush buffer
|
75
84
|
# @option [String] socket_path unix socket path
|
76
85
|
# @option [Float] default sample rate if not overridden
|
77
86
|
# @option [Boolean] single_thread flushes the metrics on the main thread instead of in a companion thread
|
@@ -87,6 +96,9 @@ module Datadog
|
|
87
96
|
buffer_max_payload_size: nil,
|
88
97
|
buffer_max_pool_size: nil,
|
89
98
|
buffer_overflowing_stategy: :drop,
|
99
|
+
buffer_flush_interval: nil,
|
100
|
+
|
101
|
+
sender_queue_size: nil,
|
90
102
|
|
91
103
|
logger: nil,
|
92
104
|
|
@@ -118,9 +130,11 @@ module Datadog
|
|
118
130
|
end
|
119
131
|
|
120
132
|
@forwarder = Forwarder.new(
|
121
|
-
|
122
|
-
|
123
|
-
|
133
|
+
connection_cfg: ConnectionCfg.new(
|
134
|
+
host: host,
|
135
|
+
port: port,
|
136
|
+
socket_path: socket_path,
|
137
|
+
),
|
124
138
|
|
125
139
|
global_tags: tags,
|
126
140
|
logger: logger,
|
@@ -130,6 +144,9 @@ module Datadog
|
|
130
144
|
buffer_max_payload_size: buffer_max_payload_size,
|
131
145
|
buffer_max_pool_size: buffer_max_pool_size,
|
132
146
|
buffer_overflowing_stategy: buffer_overflowing_stategy,
|
147
|
+
buffer_flush_interval: buffer_flush_interval,
|
148
|
+
|
149
|
+
sender_queue_size: sender_queue_size,
|
133
150
|
|
134
151
|
telemetry_flush_interval: telemetry_enable ? telemetry_flush_interval : nil,
|
135
152
|
)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dogstatsd-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.3.
|
4
|
+
version: 5.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rein Henrichs
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-02 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A Ruby DogStatsd client
|
15
15
|
email: code@datadoghq.com
|
@@ -23,6 +23,7 @@ files:
|
|
23
23
|
- README.md
|
24
24
|
- lib/datadog/statsd.rb
|
25
25
|
- lib/datadog/statsd/connection.rb
|
26
|
+
- lib/datadog/statsd/connection_cfg.rb
|
26
27
|
- lib/datadog/statsd/forwarder.rb
|
27
28
|
- lib/datadog/statsd/message_buffer.rb
|
28
29
|
- lib/datadog/statsd/sender.rb
|
@@ -34,6 +35,7 @@ files:
|
|
34
35
|
- lib/datadog/statsd/serialization/tag_serializer.rb
|
35
36
|
- lib/datadog/statsd/single_thread_sender.rb
|
36
37
|
- lib/datadog/statsd/telemetry.rb
|
38
|
+
- lib/datadog/statsd/timer.rb
|
37
39
|
- lib/datadog/statsd/udp_connection.rb
|
38
40
|
- lib/datadog/statsd/uds_connection.rb
|
39
41
|
- lib/datadog/statsd/version.rb
|
@@ -42,9 +44,9 @@ licenses:
|
|
42
44
|
- MIT
|
43
45
|
metadata:
|
44
46
|
bug_tracker_uri: https://github.com/DataDog/dogstatsd-ruby/issues
|
45
|
-
changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.3.
|
46
|
-
documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.3.
|
47
|
-
source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.3.
|
47
|
+
changelog_uri: https://github.com/DataDog/dogstatsd-ruby/blob/v5.3.3/CHANGELOG.md
|
48
|
+
documentation_uri: https://www.rubydoc.info/gems/dogstatsd-ruby/5.3.3
|
49
|
+
source_code_uri: https://github.com/DataDog/dogstatsd-ruby/tree/v5.3.3
|
48
50
|
post_install_message: |2+
|
49
51
|
|
50
52
|
If you are upgrading from v4.x of the dogstatsd-ruby library, note the major change to the threading model:
|