dogstatsd-ruby 4.0.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/datadog/statsd.rb +8 -4
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c8e8d0982550cf2f3e3dddee6eee8dcf88534ccf4e26ef47731c2866b85e81f2
|
|
4
|
+
data.tar.gz: 8f9d33a02a6b86e343144c98511e243a65bdaeb2f881ae00cd7842528158f3f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 68e6cc9c4bbbbffa546eaefd643785ca945ae00dfd03d84d5984262d0061f25b059c325063220fd15bdd354d6ec721ba7d50ad7b7c2310d2b64c24b49314ba36
|
|
7
|
+
data.tar.gz: c070c0fd60a513b3c89a8eff5c4c755e38b5d646529840adca886a52651831f7bef1bdf437723329237f1faf4066960bee32ae5e5b6b9f4ddeb1eb69bfb87afe
|
data/lib/datadog/statsd.rb
CHANGED
|
@@ -34,8 +34,8 @@ module Datadog
|
|
|
34
34
|
attr_reader :socket_path
|
|
35
35
|
|
|
36
36
|
def initialize(host, port, socket_path, logger)
|
|
37
|
-
@host = host || DEFAULT_HOST
|
|
38
|
-
@port = port || DEFAULT_PORT
|
|
37
|
+
@host = host || ENV.fetch('DD_AGENT_HOST', nil) || DEFAULT_HOST
|
|
38
|
+
@port = port || ENV.fetch('DD_DOGSTATSD_PORT', nil) || DEFAULT_PORT
|
|
39
39
|
@socket_path = socket_path
|
|
40
40
|
@logger = logger
|
|
41
41
|
end
|
|
@@ -61,7 +61,8 @@ module Datadog
|
|
|
61
61
|
|
|
62
62
|
# Try once to reconnect if the socket has been closed
|
|
63
63
|
retries ||= 1
|
|
64
|
-
if retries <= 1 && boom.is_a?(
|
|
64
|
+
if retries <= 1 && boom.is_a?(Errno::ENOTCONN) or
|
|
65
|
+
retries <= 1 && boom.is_a?(IOError) && boom.message =~ /closed stream/i
|
|
65
66
|
retries += 1
|
|
66
67
|
begin
|
|
67
68
|
@socket = connect
|
|
@@ -180,7 +181,7 @@ module Datadog
|
|
|
180
181
|
DISTRIBUTION_TYPE = 'd'.freeze
|
|
181
182
|
TIMING_TYPE = 'ms'.freeze
|
|
182
183
|
SET_TYPE = 's'.freeze
|
|
183
|
-
VERSION = "4.
|
|
184
|
+
VERSION = "4.2.0".freeze
|
|
184
185
|
|
|
185
186
|
# A namespace to prepend to all statsd calls. Defaults to no namespace.
|
|
186
187
|
attr_reader :namespace
|
|
@@ -222,6 +223,9 @@ module Datadog
|
|
|
222
223
|
raise ArgumentError, 'tags must be a Array<String>' unless tags.nil? or tags.is_a? Array
|
|
223
224
|
@tags = (tags || []).compact.map! {|tag| escape_tag_content(tag)}
|
|
224
225
|
|
|
226
|
+
# append the entity id to tags if DD_ENTITY_ID env var is not nil
|
|
227
|
+
@tags << 'dd.internal.entity_id:' + escape_tag_content(ENV.fetch('DD_ENTITY_ID', nil)) unless ENV.fetch('DD_ENTITY_ID', nil).nil?
|
|
228
|
+
|
|
225
229
|
@batch = Batch.new @connection, max_buffer_bytes
|
|
226
230
|
end
|
|
227
231
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dogstatsd-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rein Henrichs
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-04-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: A Ruby DogStastd client
|
|
14
14
|
email: code@datadoghq.com
|
|
@@ -40,8 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
41
|
version: '0'
|
|
42
42
|
requirements: []
|
|
43
|
-
|
|
44
|
-
rubygems_version: 2.7.7
|
|
43
|
+
rubygems_version: 3.0.2
|
|
45
44
|
signing_key:
|
|
46
45
|
specification_version: 4
|
|
47
46
|
summary: A Ruby DogStatsd client
|