dogstatsd-ruby 4.3.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/datadog/statsd.rb +21 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fde2be6b614574c2555c8cbbd2ca16ef33bcd09837502f482f5f6baf582fd67b
|
4
|
+
data.tar.gz: cc1523c5aa78643d93fc891116c46bb5322dda297f1676cd73d201c9beee2a26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c96177f1ea0ab2288712cf9829cb8408687e12ce0f22f06ddbb1433447a3a4eaf05fe13f0fda8746b9f0e8fad71ea3b0b50ba7d8a028e464db334349951c64b
|
7
|
+
data.tar.gz: 11e23d434a7e88925e049484dfbb252d5c78ce12a4a07fd3c09edca57835db30224cba202f86f57352357acdf2073b8c8e93f20bd403975242b201321bef8ecc
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ dogstatsd-ruby
|
|
4
4
|
|
5
5
|
A client for DogStatsD, an extension of the StatsD metric server for Datadog.
|
6
6
|
|
7
|
-
[![Build Status](https://secure.travis-ci.org/DataDog/dogstatsd-ruby.
|
7
|
+
[![Build Status](https://secure.travis-ci.org/DataDog/dogstatsd-ruby.svg)](http://travis-ci.org/DataDog/dogstatsd-ruby)
|
8
8
|
|
9
9
|
Quick Start Guide
|
10
10
|
-----------------
|
data/lib/datadog/statsd.rb
CHANGED
@@ -44,8 +44,10 @@ module Datadog
|
|
44
44
|
rescue StandardError => boom
|
45
45
|
# Try once to reconnect if the socket has been closed
|
46
46
|
retries ||= 1
|
47
|
-
if retries <= 1 &&
|
48
|
-
|
47
|
+
if retries <= 1 &&
|
48
|
+
(boom.is_a?(Errno::ENOTCONN) or
|
49
|
+
boom.is_a?(Errno::ECONNREFUSED) or
|
50
|
+
boom.is_a?(IOError) && boom.message =~ /closed stream/i)
|
49
51
|
retries += 1
|
50
52
|
begin
|
51
53
|
@socket = connect
|
@@ -192,7 +194,7 @@ module Datadog
|
|
192
194
|
DISTRIBUTION_TYPE = 'd'.freeze
|
193
195
|
TIMING_TYPE = 'ms'.freeze
|
194
196
|
SET_TYPE = 's'.freeze
|
195
|
-
VERSION = "4.
|
197
|
+
VERSION = "4.5.0".freeze
|
196
198
|
|
197
199
|
# A namespace to prepend to all statsd calls. Defaults to no namespace.
|
198
200
|
attr_reader :namespace
|
@@ -407,8 +409,8 @@ module Datadog
|
|
407
409
|
# @param [String] name Service check name
|
408
410
|
# @param [String] status Service check status.
|
409
411
|
# @param [Hash] opts the additional data about the service check
|
410
|
-
# @option opts [Integer, nil] :timestamp (nil) Assign a timestamp to the
|
411
|
-
# @option opts [String, nil] :hostname (nil) Assign a hostname to the
|
412
|
+
# @option opts [Integer, String, nil] :timestamp (nil) Assign a timestamp to the service check. Default is now when none
|
413
|
+
# @option opts [String, nil] :hostname (nil) Assign a hostname to the service check.
|
412
414
|
# @option opts [Array<String>, nil] :tags (nil) An array of tags
|
413
415
|
# @option opts [String, nil] :message (nil) A message to associate with this service check status
|
414
416
|
# @example Report a critical service check status
|
@@ -426,7 +428,7 @@ module Datadog
|
|
426
428
|
# @param [String] title Event title
|
427
429
|
# @param [String] text Event text. Supports newlines (+\n+)
|
428
430
|
# @param [Hash] opts the additional data about the event
|
429
|
-
# @option opts [Integer, nil] :date_happened (nil) Assign a timestamp to the event. Default is now when none
|
431
|
+
# @option opts [Integer, String, nil] :date_happened (nil) Assign a timestamp to the event. Default is now when none
|
430
432
|
# @option opts [String, nil] :hostname (nil) Assign a hostname to the event.
|
431
433
|
# @option opts [String, nil] :aggregation_key (nil) Assign an aggregation key to the event, to group it with some others
|
432
434
|
# @option opts [String, nil] :priority ('normal') Can be "normal" or "low"
|
@@ -486,7 +488,11 @@ module Datadog
|
|
486
488
|
escaped_message = escape_service_check_message(message)
|
487
489
|
sc_string << "|m:#{escaped_message}"
|
488
490
|
else
|
489
|
-
|
491
|
+
if key == :timestamp && opts[key].is_a?(Integer)
|
492
|
+
value = opts[key]
|
493
|
+
else
|
494
|
+
value = remove_pipes(opts[key])
|
495
|
+
end
|
490
496
|
sc_string << "|#{shorthand_key}#{value}"
|
491
497
|
end
|
492
498
|
end
|
@@ -502,7 +508,14 @@ module Datadog
|
|
502
508
|
# All pipes ('|') in the metadata are removed. Title and Text can keep theirs
|
503
509
|
OPTS_KEYS.each do |key, shorthand_key|
|
504
510
|
if key != :tags && opts[key]
|
505
|
-
value
|
511
|
+
# :date_happened is the only key where the value is an Integer
|
512
|
+
# To not break backwards compatibility, we still accept a String
|
513
|
+
if key == :date_happened && opts[key].is_a?(Integer)
|
514
|
+
value = opts[key]
|
515
|
+
# All other keys only have String values
|
516
|
+
else
|
517
|
+
value = remove_pipes(opts[key])
|
518
|
+
end
|
506
519
|
event_string_data << "|#{shorthand_key}:#{value}"
|
507
520
|
end
|
508
521
|
end
|
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.5.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: 2019-
|
11
|
+
date: 2019-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby DogStastd client
|
14
14
|
email: code@datadoghq.com
|