puma-plugin-statsd 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -2
- data/lib/puma/plugin/statsd.rb +9 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 359b3281a2ce1173373bba01c4ca0981772d63af2719daead709efb87b0f19bd
|
4
|
+
data.tar.gz: 2b11561ad00b73a80c8cea674fad5bce390a9e384169f68bb77f0445b006d8b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c5da2367dfa0d796258d9d8ecda4a70d4225946669e4ad30aefd4196c86f3b03f3fd99894dc5cbc55afede49b2559bbaac5217f4b9b97622ab0c4105dd0d5f5
|
7
|
+
data.tar.gz: be824e394c2b04ad4f6e80a32db242e2a3e74db512b8ec3720a41a1e3ba1ca45dd2e0221a951b71f8c6e2c8a90e2fc03b63dd865e0f63978c5f1b4eb9ff816b1
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.2.0 2022-07-31
|
4
|
+
|
5
|
+
* Support communicating with the Datadog agent via a UNIX socket (set STATSD_SOCKET_PATH env var) (PR #[38](https://github.com/yob/puma-plugin-statsd/pull/38))
|
6
|
+
|
3
7
|
## 2.1.0 2021-12-04
|
4
8
|
|
5
|
-
* Adds support for Datadog unified service tagging (env, service, version) (PR #[
|
9
|
+
* Adds support for Datadog unified service tagging (env, service, version) (PR #[37](https://github.com/yob/puma-plugin-statsd/pull/37))
|
6
10
|
|
7
11
|
## 2.0.0 2021-07-27
|
8
12
|
|
9
13
|
* Require puma 5 or better
|
10
14
|
* Split DD_TAGS environment variable by commas or spaces (PR #[31](https://github.com/yob/puma-plugin-statsd/pull/31))
|
11
|
-
* Gracefully handle
|
15
|
+
* Gracefully handle unexpected errors when submitting to statsd (like DNS resolution failures) (PR #[35](https://github.com/yob/puma-plugin-statsd/pull/35))
|
12
16
|
|
13
17
|
## 1.2.1 2021-01-11
|
14
18
|
|
data/lib/puma/plugin/statsd.rb
CHANGED
@@ -13,14 +13,21 @@ class StatsdConnector
|
|
13
13
|
def initialize
|
14
14
|
@host = ENV.fetch(ENV_NAME, "127.0.0.1")
|
15
15
|
@port = ENV.fetch("STATSD_PORT", 8125)
|
16
|
+
@socket_path = ENV.fetch("STATSD_SOCKET_PATH", nil)
|
16
17
|
end
|
17
18
|
|
18
19
|
def send(metric_name:, value:, type:, tags: nil)
|
19
20
|
data = "#{metric_name}:#{value}|#{STATSD_TYPES.fetch(type)}"
|
20
21
|
data = "#{data}|##{tags}" unless tags.nil?
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
if @socket_path
|
24
|
+
socket = Socket.new(Socket::AF_UNIX, Socket::SOCK_DGRAM)
|
25
|
+
socket.connect(Socket.pack_sockaddr_un(@socket_path))
|
26
|
+
socket.sendmsg_nonblock(data)
|
27
|
+
else
|
28
|
+
socket = UDPSocket.new
|
29
|
+
socket.send(data, 0, host, port)
|
30
|
+
end
|
24
31
|
ensure
|
25
32
|
socket.close
|
26
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma-plugin-statsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Healy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: puma
|
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
|
-
rubygems_version: 3.
|
134
|
+
rubygems_version: 3.3.7
|
135
135
|
signing_key:
|
136
136
|
specification_version: 4
|
137
137
|
summary: Send puma metrics to statsd via a background thread
|